Originally Posted by
OzoneClutch
Quick question this may be very simple.
createaccButton := intToBox(269,527,532,547); // Is this just creating a variable for the TBox which it is using below? Ex. Now that it's declared if I need to use it again I use what is below?
mouseBox(createAccButton, MOUSE_LEFT);
wait(3000);
random code doing whatever go back to process
mouseBox(createaccButton, MOUSE_LEFT); // this probably makes no sense but basically to the left would be code to do whatever in the script and then instead of doing what I did above I can just call on the mousebox again for that TBox variable correct?
Depends on the scope of the variable.
Simba Code:
createaccButton := intToBox(269,527,532,547);
Does not create the variable,
Simba Code:
var
createAccButton:TBox;
does.
intToBox() accepts xs, ys, xe, ye parameters and spits out a TBox (which is the practical usage of xs, ye, xe, ye)
Now for a quick explanation about scope ... read though the first part of this post: https://villavu.com/forum/showthread...81#post1305181
If createAccButton is a global TBox, it can be accessed anywhere without having to declare it again or even assign it a value.
If it's local, it can only be accessed by the routine in which it was declared.
e.g.
Simba Code:
program new;
procedure someProcedure();
var
someLocalVariable:integer;
begin
writeln(someLocalVariable); //works
end;
procedure someOtherProcedure();
begin
writeln(someLocalVariable); //does not work
end;
begin
end.
and...
Simba Code:
program new;
var
someGlobalVariable:integer;
procedure someProcedure();
begin
writeln(someGlobalVariable); //works
end;
procedure someOtherProcedure();
begin
writeln(someGlobalVariable); //also works
end.
begin
end.