[Gambas-user] Bad logic on my part

Rolf-Werner Eilert rwe-sse at osnanet.de
Thu Aug 16 08:26:03 CEST 2018


Am 16.08.2018 um 07:46 schrieb Me:
> What the *@^^& have I got wrong here?
> 
> Dim Data As Variant[]
> If (TypeOf(Data[13]) = gb.Integer And If Data[13] > 3) Then ...
> 
> gives a "Missing ")" in class ..." message at the compile time.
> 
> Data[13] is either an integer or a string.
> 
> (Leave town for 30 seconds and they change everything.)
> 
> tia
> b
> 

If using brackets, shouldn't it be something like

If (TypeOf(Data[13]) = gb.Integer) And If (Data[13] > 3) Then...

However, I would have used

If TypeOf(Data[13]) = gb.Integer And Data[13] > 3 Then...

Is there really a difference?

Regards
Rolf


More information about the User mailing list