[Gambas-user] WebTree shows "Class name hidden by local declaration" on compiling

Bruce Steers bsteers4 at gmail.com
Sun Apr 24 17:29:45 CEST 2022


It's because "Key" is a class name also,

You can use parentheses to make the name Key local to the method
Ie...

Private sColl As Collection

Public Sub WebTree1_Data((Key) As String, Column As Integer, Data As
WebTreeData)

  If Column = 1 Then
    Data.Html = sColl[Key]
  Endif

End


On Sun, 24 Apr 2022 at 10:40, Safiur Rahman <isafiur at gmail.com> wrote:

> Hi Benoît
>
> When I use both collection and WebTree_Data in a webform, I get a
> message "Class name hidden by local declaration: Key" on compiling.
>
> Private sColl As Collection
>
> Public Sub WebTree1_Data(Key As String, Column As Integer, Data As
> WebTreeData)
>
>   If Column = 1 Then
>     Data.Html = sColl[Key]
>   Endif
>
> End
>
> (Attached a project to reproduce it)
>
> --
> Regards
> Safiur Rahman
>
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20220424/571a79ad/attachment.htm>


More information about the User mailing list