*Edit: This is now solved, but I leave the original message below for reference. The solution was essentially to delete all traces of FastReports (That's "Reports", not "Script") from the computer, as it was interfering with FastScript. This was actually fairly involved to do, and we did it under the supervision of someone from FastScript tech support, who was extremely helpful. If you run into the problem described below, be sure to contact their technical support and see if maybe you are experiencin
g the same issue, and how to resolve it. I hope this is helpful to you. I suggest contacting their support directly, but if you need instructions, we did take some notes that I can hunt down and send you if you send me a message requesting them (otherwise, they are not handy at the moment, and I think may contain stuff not suitable to post publically.)*
= = = = = = = = = = = = =
I am converting from Delphi 2006 to Delphi XE8, and am now nearing the finish line, but have one remaining major roadblock: FastScript
I use Fastscript very heavily as a way to allow our users to write scripts that can extend our software as much as they like, including creating forms and adding buttons. This is not working.
A specific problem that I have, is that code that works great in Delphi 2006 does not work in Delphi XE8. Specifically, if my script contains a reference to a "TForm", or "TBitBtn" (as well as many other components), then FastScript will return an error at runtime of "Unknown Type 'tBitBtn'" or "resource TForm not found".
I suspect that maybe unit names have perhaps changed, and I'm not including whatever defines TForm, TBitBtn, and other such items for FastScript.
Anyone else experience similar issues? Any tips here?
Thanks!
Carl.
PS: Below is a simple test application that shows the problem.
{code}
unit FastScriptTestUnit;
{
Test of converting a Delphi 2006 FastScript project to work in Delphi XE8.
This unit works great in Delphi 2006. It gives error in Delphi XE8.
}
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls,
{Fast Script items needed to run this script below.}
fs_iinterpreter, fs_ipascal;
type
TForm2 = class(TForm)
fsScript1: TfsScript;
fsPascal1: TfsPascal;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
implementation
uses
fs_iCpp,fs_iBasic,fs_iJS,
FS_iClassesRTTI,FS_iGraphicsRTTI,FS_iFormsRTTI,FS_iExtCtrlsRTTI,
FS_iDialogsRTTI,FS_iDBRTTI,FS_iDBCtrlsRTTI,FS_iBDERTTI,FS_iADORTTI,
fs_imenusrtti;
{$R *.dfm}
procedure TForm2.FormCreate(Sender: TObject);
var
TempScript:tfsScript;
ScriptLines:TStringList;
begin
{Create the Script Engine.}
TempScript:=tfsScript.Create(Self);
TempScript.Clear;
TempScript.Parent:=fsGlobalUnit;
{Create a temporary script to run.}
ScriptLines:=TStringList.Create;
ScriptLines.Clear;
ScriptLines.Add('var');
ScriptLines.Add(' MyForm:TForm;');
ScriptLines.Add('begin');
ScriptLines.Add(' MyForm:=TForm.Create(nil);');
ScriptLines.Add(' MyForm.ShowModal;');
ScriptLines.Add(' MyForm.Free;');
ScriptLines.Add('end.');
TempScript.Lines:=ScriptLines;
{Run the script.}
if TempScript.Compile then
begin
TempScript.Execute;
end
else
begin
ShowMessage('Script did not compile'+#13+
'Error line: '+TempScript.ErrorPos+#13+
'Error Message: '+TempScript.ErrorMsg);
end;
{Free up stuff.}
TempScript.Free;
ScriptLines.Free;
end;
end.
{code}
Edited by: Carl Olsen on Jul 7, 2015 2:36 PM
Edited by: Carl Olsen on Jul 27, 2015 4:54 PM