Results 1 to 14 of 14

Thread: Type mismatch

  1. #1
    Join Date
    Mar 2008
    Location
    Look behind you.
    Posts
    795
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default Type mismatch

    I get this error:
    SCAR Code:
    Line 171: [Error] (17399:18): Type mismatch in script C:\Program Files (x86)\SCAR 3.20\Scripts\.scar

    This is the procedure:
    SCAR Code:
    procedure ProduceChatAnimals;
    var
    Chat: array [1..15] of String;
    Chat1: array [1..10] of String;
    begin
      case random(2) of
      0: begin
           case random(15) of
           0: Chat := 'Red ';
           1: Chat := 'Black ';
           2: Chat := 'White ';
           3: Chat := 'striped ';
           4: Chat := 'grey ';
           5: Chat := 'green ';
           6: Chat := 'orange ';
           7: Chat := 'funky ';
           8: Chat := 'gross ';
           9: Chat := 'fugly ';
           10: Chat := 'ugly ';
           11: Chat := 'pink ';
           12: Chat := 'blue ';
           13: Chat := 'white ';
           14: Chat := 'weird ';
           end;
        end;
      1: begin
           case random(10) of
           0: Chat1 := 'zebras ';
           1: Chat1 := 'gorrilas ';
           2: Chat1 := 'fish ';
           3: Chat1 := 'fleas ';
           4: Chat1 := 'monkies ';
           5: Chat1 := 'people ';
           6: Chat1 := 'furs ';
           7: Chat1 := 'things ';
           8: Chat1 := 'tigers ';
           9: Chat1 := 'elephants ';
           end;
        end;
      end;
    end;

    and this is line 171:
    SCAR Code:
    0: Chat := 'Red ';

    Can someone please help me.

  2. #2
    Join Date
    Dec 2008
    Location
    In a galaxy far, far away...
    Posts
    584
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You have declared them as array [1..15] of String; Therefore you need to add in the square bracket when assigning a value;

    SCAR Code:
    procedure ProduceChatAnimals;
    var
    Chat: array [1..15] of String;
    Chat1: array [1..10] of String;
    begin
      case random(2) of
      0: begin
           case random(15) of
           0: Chat[0] := 'Red ';
           1: Chat[1] := 'Black ';
           2: Chat[2] := 'White ';
           3: Chat[3] := 'striped ';
           4: Chat[4] := 'grey ';
           5: Chat[5] := 'green ';
           6: Chat[6] := 'orange ';
           7: Chat[7] := 'funky ';
           8: Chat[8] := 'gross ';
           9: Chat[9] := 'fugly ';
           10: Chat[10] := 'ugly ';
           11: Chat[11] := 'pink ';
           12: Chat[12] := 'blue ';
           13: Chat[13] := 'white ';
           14: Chat[14] := 'weird ';
           end;
        end;
      1: begin
           case random(10) of
           0: Chat1[0] := 'zebras ';
           1: Chat1[1] := 'gorrilas ';
           2: Chat1[2] := 'fish ';
           3: Chat1[3] := 'fleas ';
           4: Chat1[4] := 'monkies ';
           5: Chat1[5] := 'people ';
           6: Chat1[6] := 'furs ';
           7: Chat1[7] := 'things ';
           8: Chat1[8] := 'tigers ';
           9: Chat1[9] := 'elephants ';
           end;
        end;
      end;
    end;

    ~Nadeem

  3. #3
    Join Date
    Mar 2008
    Location
    Look behind you.
    Posts
    795
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    ahh.. i forgot that
    Rep+ for all your help

  4. #4
    Join Date
    Feb 2007
    Location
    Access Violation at 0x00000000
    Posts
    2,865
    Mentioned
    3 Post(s)
    Quoted
    18 Post(s)

    Default

    If I may ask, what will this become?
    Ce ne sont que des gueux


  5. #5
    Join Date
    Jul 2007
    Location
    Ottawa, Canada
    Posts
    930
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    this becomes a roflcopter my friend, a roflcopter
    ~ Metagen

  6. #6
    Join Date
    Dec 2008
    Location
    In a galaxy far, far away...
    Posts
    584
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    lmao tru... I just noticed the content now xD

  7. #7
    Join Date
    Mar 2008
    Location
    Look behind you.
    Posts
    795
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    heheh i made it like that on purpose This will become something..hopefully.

    Some of my results:
    SCAR Code:
    Striped fleas are uber cool!
    SCAR Code:
    Fugly people are beautiful.

    xD funny results

    EDIT: Anyone have any topics which i can make a procedure for?

    Ex. homeless people, viruses, etc.
    Last edited by DeSnob; 05-06-2009 at 04:13 AM.

  8. #8
    Join Date
    May 2007
    Location
    UK
    Posts
    4,007
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    Quote Originally Posted by desnob View Post
    heheh i made it like that on purpose This will become something..hopefully.
    Something for George Bush to do?

    I'm sorry if this offended you, only 1 retard was hurt during this joke

    T~M

  9. #9
    Join Date
    Mar 2008
    Location
    Look behind you.
    Posts
    795
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by The Man View Post
    Something for George Bush to do?

    I'm sorry if this offended you, only 1 retard was hurt during this joke

    T~M
    Nah no problem This was made to sound extremely stupid lol. I <3 stupid sounding things.

  10. #10
    Join Date
    Feb 2007
    Location
    Access Violation at 0x00000000
    Posts
    2,865
    Mentioned
    3 Post(s)
    Quoted
    18 Post(s)

    Default

    Set up a database where people can add queries and let the script grab random ones? ×D
    Ce ne sont que des gueux


  11. #11
    Join Date
    Mar 2008
    Location
    Look behind you.
    Posts
    795
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    How would i do so? It sounds like a good idea.

  12. #12
    Join Date
    Feb 2007
    Location
    Access Violation at 0x00000000
    Posts
    2,865
    Mentioned
    3 Post(s)
    Quoted
    18 Post(s)

    Default

    With PHP and MySQL. It's quite simple. To reduce spamming you could make a SCAR script to add something in the database so only people that are familiar with SCAR know what and how.
    Ce ne sont que des gueux


  13. #13
    Join Date
    Mar 2008
    Location
    Look behind you.
    Posts
    795
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Your thinking i even have a bit of programming knowledge. It took me a year just to learn the basics of scar (var and const) i take forever to have something stick to me. I guess this idea is just too advanced for me. I have no idea how to do much I'm not telling you to make anything but like i said, it probably will never happen; unless i know what to do.

  14. #14
    Join Date
    Feb 2007
    Location
    Access Violation at 0x00000000
    Posts
    2,865
    Mentioned
    3 Post(s)
    Quoted
    18 Post(s)

    Default

    The script is fun without a database, but with a database it'd be more advanced
    Ce ne sont que des gueux


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
  •