Long Ifs...

Monkey Archive Forums/Monkey Discussion/Long Ifs...

Paul - Taiphoz(Posted 2012) [#1]
Quick question , when I am sitting with a long if statement, and a ton of ands flung in for good measure whats the method for splitting the line up so it looks neater.

I thought it was something like.

if x=1 ..
and z=2 ..
and y=3 then

do something.
end if

or something like that. bit vague on the finer points of it hence my post.

Goodlookinguy(Posted 2012) [#2]

If x = 1 And
   z = 2 And
   y = 3
    Do Something

Jesse(Posted 2012) [#3]
with out the else you can split it.

if x = 1 and z = 2
  if y = 3
    do something 

but that would totally fail with an else.

invaderJim(Posted 2012) [#4]
If (x + y + z) = 6
   do something


NoOdle(Posted 2012) [#5]
that might cause problems Jim! There are many combinations that add up to 6 ;)