| View previous topic :: View next topic |
| Author |
Message |
flypaper Contributor


Joined: 19 Oct 2001 Posts: 104
|
Posted: Fri Mar 25, 2005 8:55 pm Post subject: Check a group of variables for @null? |
|
|
| Is there a way to check to see if a group of variables is null all at once? |
|
| Back to top |
|
 |
ShinobiSoft Professional Member


Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Fri Mar 25, 2005 9:01 pm Post subject: |
|
|
To my knowledge you'll have to write a separate function to do this. You could also, as each variable get "used", add it to a list in a specific order, your chioce, and then periodically check the list for any empty lines. _________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it." |
|
| Back to top |
|
 |
webdaddy Contributor


Joined: 14 Nov 2004 Posts: 151 Location: Raleigh NC
|
Posted: Fri Mar 25, 2005 11:45 pm Post subject: Variables |
|
|
I usually create a loop and then check them all at once using the loop. Dont know if that was what you were referring to or not. But another thought about how you can check a series of variables. _________________ K Wetzel
Programming - Technology - Communications
"The Home of the SLC Security Console"
SLC now available for Linux... |
|
| Back to top |
|
 |
jules Professional Member


Joined: 14 Sep 2001 Posts: 1043 Location: Cumbria, UK
|
Posted: Sat Mar 26, 2005 9:41 am Post subject: |
|
|
If you need them all to be null just do:
| Code: | if @null(%A%B%%fred%%joe)
info Variables are all null
end |
_________________ The Tech Pro
www.tech-pro.net |
|
| Back to top |
|
 |
flypaper Contributor


Joined: 19 Oct 2001 Posts: 104
|
Posted: Tue Mar 29, 2005 6:11 pm Post subject: |
|
|
| jules wrote: | If you need them all to be null just do:
| Code: | if @null(%A%B%%fred%%joe)
info Variables are all null
end |
|
Thanks jules! The help says nothing about it accepting more than one variable. Guess I should have just tried it... |
|
| Back to top |
|
 |
ShinobiSoft Professional Member


Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Tue Mar 29, 2005 6:24 pm Post subject: |
|
|
I think that what is happening here, is that if any of the variables included in
the parenthesis have a value, then @null() will return FALSE. It isn't
explicitly checking each variable for NULL.
Nice approach though Jules.  _________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it." |
|
| Back to top |
|
 |
flypaper Contributor


Joined: 19 Oct 2001 Posts: 104
|
Posted: Tue Mar 29, 2005 6:51 pm Post subject: |
|
|
| jules wrote: | If you need them all to be null just do:
| Code: | if @null(%A%B%%fred%%joe)
info Variables are all null
end |
|
Whoops. I want to make sure that none of them are null, so that won't work. Sorry if I wasn't specific enough. |
|
| Back to top |
|
 |
jules Professional Member


Joined: 14 Sep 2001 Posts: 1043 Location: Cumbria, UK
|
Posted: Wed Mar 30, 2005 8:06 am Post subject: |
|
|
Ah! You want to test if none of a group of variables is null!
I can't think of an easy way to do this. You have:
which would test if two of them were not null, but there is no:
I think the neatest way would be to write a function:
| Code: | :testnotnull
if %1
if %2
if %3
%R = 1
end
end
end
exit %R |
_________________ The Tech Pro
www.tech-pro.net |
|
| Back to top |
|
 |
|