[Gambas-user] Warning: Class name hidden by local declaration: key

Demosthenes Koptsis demosthenesk at gmail.com
Tue Aug 1 14:33:30 CEST 2023


ok!

On 8/1/23 15:28, Bruce Steers wrote:
>
>
> On Tue, 1 Aug 2023, 12:25 Demosthenes Koptsis, 
> <demosthenesk at gmail.com> wrote:
>
>     i wrote a demo code for Action property as follows...
>
>     i have a Form with a Menu and a Button for "save" Action
>
>     ------------------------------------------------------------
>
>     ' Gambas class file
>
>     Public Sub Form_Open()
>       Me.Center
>       Menu1.Action = "save"
>       Button1.Action = "save"
>     End
>
>     Public Sub Action_Activate(key As String) As Boolean
>       Select Case key
>       Case "save"
>       ' call save sub at here
>        Print "save to a file."
>       End Select
>     End
>
>     ------------------------------------------------------------
>
>     i get a warning at line 9, Public Sub Action_Activate(key As
>     String) As
>     Boolean
>
>     Class name hidden by local declaration: key
>
>
>     What does this mean ?
>
>
>     ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>
>
> Key is a class name, you can use it as a parametername but it must be 
> in parentheses
>
> Action_Activate((key) As String) As
> Boolean
>
> It is better to use a different word if you also want to use Key.class 
> in the function.
>
>
> ----[http://gambaswiki.org/wiki/doc/netiquette  ]----
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20230801/380fa725/attachment-0001.htm>


More information about the User mailing list