I am running this simple code
cUserName := "Luis"
If cUserName <> ""
? "Not Empty"
Else
? "Empty"
EndIf
The response is "Empty".
I tried everything that I can think.
Driving me crazy...
Thanks
IF
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: IF
Luis,
Code: Select all
If ! cUserName == ""
? "Not Empty"
Else
? "Empty"
EndIf
- MarcoBoschi
- Posts: 925
- Joined: Thu Nov 17, 2005 11:08 am
- Location: Padova - Italy
- Contact:
Re: IF
Code: Select all
[#include "Set.ch"
FUNCTION MAIN()
? set(_SET_EXACT )
cUserName := "Luis"
If cUserName <> ""
? "Not Empty"
Else
? "Empty"
EndIf
SET EXACT ON
? set(_SET_EXACT )
cUserName := "Luis"
If cUserName <> ""
? "Not Empty"
Else
? "Empty"
EndIf
RETURN NIL
SET EXACT
Determines the mode for character string comparison.
Syntax
SET EXACT on | OFF | ( <lOnOff> )
Arguments
on | OFF | ( <lOnOff> )
on | OFF | ( <lOnOff> )
This option toggles if an exact comparison is performed with character strings. or not.
The default is OFF or .F. (false), i.e. characters are compared up the length of the shorter string.
To change the setting use ON or .T. (true) as parameter.
The parameter can also be specified as a logical expression enclosed in parentheses.
Marco Boschi
info@marcoboschi.it
info@marcoboschi.it
-
- Posts: 21
- Joined: Mon Mar 02, 2020 12:00 am
Re: IF
Basically this ! variable == "" works
This variable <> "" does not
this variable != "" does not....
This variable <> "" does not
this variable != "" does not....