Jump to content
iTz Chris o_O

[Runtime Error] : Exception: Out of system resources

Recommended Posts

Hello, I need some help with my script..

I have this error in the script I wrote:

 

 [Runtime Error] : Exception: Out of system resources in line 257 in script C:\blabla\myscript.scar

 

Line 257:

[scar] SaveBitmap(ThisBmp, 'C:\blabla\this.bmp'); [/scar]

 

I am using SCAR Divi 3.21 Portable because the last versions seem not to support plugins (Im using Appa)

 

It only happens after it ran succesfully for a couple of minutes.. also saved some bitmaps succesfully.

 

I had enough memory left so does anyone know why this happens?

 

Help would be greatly appreciated, thanks.

Link to comment
Share on other sites

its like this:

 

[scar]appa_CopyContentToBitmap(ThisBmp);

SaveBitmap(ThisBmp, Path + CrimeString + '.bmp');

FreeBitmap(ThisBMP);[/scar]

 

but its not a memory leak or something, the memory scar is using does not change much.

 

Your using the wrong copy, uses CopyClientToBitmap(BMP,XS,YS,XE,YE);

Link to comment
Share on other sites

I dont think this is the problem, appa_CopyContentToBitmap(BMP); is a function from the plugin I'm using.

Everything works fine but after 1 time or sometimes 2 times it gives this error..

 

Theres prob an error within the plugin, the which memory manager does the plugin use? FastShareMem, ShareMem, FastMM? I found if you dont use FastShareMem there are some issues with scar sharing data.

 

Simple solution to you problem is the CopyClientToBitmap() its a built in function in scar so you do not need any external includes.

Link to comment
Share on other sites

Theres prob an error within the plugin, the which memory manager does the plugin use? FastShareMem, ShareMem, FastMM? I found if you dont use FastShareMem there are some issues with scar sharing data.

 

Simple solution to you problem is the CopyClientToBitmap() its a built in function in scar so you do not need any external includes.

 

Your advice is flawed, you don't seem to know what the plugin does... Afaik it's impossible to use CopyClientToBitmap.

 

@OP: You're certain the client actually successfully gets copied to a bitmap a few times before failing?

Link to comment
Share on other sites

... That has never changed

 

I have tried to use the Appa plugin with Scar Divi 3.31 but Im not sure how to use it, I have to use something like {$I SCAR Divi/Appa.dll} I guess but that gives an error, not strange since Appa isnt an include but how do I use it then? $P or $Plugin doesnt work.. Basically my question is: How do I use a plugin? :$

Link to comment
Share on other sites

As I feared appa also uses SCAR's function export feature, which was seriously reduced in the latest 3ish versions. However, the new library system in 3.33 once again exports all functions, which will also restore the ability to use appa_CopyContentToBitmap. Do note that your code wouldn't have worked even if appa_CopyContentToBitmap worked. You need to first create a bitmap before you send it into appa_CopyContentToBitmap.

 

Something like:

[scar] P := appa_GetSize;

ThisBmp := BitmapFromString(P.X, P.Y, '');

appa_CopyContentToBitmap(ThisBmp);

SaveBitmap(ThisBmp, 'z:\test.bmp');

FreeBitmap(ThisBMP);[/scar]

 

The new library system will be included in the first beta build of SCAR Divi 3.33, which I'm going to upload now.

Link to comment
Share on other sites

As I feared appa also uses SCAR's function export feature, which was seriously reduced in the latest 3ish versions. However, the new library system in 3.33 once again exports all functions, which will also restore the ability to use appa_CopyContentToBitmap. Do note that your code wouldn't have worked even if appa_CopyContentToBitmap worked. You need to first create a bitmap before you send it into appa_CopyContentToBitmap.

 

Something like:

[scar] P := appa_GetSize;

ThisBmp := BitmapFromString(P.X, P.Y, '');

appa_CopyContentToBitmap(ThisBmp);

SaveBitmap(ThisBmp, 'z:\test.bmp');

FreeBitmap(ThisBMP);[/scar]

 

The new library system will be included in the first beta build of SCAR Divi 3.33, which I'm going to upload now.

 

Thank you so much!

I had a problem with it yesterday, appa_CopyContentToBitmap(ThisBmp) gave an error, but you've solved it even before I could ask it xD

 

 

Edit:

When im using this code:

[scar] s := appa_GetForms;

for i := 0 to High(s) do

begin

writeln(s.name);

writeln(s.action);

writeln(s.method);

for a := 0 to High(s.Elements) do

begin

writeln('element= ' + inttostr(a));

writeln(s.Elements[a].outerHTML);

writeln(s.Elements[a].ID);

writeln(s.Elements[a].ClassName);

writeln(s.Elements[a].Tag);

writeln(s.Elements[a].Name);

writeln(s.Elements[a].Value)

//outerHTML, ID, ClassName, Tag, Name, Value

end;

 

end; [/scar]

Instead of the values it should give, it prints for the value, name, tag, classname and outerHTML things like: '??????>??'

The ID gives nothing, but that didnt give anything on the older version of Scar either, the value, name, tag and other things did work in the older version..

 

And I am still getting: "Runtime Error: Access violation at address 00000000. Read of address 00000000" at line 84: "appa_CopyContentToBitmap(Target);"

 

Lines 72-86:

[scar]

procedure appa_UpdateBitmap;

var

p: TPoint;

begin

if (not appa_Showing) then

Exit;

p := appa_GetSize;

try FreeBitmap(Target); except end;

Target := BitmapFromString(p.x, p.y, '');

//TargetSize := p;

SetTargetBitmap(temp);

 

appa_CopyContentToBitmap(Target);

SetTargetBitmap(Target);

end;

[/scar]

 

The Appa_GetForms problem isnt a big deal, I can make a script without it but my major problem is appa_CopyContentToBitmap(Target), I will try it with V3.33 when you are done but Im not sure if its going to be fixed with it.

Edited by iTz Chris o_O
Link to comment
Share on other sites

As I said, appa_CopyContentToBitmap will NOT work with 3.32 or 3.33 Alpha, download the latest Beta build for 3.33 from the pre-release repository.

 

On a side-note:

[scar]try FreeBitmap(Target); except end;[/scar]

That's a horrible construct...

Use:

[scar]if BitmapAssigned(Target) then

FreeBitmap(Target);[/scar]

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
  • Create New...