Results 1 to 7 of 7

Thread: Error: Exception: The bitmap[0] does not exist at line 664

  1. #1
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default Error: Exception: The bitmap[0] does not exist at line 664

    Ah... I feel so dumb posting this. I forgot the fix

    Here is the code:

    Simba Code:
    function isCutting():Boolean;
    var
      count, t:Integer;
    begin
      count := ss_invCount;
      marktime(t);
      repeat
        wait(250)
        if (invcount>count) then result := true;
      until (TimeFromMark(t)>4000) or (result = true)
    end;

    I get this error when ever I try to do

    while (isCutting) do
    wait(200);

  2. #2
    Join Date
    Jun 2012
    Posts
    4,867
    Mentioned
    74 Post(s)
    Quoted
    1663 Post(s)

    Default

    Quote Originally Posted by Officer Barbrady View Post
    Ah... I feel so dumb posting thifunction isCutting():Boolean;
    var
    count, t:Integer;
    begin
    count := ss_invCount;
    marktime(t);
    repeat
    wait(250)
    if (invcount>count) then result := true;
    until (TimeFromMark(t)>4000) or (result = true)
    end;s.. but I get that and globals to simba opens up I forgot the fix.

    Here is the code that causes the crash:
    Probably an issue with ss_InvCount. Also where you have
    Simba Code:
    (Result = True);
    I think you could just have
    Simba Code:
    Result;

  3. #3
    Join Date
    Dec 2007
    Posts
    2,112
    Mentioned
    71 Post(s)
    Quoted
    580 Post(s)

    Default

    Nothing wrong with that.

    Edit: i use this when i cba looking at the logic of loading bitmaps / dtms inside a loop of some sort. i just free whenever i feel like loading a dtm/bitmap and then load the bitmap / dtm when i need it. i know its inefficient. but i always go through and sort it out later.

    Simba Code:
    procedure TryFreeDTM(I : Integer);
    begin
      try
        freeDTM(I);
      except
      end;
    end;    

    procedure TryFreeBitmap(I : Integer);
    begin
      try
        freeBitmap(I);
      except
      end;
    end;
    Last edited by Kasi; 07-14-2013 at 08:47 PM.

  4. #4
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by Kasi View Post
    Nothing wrong with that.
    I only get the error when I do

    While (isCutting) do
    wait(200)

  5. #5
    Join Date
    Dec 2007
    Posts
    2,112
    Mentioned
    71 Post(s)
    Quoted
    580 Post(s)

    Default

    Quote Originally Posted by Officer Barbrady View Post
    I only get the error when I do

    While (isCutting) do
    wait(200)
    your basically saying the interpreter is wrong lol, ps is procedural. the error will be in ss_InvCount. if you loaded a bmp in that func.

  6. #6
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by Kasi View Post
    your basically saying the interpreter is wrong lol, ps is procedural. the error will be in ss_InvCount. if you loaded a bmp in that func.
    Nope it's just:

    Simba Code:
    {
      Written by: Danny RS
    }

    function ss_ItemExists(SlotToCheck: Integer): Boolean;
    Var
      xsx,ysy,x,y,R,C:Integer;
    begin
      SlotToCheck:=SlotToCheck-1;
      xsx:=580;
      ysy:=230;
      C:=(Round(SlotToCheck/4));
      R:=(SlotToCheck -(C*4));
      If FindColor(x, y, 65536, xsx+(R*42), ysy+(C*36), xsx+(R*42)+27, ysy+(C*36)+25) Then
      begin
        Result:=True;
      end;
    end;
    function ss_invcount():Integer;
    var
      i:Integer;
    begin
      Result := 0;
      for i:=1 to 28 do
        if ss_itemexists(i)
          then Inc(Result);
    end;

    Same as the unofficial P07 include

  7. #7
    Join Date
    Dec 2007
    Posts
    2,112
    Mentioned
    71 Post(s)
    Quoted
    580 Post(s)

    Default

    Fixed. because he wasn't calling SetupSRL, some Bitmaps weren't getting loaded.

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
  •