Page 1 of 1

Shared variables with Inner Fuse Pascal 2.8

Posted: 2005-04-06 09:07:08
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

Posted: 2005-04-06 12:09:15
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.

Posted: 2005-04-06 13:25:25
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

Posted: 2005-04-06 16:08:19
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.

Posted: 2005-04-06 17:00:24
by P2
Ok. I understand.
Thanks.

Pivello