why "If Not" don't works ?

sirjo66

Well-Known Member
Licensed User
Longtime User
This code works:
B4X:
If File.IsDirectory(strDir, strFile) Then

This NOT works:
B4X:
If Not File.IsDirectory(strDir, strFile) Then

it tell me: syntax error

..... why ???

I need to write
B4X:
If File.IsDirectory(strDir, strFile) = False Then

but is not very good

Sergio
 

Jost aus Soest

Active Member
Licensed User
Longtime User
IMHO to many parenthesis needed.

But the question remains:
Why do we have to use contextual useless parenthesis?

B4X:
'Not' should be an operator:
'If Not(b) Then  ==>
If Not b Then

'Calling a sub without returning a value:
'DoSomething(a)  ==>
DoSomething a

Parenthesis are making the code so C-ish (aka ugly).
 
Last edited:
Upvote 0
Top