Announcement

Collapse
No announcement yet.

Nested "If"s?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Nested "If"s?

    Before I tackle this challenge... can I nest "IF" statements in logic? If so, how do I exit a script without exiting the program? Sorry, an old programmer at heart. I've attached an example of the code I'm considering using. I took a snapshot of the window, so it's a jpeg. Will this work?

  • #2
    Re: Nested "If"s?

    Can't see the attachment. BTW you can use LABELS and GOTO statements to hop in and out of code segement as freely as you like... So for example you can layout a few labels, i.e. "START", "END", "CALCULATE", "ADDNAME", whatever and then you can just hop around using GOTO actions, i.e. GOTO START, or GOTO END, etc...

    Corey Milner
    Creative Director, Indigo Rose Software

    Comment


    • #3
      Re: Nested "If"s?

      Or use the RETURN statement to stop execution of the script

      Comment


      • #4
        Re: Nested "If"s?

        To answer the original question, yes you can nest IFs, loops, etc.

        As for exiting from within an inner loop, just use goto to jump to some point outside the loop. Or use return to immediately exit from an action list.

        Exiting from nested control structures is the reason why goto is still around in C++ (much to the chagrin of people like Mark ).
        --[[ Indigo Rose Software Developer ]]

        Comment

        Working...
        X