Results 1 to 4 of 4

Thread: Colon Expected

  1. #1
    Join Date
    Sep 2006
    Posts
    916
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Colon Expected

    PHP Code:
    Procedure DamageCalc;
    Var
    RandomDamageInteger;
    Damage String;
    Begin
      RandomDamage
    := random(6);
       Case(
    RandomDamage)Of
          0 
    Damage:=  ('1');
          
    Damage:=  ('2');
          
    Damage:=  ('3');
          
    Damage:=  ('4');
          
    Damage:=  ('5');
          
    Damage:=  ('6');
       
    WriteLn(Damage);//This is line 14
    End

    on line 14 it tells me i need a colon, any ideas? I'm doing this for school, mainly because im bored. But also because i have to. I've tried using an integer and a string for the damage. I havn't used a case before so sorry if i'm no good with them .

  2. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    2,984
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    ^^ a case looks like this :
    case Blabla of
    1 : Blabla;
    2 : Blabla2;
    END;

    Notice the end there

    Oh and you might aswell do case Random(6) of
    Administrator's Warning:


  3. #3
    Join Date
    Jan 2007
    Location
    USA
    Posts
    1,782
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    nvm

  4. #4
    Join Date
    Sep 2006
    Posts
    916
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Sumilion View Post
    ^^ a case looks like this :
    case Blabla of
    1 : Blabla;
    2 : Blabla2;
    END;

    Notice the end there

    Oh and you might aswell do case Random(6) of
    Thanks . I'm leaving it as it is, and adding the end. It's working perfect now.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Colon expected?
    By impiwimpi in forum OSR Help
    Replies: 9
    Last Post: 01-21-2009, 05:06 PM
  2. Colon expected...but where?!
    By Rich in forum OSR Help
    Replies: 3
    Last Post: 05-17-2008, 02:28 PM
  3. Colon expected.
    By skilld u in forum OSR Help
    Replies: 2
    Last Post: 02-24-2008, 11:54 PM
  4. Colon expected...
    By supersayian2224 in forum OSR Help
    Replies: 7
    Last Post: 07-09-2007, 09:37 PM
  5. colon expected ??
    By Ipewnjoo in forum OSR Help
    Replies: 5
    Last Post: 07-01-2007, 09:59 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
  •