[Gambas-user] Check Boxes (a bug?)

T Lee Davidson t.lee.davidson at gmail.com
Sat Jun 12 03:52:31 CEST 2021


On 6/11/21 7:10 PM, John Dovey wrote:
> Never mind. Found it.
> Changed the line
> If myFlag Then myAflagsString.Add(myAflags.Key)
> to
> If myFlag = -1 Then myAflagsString.Add(myAflags.Key)
> 

A True value is represented internally as -1. So, the unchanged line should have worked (it did for me in your project).

Given this code:
' Gambas module file

Public Sub Main()

   Dim cFlags As Collection = ["one": True, "two": -1]

   If cFlags["one"] Then Print "One is true"
   If cFlags["two"] Then Print "Two is also true"

End

The output is:
One is true
Two is also true


-- 
Lee


More information about the User mailing list