Page 1 of 1


PostPosted: Sat Sep 02, 2006 7:58 am
by Jay-Bird
Concerning NB IfEx, I am trying to make sure that 1 of 2 Comboboxes has at least a value. According to NB's help file:

Code: Select all
You can also construct more complex statements by combining multiple expressions with “and” and “or”. For example, to find out if [City] equals either “Pittsburgh” or “Washington”:

"[City] = Pittsburgh OR [City] = Washington"

To find out if [City] equals “Pittsburgh” and another variable [Name] also equals “Jones”:

"[City] = Pittsburgh AND [Name] = Jones"

For extremely complex statements you may want to use “(“ and “)” to make sure expressions are evaluated in the correct order.
 IfEx "[Account] = Guest OR [Account] = Admin"
  GotoPage “Welcome”
  AlertBox "Error!" "The account is incorrect."

Thats great if [ACCOUNT] has a value (like GUEST) But what if there was NO VALUE in the variable?

So how would one construct an IfEx to prevent an EMPTY value in BOTH Comboboxes? If ONE combobox must have a value.

The following will not work:(Note the Blank Space)
Code: Select all
IfEx "[ComboBox1] =  AND [ComboBox2] =  "
GotoLine "END"


But this does:(Using quotes)

Code: Select all
IfEx "[ComboBox1] = [#34][#34] AND [ComboBox2] = [#34][#34]"
GotoLine "END"


Now, At least ONE of these comboboxes has to have a value, it cannot be Null.

Just hoping to save someone a little time! I have really enjoyed getting back into the New Neobook and using (discovering) all the Great New Goodies!


PostPosted: Sat Sep 02, 2006 8:16 am
by Gaev

This also works ...
Code: Select all
IfEx "abc[ComboBox1] = abc AND def[ComboBox2] = def"
... abc or def can be any string of at least one character.

PostPosted: Sat Sep 02, 2006 8:24 am
by Jay-Bird
Thats even better :D

Thanks for the tip! IfEx was really a GREAT step forward in my opinion....Saves so much time in code, which results in faster completion time AND faster code execution....

Thanks again Gaev...