Results 1 to 3 of 3

Thread: Out of range error

  1. #1
    Join Date
    Jun 2012
    Posts
    2,182
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Out of range error

    Im getting this error during runtime while trying to run my script. It compiles fine, but when I start up the script, it gives me an out of range error. Heres the first part of my script.

    Simba Code:
    program AlKharid_Tanner;
    {$i srl/srl.simba}

    type TLeatherRecord = record
      LeatherDTM, WaitTimeMin, WaitTimeMax:integer;
    end;

    var
      LDTM:TLeatherRecord;
      Hides_Tanned:Integer;
      LeatherDTM, HardLeatherDTM, GreenLeatherDTM, RedLeatherDTM:Integer;
      BlackLeatherDTM, RoyalLeatherDTM, BlueLeatherDTM:Integer;

    const
      Row = 2;    //Row of item to tan in bank.
      Column = 2; //Column of item to tan in bank.
      Hides_To_Tan = 56; //How many hides are you tanning?
      Profit_per_hide = 20; //How much profit do you make per hide tanned? Used in progress report.

      procedure DeclarePlayers;
    Begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;
      Players[0].Name := '';  //Username Here!
      Players[0].Pass := '';  //Password Here!
      Players[0].Pin := '';   //Pin here!
      Players[0].Active := True;
      Players[0].Strings[0] := 'GreenLeather'; //What Are we Tanning? Options(GreenLeather, RedLeather, BlackLeather, BlueLeather, RoyalLeather, HardLeather, SoftLeather) Dont Missspell them!
    End;

    Procedure LoadTLeatherRecord;
    begin
      case lowercase(Players[CurrentPlayer].Strings[0]) of
        'GreenLeather': begin
                          LDTM.LeatherDTM := DTMFromString('mbQAAAHicY2VgYEhkZGBIAeJQIA4A4hwgvgTED4D4JBBfAOKLQMxpywVUzYSCQSLogBELBgMADIgGaQ==');
                          LDTM.WaitTimeMin := 1000;
                          LDTM.WaitTimeMax := 1400;
                        end;
        'BlueLeather': begin
                         LDTM.LeatherDTM := DTMFromString('mbQAAAHicY2VgYChkZGBIB+JUIK4A4mogvgLEJ4D4FhDfg7K5eTyBqplQMBcDJmDEgsEAADGZBtM=');
                         LDTM.WaitTimeMin := 1200;
                         LDTM.WaitTimeMax := 1800;
                       end;
        'RedLeather': begin
                        LDTM.LeatherDTM := DTMFromString('mbQAAAHicY2VgYNjAyMCwGIiXA/EeIF4HxJeA+CwQ3wXiy0B8BIhteTmBqplQMBcDJmDEgsEAAKFaB/E=');
                        LDTM.WaitTimeMin := 2000;
                        LDTM.WaitTimeMax := 3000;
                      end;
        'BlackLeather': begin
                          LDTM.LeatherDTM := DTMFromString('mbQAAAHicY2VgYNBiZGBQAmJTIJYHYjMgvgjE94D4FBCfAOLLIDlZWaBqJhTMxYAJGLFgMAAAqwgFag==');
                          LDTM.WaitTimeMin := 2500;
                          LDTM.WaitTimeMax := 3500;
                        end;
        'SoftLeather': begin
                         LDTM.LeatherDTM := DTMFromString('mggAAAHicY2NgYIgH4mwgTgXiICAOBeIMIL7IyMBwDYiPAfE5IL4DxbYWnEBZJgzMyoAdMOLAEAAA+wgH0Q==');
                         LDTM.WaitTimeMin := 0;
                         LDTM.WaitTimeMax := 0;
                       end;
        'HardLeather': begin
                         LDTM.LeatherDTM := DTMFromString('mbQAAAHicY2VgYLgDxE+B+DkQXwbiSyDMyMBwHIhvAfEdID4NxDoaskAZJhTMxYAJGLFgMAAAAcAI+g==');
                         LDTM.WaitTimeMin := 0;
                         LDTM.WaitTimeMax := 0;
                       end;
        'RoyalLeather': begin
                          LDTM.LeatherDTM := DTMFromString('mbQAAAHicY2VgYFjOyMAwA4jXAfEWIJ4DxJeA+BoQ3wPiU1DsIB0OVM2EgrkYMAEjFgwGAKx3CDA=');
                          LDTM.WaitTimeMin := 3000;
                          LDTM.WaitTimeMax := 4000;
                        end;
        end;

    end;
    The error is on this line
    Simba Code:
    case lowercase(Players[CurrentPlayer].Strings[0]) of
    Thx Euphemism and Vinyl for the awesome siggy and avatar!

  2. #2
    Join Date
    Apr 2012
    Location
    Australia
    Posts
    1,252
    Mentioned
    1 Post(s)
    Quoted
    22 Post(s)

    Default

    Are you perhaps trying to call LoadTLeatherRecord before you call DeclarePlayers?

  3. #3
    Join Date
    Jun 2012
    Posts
    2,182
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Solved, I loaded my record before Declareplayers instead of after, thanks P1ng!
    Thx Euphemism and Vinyl for the awesome siggy and avatar!

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
  •