Results 1 to 3 of 3

Thread: Why Doesn't This Compile?

  1. #1
    Join Date
    Oct 2011
    Location
    Australia, Vic
    Posts
    1,517
    Mentioned
    2 Post(s)
    Quoted
    120 Post(s)

    Default Why Doesn't This Compile?

    That's one of my functions and it won't compile keep getting:
    Simba Code:
    [Error] (348:37): Type mismatch at line 347
    With This Line HighLighted:
    Simba Code:
    if OptionsExist('nteract', False) then
    Simba Code:
    Function CheckFamiliar: boolean;
    begin
    MouseBox(700, 136, 714, 148, MOUSE_RIGHT);
      if OptionsExist('nteract', False) then
      begin
        Result:= True
        WriteLn('We Still have our Graahk');
      end else
      begin
        Result:= False
        WriteLn('We Need A New Graahk');
      end;
    end;

    I can't post full script since it's a Nature RuneCrafter.

    All help Appreciated

  2. #2
    Join Date
    Oct 2009
    Location
    Stockton, CA
    Posts
    2,040
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    The name of the function is OptionsExist which leads me to believe it accepts a TStringArray instead of just a string. So try
    Simba Code:
    OptionsExist(['nteract'], False)
    ?

    Edit: You could shorten the function too:
    Simba Code:
    function CheckFamiliar : boolean;
    begin
      MouseBox(700, 136, 714, 148, MOUSE_RIGHT);
      result := OptionsExist(['nteract'], False);
      if result then
        Writeln('We still have our Graahk')
      else
        Writeln('We need a new Graahk');
    end;
    Last edited by Sex; 05-12-2012 at 02:35 AM.
    Join the IRC! irc.rizon.net:6667/srl | SQLite (0.99rc3+) | SRL Doc | Simba Doc | Extra Simba Libraries (openSSL & sqlite3)
    Quote Originally Posted by #srl
    10:45 < Toter> daphil when can get sex anyday I want
    10:45 < Toter> he is always on #SRL
    "A programmer is just a tool which converts caffeine into code"

  3. #3
    Join Date
    Oct 2011
    Location
    Australia, Vic
    Posts
    1,517
    Mentioned
    2 Post(s)
    Quoted
    120 Post(s)

    Default

    Sex saves the day again
    Hehe

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
  •