Alastair
 
Either is fine, but it depends on the logic
 
For example, if x=1 and y=2 you do one action, but if x=1 and y <>2  you do a different, you'd do this:
 
IF X = 1 THEN
  IF Y = 2 THEN
    -- actions for x=1 and y=2
  ELSE
   -- actions for x=1 and y<>2
  ENDIF
ENDIF
 
But if the actions are ONLY done if both conditions are met and there is no alternative action, then this is fine
 
IF X = 1 AND Y = 2 THEN
  -- actions
ENDIF
 
David Blocker
[EMAIL PROTECTED]
781-784-1919
Fax: 781-784-1860
Cell: 339-206-0261
----- Original Message -----
Sent: Wednesday, August 18, 2004 1:44 PM
Subject: [RBG7-L] - IF... THEN query

Is it permissible to combine conditions with AND in the statement like this:
 
IF x=1 AND y=2 THEN
...
ENDIF
 
or is it better to break it into two parts:
 
IF x=1 THEN
  IF y=2 THEN
...
  ENDIF
ENDIF
 
I don't remember having any problems in the past but one particular piece of code seems only to work the second way at the moment and I can't find any other error.
 
(This is an error that's been around for a while so it's not an upgrade problem.)
 
Regards,
Alastair.
 
----------------------------------
A D B Burr,
St. Albans, UK.
----------------------------------
[EMAIL PROTECTED]
----------------------------------

Reply via email to