Jump to content
bääm

Invalid number of parameters

Recommended Posts

Hello,

after long time, I try to write a little script with FindBitmapTol-functions. I pick the bitmaps, rename it, write the name as a var at the top of the script.

 

Then I write: if FindBitmapTol(arrowup, x, y, 20) then begin

as i do it 2 years ago...

 

Then the output said 'Invalid number of parameters'. I use the search-function in this forum, but I found nothing that help me...

 

So I hope some of the pro's in this forum can give me some tipps about what I make wrong.

 

Sorry for my bad english

Link to comment
Share on other sites

hi me again

 

same output, other problem...

 

i have an old script, that works very good on 3.34, now i am trying to change it to 3.38....

 

a problem is the old function "GetClientSize"... i change this to "GetWindowSize"... then came the output "invalid number of parameters" I use the search-function again an found that i forget something call "Wnd"...

 

is this the head-text of the window and should i write it in '...' ?

 

thanks

Link to comment
Share on other sites

Here is the old GetClientDimensions (in SCAR Divi 3.35+), if you are looking after it:

 

procedure GetClientDimensions(var Width, Height: Integer);
begin
 GetBoxSize(GetClient.ImageArea, Width, Height);
end;

var
 W, H: Integer;

begin
 GetClientDimensions(W, H);
 WriteLn(IntToStr(W) + 'x' + IntToStr(H));
end.

Link to comment
Share on other sites

thanks,

i try it but it says again "invalid number of parameters"

 

i write:

 

GetClientDimensions(resolution_x, resolution_y);
Writeln('Bildschirmauflösung: '+inttostr(resolution_x)+'x '+inttostr(resolution_y));

 

with the procedure GetClientDimensions above

Link to comment
Share on other sites

yes, the resolution_x and resolution_y are declared at the top of the script... cant it be that some var is missing in this line?

 

this old script only gets the size of the client to set some fixed points... and this points are importent for the mouse-action...

Link to comment
Share on other sites

Basically the error means, that you are using invalid parameters (variables) in some procedure/function.. That could be FindBitmap() function, which contains more parameters now in 3.35+ (its now the same as FindBitmapIn was).

 

Check out the messages-tab (in SCAR Divi) and double click that error message, doing that will bring you to the problematic line, so you then can see which function/procedure it is pointing to. :)

 

-Jani

Link to comment
Share on other sites

Can you show me your script? You can always PM it, if you want to keep it private.

It is really hard to tell what could be wrong with it.

Does it work without this procedure?

 

Keep the procedure like this:

 

procedure GetClientDimensions(var Width, Height: Integer);
begin
 GetBoxSize(GetClient.ImageArea, Width, Height);
end;

So, don't remove or replace anything with the procedure itself.

 

Then use your custom variables with it in your script (resolution_x and resolution_y).

 

Example:

 

procedure GetClientDimensions(var Width, Height: Integer);
begin
 GetBoxSize(GetClient.ImageArea, Width, Height);
end;

var
 resolution_x, resolution_y: Integer;

begin
 GetClientDimensions(resolution_x, resolution_y);
 WriteLn(IntToStr(resolution_x) + 'x' + IntToStr(resolution_y));
end.

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...