#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2004
    Posts
    5
    Rep Power
    0

    Exclamation Constant Expression Expected, need help


    Hello,
    what do you do to fix the error constant expression expected.
    What causes this error and how do i fix it so my game will work. this is the code that is causing the error:

    if not goodguess then
    count := count + 1;
    case count of
    if Count = 1 then
    Image1.visible := true;
    if count = 2 then
    Image2.visible:= true;
    if count = 3 then
    Image3.visible := true;
    if count = 4 then
    Image4.Visible:=true;
    if count = 5 then
    Image5.Visible:= true;
    if count = 6 then
    Image6.Visible:= true;
    if count = 7 then
    Image7.Visible := true;
    if count = 8 then
    Image8.Visible:= true;
    if count = 9 then
    Image9.visible:= true;
    if count = 10 then
    Image10.Visible:= true;

    Any Help would be awsome. Thanx in advance. Bubblez101
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2004
    Posts
    32
    Rep Power
    11
    Your case statement is a bit wrong...
    should be something like :

    if not goodguess then count := count + 1;

    case count of
    1: Image1.Visible := True
    2: Image2.Visible := True
    etc....
    etc....
    end;//end case

    if you are holding the images in a list you could do all that in one line of code....

    TImage(ImageList[Count]).Visible := True;

    maybe l8r.


    hope that helps.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2004
    Posts
    5
    Rep Power
    0
    Thanx for the help.
    Bubblez101
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2004
    Posts
    32
    Rep Power
    11
    np

IMN logo majestic logo threadwatch logo seochat tools logo