Forum Discussion

jeetendra_mitta's avatar
jeetendra_mitta
Occasional Contributor
10 years ago

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.

1 Reply

  • sbkeenan's avatar
    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