Results 1 to 5 of 5

Thread: type mismatch error.

  1. #1
    Join Date
    Nov 2008
    Location
    Arizona
    Posts
    236
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default type mismatch error.

    SCAR Code:
    Procedure DeclarePickaxeColors;
     begin
       case PickAxeType of
       'Bronze' :
         begin
           PickaxeColor := 4417680
         end;  //this is the line with the type mismatch error line 72
       'Iron' :
         begin
           PickaxeColor := 9671839
         end;
       'Steel' :
         begin
           PickaxeColor := 2635094
         end;
       'Mith' :
         begin
           PickaxeColor := 2635094
         end;
       'Addy' :
         begin
           PickaxeColor := 2635094
         end;
       'Rune' :
         begin
           PickaxeColor := 2635094
         end;
     end;
    end;

    Line 72: [Error] (20223:1): Type mismatch in script
    I'm Back.

  2. #2
    Join Date
    Feb 2009
    Location
    Hungary (GMT + 1)
    Posts
    1,774
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You can make it like this:
    And better use LowerCase(PickAyeType) of ...
    SCAR Code:
    Procedure DeclarePickaxeColors;
    begin
      case LowerCase(PickAyeType) of
        'bronze' : PickaxeColor := 4417680;
        'iron' : PickaxeColor := 9671839;
        'steel' : PickaxeColor := 2635094;
        'mith' : PickaxeColor := 2635094;
        'addy' : PickaxeColor := 2635094;
        'rune' : PickaxeColor := 2635094;
      end;
    end;
    I don't know what's the problem with yours. It works for me.

    EDIT:
    Have you declared PickaxeColor as an Integer? That might cause the problem.
    Last edited by Sabzi; 08-08-2009 at 05:33 PM.

  3. #3
    Join Date
    Nov 2008
    Location
    Arizona
    Posts
    236
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    mm +1 for the condensing of coding, but i still have the error. mind if i add msn maybe help through there?

    EDIT: that did it thanx for help
    Last edited by [JS]; 08-08-2009 at 05:35 PM.
    I'm Back.

  4. #4
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

  5. #5
    Join Date
    Feb 2009
    Location
    Hungary (GMT + 1)
    Posts
    1,774
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Okay. Add me! I try to help you.
    EDIT:
    But this compiles for me without semicolon:
    SCAR Code:
    program New;

    const
      PickAxeType = 'addy';

    var
      PickaxeColor: Integer;


    Procedure DeclarePickaxeColors;
     begin
       case PickAxeType of
       'Bronze' :
         begin
           PickaxeColor := 4417680
         end;  //this is the line with the type mismatch error line 72
       'Iron' :
         begin
           PickaxeColor := 9671839
         end;
       'Steel' :
         begin
           PickaxeColor := 2635094
         end;
       'Mith' :
         begin
           PickaxeColor := 2635094
         end;
       'Addy' :
         begin
           PickaxeColor := 2635094
         end;
       'Rune' :
         begin
           PickaxeColor := 2635094
         end;
     end;
    end;

    begin
      DeclarePickaxeColors;
      WriteLn(IntToStr(PickaxeColor));
    end.

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
  •