| View previous topic :: View next topic |
| Author |
Message |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Sun Feb 06, 2005 7:22 pm Post subject: empty varible question |
|
|
hello all
I have a problem that i can't firgure out..i know there has to be a way to do this but i must be over looking something..
how to have a varible check to see if its "empty" if so do something else
i have tried equal, not equal, etc and i still get a erorr cuase the varible is empty
thanks _________________ Have a nice day  |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Sun Feb 06, 2005 8:27 pm Post subject: |
|
|
Hey tim,
If your var contains visible chars, ya can use:
if @not(%%myvar)
(true if var is empty)
or
if %%myvar
(true if var is not empty)
If a var only contains blanks etc. this does not work.
Cheers, Mac  _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
 |
|
| Back to top |
|
 |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Sun Feb 06, 2005 9:11 pm Post subject: |
|
|
thanks but yea my varible does contain blanks
looks like i will have to re-do this part of the script  _________________ Have a nice day  |
|
| Back to top |
|
 |
kOt Contributor

Joined: 19 Jan 2004 Posts: 89 Location: Fyffe, AL
|
Posted: Sun Feb 06, 2005 9:17 pm Post subject: |
|
|
if you mean this example
%a = "text text text"
or
%a =
couldn't you use
| Code: |
if @null(%a)
# null
info "%a is null"
else
# not null
info "%a =" %a
end
|
_________________ Visual Dialogscript 5 |
|
| Back to top |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Mon Feb 07, 2005 7:46 am Post subject: install from within a zip file |
|
|
don't worry - my browser is playing tricks  _________________
Last edited by Serge on Mon Feb 07, 2005 7:49 am; edited 1 time in total |
|
| Back to top |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Mon Feb 07, 2005 7:48 am Post subject: |
|
|
what about to deal with cases where variable contains spaces,
| Code: |
if @null(@trim(%a))
info "%a" is empty
else
info "%a" is not empty
end
|
serge _________________
|
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Mon Feb 07, 2005 8:43 am Post subject: |
|
|
The example I posted works unless the variable contains
nothing but blanks, tabs etc. such as:
%%myvar = " "
I never thought about @null() Serge, but it appears
to detect empty vars correctly.
Cheers, Mac  _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
 |
|
| Back to top |
|
 |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Tue Feb 08, 2005 5:11 am Post subject: |
|
|
i forgot about null to thanks all this will help me alot  _________________ Have a nice day  |
|
| Back to top |
|
 |
|