Results 1 to 5 of 5

Thread: Why dont this work?

  1. #1
    Join Date
    Aug 2009
    Posts
    242
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Why dont this work?

    Well im trying to set colours and it wont compile im not sure whats wonrg but i think its simple
    SCAR Code:
    Procedure SetColour(What:String);
    Begin

      Case What Of
      {Red Colour Of Chicken}
    'Red' := Begin
          Colour := 1450142
          Toll   := 7
          Hue    := 0.07
          Sat    := 0.08
        End;

    End;
    If there is a better way to do this i would be gald to hear it

    Thanks

    ~Rya
    I see Now, says the blind man

  2. #2
    Join Date
    Mar 2007
    Posts
    3,116
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    SCAR Code:
    Procedure SetColour(What:String);
    begin
      Case What of
      {Red Colour Of Chicken}
      'Red' :
      begin
        Colour := 1450142
        Toll   := 7
        Hue    := 0.07
        Sat    := 0.08
      end;
    end;
    Cases use : not :=

  3. #3
    Join Date
    Oct 2009
    Posts
    15
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ACtually Myles, he's already using : then he opened a begin tag and didn't close it (According to the program) remember to ALWAYS close your case statements

    Code:
    Procedure SetColour(What:String);
    begin
      Case What of
        'Red' :
        begin
          Colour := 1450142;
          Toll := 7;
          Hue := 0.07;
          Sat := 0.08;
        end;
      end;
    end;

  4. #4
    Join Date
    Jan 2010
    Posts
    5,227
    Mentioned
    6 Post(s)
    Quoted
    60 Post(s)

    Default

    ^ Umm.. OP has his as 'Red' := begin (etc.), when it should be 'Red': begin.

  5. #5
    Join Date
    Oct 2009
    Posts
    15
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    My bad i figured Myles had quoted it since it still had an error
    Thats my bad but at least it work now

Thread Information

Users Browsing this Thread

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

Posting Permissions

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