+ Reply to Thread
Results 1 to 7 of 7

Thread: Refresh my memory, simple question

  1. #1
    K.Forsythe Guest

    Default Refresh my memory, simple question

    IF it helps remember this.... There is no "loop" IF and Else each can only cause one statement to execute - that is why there is no ENDIF. When you want to condition multiple lines of code, you use DO and ENDDO to mark the beginning and end of those blocks of code. (Like braces in languages such as java if { } ) Hope this helped! Kevin

  2. #2
    EDIguru Guest

    Default Refresh my memory, simple question

    I know there is no loop realy, let me be more specific (see code below): Does the "else do" execute only when &var1 is not equal to 'N'?
    Code

  3. #3
    K.Forsythe Guest

    Default Refresh my memory, simple question

    You are correct

  4. #4
    EDIguru Guest

    Default Refresh my memory, simple question

    It was the first enddo that was confusing me. It seemed like it should have been "IF, do, elsedo, enddo", without the enddo in the middle of it all.

  5. #5
    Guest.Visitor Guest

    Default Refresh my memory, simple question

    Correct, the "else do" executes only when &var1 is not equal to 'N'. InfoCenter: http://publib.boulder.ibm.com/infoce...opic/cl/if.htm

  6. #6
    EDIguru Guest

    Default Refresh my memory, simple question

    If I have a CL (If, Do, Enddo) "loop" that is immediately followed by an (Else Do, End Do) am I correct that the Else Do executes only when the condition for the first do clause was not met. I know that seems right, just can't believe the code I'm looking at is written like this because logically it doesn't make sense.

  7. #7
    K.Forsythe Guest

    Default Refresh my memory, simple question

    That is what you would expect - especiallyif you are an RPG programmer - CL's format for the IF/ELSE DO/ENDDO is... unique!

+ Reply to Thread

Similar Threads

  1. Need Simple DDS / CL for Menu
    By klaborde in forum CL
    Replies: 2
    Last Post: 05-08-2009, 01:50 PM
  2. Replies: 2
    Last Post: 01-31-2002, 06:12 AM
  3. A Simple Question from a Simple mind... Telnet Session.
    By Guest.Visitor in forum System Administration
    Replies: 5
    Last Post: 12-03-2001, 08:44 AM
  4. Simple question on QUPSDLYTIM...
    By S.Mildenberger in forum System Administration
    Replies: 2
    Last Post: 04-03-2001, 02:14 PM
  5. Seems simple but..
    By Guest.Visitor in forum Programming
    Replies: 1
    Last Post: 09-06-2000, 02:14 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts