Shared variables with Inner Fuse Pascal 2.8

If you made a script you can offer it to the others here, or ask help to improve it. You can also report here bugs & problems with existing scripts.
Post Reply
P2
Posts: 16
Joined: 2004-04-12 13:18:42

Shared variables with Inner Fuse Pascal 2.8

Post by P2 »

With Inner Fuse Pascal 2.8 (used by AMC for scripting) is possible to use shared variables as functions parameter like Delphi? :??:

Example:

Code: Select all

procedure MyProcedure(var MyString: string);
begin
  MyString := MyString + 'add this';
end;
where "var MyString" is variable shared from main script to procedure (i.e. external library).

Thanks for aid.
Pivello
antp
Site Admin
Posts: 9630
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

No, "var" strings do not work with functions that are not in the same unit :(
that's why I've put a global "RemainingText" variable in StringUtils1

Another solution is to define a new type in the shared unit :
type MyStr = string;
then use only this kind of variable instead of string.
But when you have to pass a string to a predefined function (GetPage, etc.) you will have to copy the MyStr-typed variable to a string-typed variable.
P2
Posts: 16
Joined: 2004-04-12 13:18:42

Post by P2 »

Thanks for answer, Antoine.
Btw, do you have estimated the possibility to use the new Inner Fuse Pascal Script 3.0? http://www.remobjects.com/?ps

Regards
Pivello
antp
Site Admin
Posts: 9630
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

Some time ago I wanted to update to v3 but there were lots of changes to do.
Now that I made the script part of AMC more complex, the update would require even more work.
It is not a high priority for me, since the script system works quite well as it is.
P2
Posts: 16
Joined: 2004-04-12 13:18:42

Post by P2 »

Ok. I understand.
Thanks.

Pivello
Post Reply