Ask a Question

Continue code with next line in if statement condition

jeetendra_mitta
Occasional Contributor

Continue code with next line in if statement condition

My code is supose:

if a=b and c=d and d=e then

'any code

end if



I want to write in multi line as like:



if a=b

 and c=d

and d=e then

'any code

end if



I have used underscore (_), but it is not wokring,



Please suggest.

Jeetendra Mittal
1 REPLY 1
sbkeenan
Frequent Contributor

Hi Jeetendra



It looks like you're using VBScript, in which case something like this should work:





if a = b and _

   c = d and _

   e = f _

then

  'your code here

end if





You should be aware, however, that VBScript doesn't support they short circuiting functionality of other languages, so you may want to do the following:





if a = b then

   if c = d then

      if e = f then

         'your code here

      end if

   end if

end if





Regards

Stephen
cancel
Showing results for 
Search instead for 
Did you mean: