Results 1 to 7 of 7

Thread: a question on multiple cases

  1. #1
    Join Date
    Aug 2007
    Posts
    21
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default a question on multiple cases

    hi, my question is regarding whether or not it is possible to place one case within another, i.e.
    Code:
    procedure test;
    var
    i, o, u : integer;
    
    begin
     for i := 0 to 1 do
      case I of
      0: for o := 0 to 1 do
         case O of
         0 : Writeln('0,0');
         1 : Writeln('0,1');      '
         end;
      1: for u := 0 to 1 do
         case U of
         0 : Writeln('1,0');
         1 : Writeln('1,1');
         end;
      end;
    end;
    this gives a syntax error, am i just not doing it correctly or is it just not possible?

  2. #2
    Join Date
    Apr 2007
    Posts
    3,152
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    its very possible

    EDIT: did u notice ur vars spell iou so u owe me!!
    SCAR Tutorials: The Form Tutorial | Types, Arrays, and Classes
    Programming Projects: NotePad | Tetris | Chess


  3. #3
    Join Date
    Aug 2007
    Posts
    21
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    just looking at the example i have given, can you tell me what exactly is causing syntax errors? i get them in my actual script also and i made this example so i could try to figure out how to fix it, i havent had much luck...

  4. #4
    Join Date
    Aug 2007
    Posts
    21
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    nvm, got it

  5. #5
    Join Date
    Aug 2007
    Posts
    21
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    thanks for not answering me, i prolly would have felt like a fool...



    stupid scar not reading my mind >.<

  6. #6
    Join Date
    Apr 2007
    Posts
    3,152
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    (u might want to edit ur posts so they're all in 1 so u dont feel like a fool when people get mad at u)
    SCAR Tutorials: The Form Tutorial | Types, Arrays, and Classes
    Programming Projects: NotePad | Tetris | Chess


  7. #7
    Join Date
    Aug 2007
    Posts
    21
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    nah i dont care...

    im here to learn scar not because im worried about people thinking im a spammer... and i REALLY dont care about my post count...

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Making Multiple Cases
    By Richard in forum OSR Help
    Replies: 7
    Last Post: 03-06-2008, 10:49 PM
  2. Cases - how do I use them?
    By R0b0t1 in forum OSR Help
    Replies: 6
    Last Post: 08-30-2007, 02:37 PM
  3. Cases
    By EL_TYCHO in forum OSR Help
    Replies: 2
    Last Post: 06-26-2007, 11:30 AM
  4. Cases
    By inSaner in forum OSR Help
    Replies: 7
    Last Post: 05-06-2007, 04:50 AM

Posting Permissions

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