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

Bruce Steers bsteers4 at gmail.com
Tue Aug 1 14:28:30 CEST 2023


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.

>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20230801/267b1e41/attachment.htm>


More information about the User mailing list