Welcome, Guest
Username: Password: Remember me
Components and Libraries for Scripting Development, discussions, problems and suggestions
  • Page:
  • 1
  • 2

TOPIC:

Pascalscript 12 years 10 months ago #1526

  • Chris
  • Chris's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 54
  • Thank you received: 4
Hi

I've got an application that uses the pl_pascalscript library. It works fine in WinXP (great), Windows7 (fine I think) and Ubuntu Linux (mostly - some Gnome issues so have switched to XFCE and that's much better).

However, I'm trying to get it to work in Ubuntu 11.10 64bit and I get errors whn the application calls the pascalscript part of the application - I know they (from changes to the RemObjects site) have been working to get it working in Delphi XE2 (64 bit) and just wondered if anyone has actually used it in Linux 64 bit and seen any issues (i.e. it's not something I'm doing incorrectly but which appears to works fine in Win/Linux 32bit)?

The error I see is in the Property_GetHeader routine in the uPSCompiler.pas unit (at least that's where the SIGSEV points to when it returns to Lazarus) - it bombs on the "FOwner.UseProc(c.Decl);" line. the same source appears on the same line in the RemObjects SVN but obviously it might not be this file that needs changing to suit 64bit.

TheBlackSheep

Please Log in or Create an account to join the conversation.

Re: Pascalscript 12 years 10 months ago #1527

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4538
  • Thank you received: 1116
Sir,
we will test pl_pascalscript and
report here again.
Do you have any test app to help us?
PilotLogic Architect and Core Programmer

Please Log in or Create an account to join the conversation.

Last edit: by Sternas Stefanos.

Re: Pascalscript 12 years 10 months ago #1529

  • Chris
  • Chris's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 54
  • Thank you received: 4
Hi Sternas

have sent you my application so you can test it - (sent to the admin address).

TheBlackSheep

Please Log in or Create an account to join the conversation.

Re: Pascalscript 12 years 10 months ago #1530

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4538
  • Thank you received: 1116
Ok, I got this sample

Titanscript has more functionality
but I must write the import *.pas file utility application
PilotLogic Architect and Core Programmer

Please Log in or Create an account to join the conversation.

Last edit: by Sternas Stefanos.

Re: Pascalscript 12 years 10 months ago #1605

  • Chris
  • Chris's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 54
  • Thank you received: 4
Hi Sternas

I appreciate you're very busy and I am looking forward to the 2.50 release with great anticipation. :)

In the menatime have you got anything I can peruse to try and understand Titanscript - the example in the source doesn't do much and you've mentioned a couple of times regarding the need to write an "import" feature for it. I'd like to use this if it's more reliable/feature rich than the pascalscript and works fully across all platforms (Linux, Windows and Mac - 32bit and 64bit in all flavours).

TheBlackSheep

Please Log in or Create an account to join the conversation.

Re: Pascalscript 12 years 10 months ago #1607

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4538
  • Thank you received: 1116
Sir
we have start the TitanScript import tool from ver 2.40

Codetyphon\CodeOcean\1Other\samples\PasDoc1

At this first beta approach we use PasDoc and TTitanScriptDocGenerator component

with simple user action
you give a *.pas file => build a pascal import file for TitanScript

We are also working on this now but we need help...

At this attachments zip file, I give you a sample from our OLD ZeosDB import files (2008)
but you can see the use of TitanScript registration procedures

Our old Free TitanScript project PScripter is here
www.pilotlogic.com/applications/pscripter/
you can see what this piece of code can do...

Our primary target at lab ver. 2.50 is to make the IDE more friendly and powerful
After that we have 20Gbytes of FREE source code to port...

so, we are only at the start...
PilotLogic Architect and Core Programmer

Please Log in or Create an account to join the conversation.

Last edit: by Sternas Stefanos.

Re: Pascalscript 12 years 10 months ago #1608

  • Chris
  • Chris's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 54
  • Thank you received: 4
ok Sternas

thanks for this - I'll have a play and try and help where I can

TheBlackSheep

Please Log in or Create an account to join the conversation.

Re: Pascalscript 12 years 10 months ago #1611

  • Konstantinos Papadoulas
  • Konstantinos Papadoulas's Avatar
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 131
  • Thank you received: 19
...and i was wondering were the PScripter page went... :)

Please Log in or Create an account to join the conversation.

Re: Pascalscript 12 years 10 months ago #1616

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4538
  • Thank you received: 1116
Old Pilotlogic FREE projects are here

www.pilotlogic.com/applications/

And we port step-by-step the source code to CodeTyphon :)
PilotLogic Architect and Core Programmer
The following user(s) said Thank You: Rigelov

Please Log in or Create an account to join the conversation.

Last edit: by Sternas Stefanos.

Re: Pascalscript 12 years 9 months ago #1652

  • avra
  • avra's Avatar
  • Visitor
  • Visitor

sternas wrote: Old Pilotlogic FREE projects are here
www.pilotlogic.com/applications

I have also wondered where did your other projects vanish. It might be good to put this link on the main page, together with a link to info and screenshots. It all existed in old web site.

Please Log in or Create an account to join the conversation.

Re: Pascalscript 12 years 9 months ago #1704

  • Chris
  • Chris's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 54
  • Thank you received: 4
Hi again

struggling with this one on how to use the titanscripter stuff - unfortunately there's only 1 demo in the sample source and it doesn't appear to show how to import other classes so they are usable in the titanscripter runtime. Take for example the psr files - if I run the demo in CT it supports a few functions but most of the psr demo's have TForm declarations which immediately throw a wobbler with the compiler.

I've looked through the source but I just can't grasp how you would use the TStringList class for example - same issue as the demo's, the titanscripter compiler just doesn't know about the class and errors. For example;

Program test;
var T:TStringList;
begin
T := TStringList.Create;
T.Add('test');
writeln(T.Text);
T.Free;
end.

in the CT demo sample program the compiler returns with;

ERROR : Undeclared identifier TStringList At pos 1 : 18 : 34

I could possibly see that the zeos stuff could be registered much as new units can be imported into pascalscript but I just can't see how you register them with the compiler at runtime (pascalscript has some helper units/components that do this registration process for the compiler at runtime and aren't therefore required to be explicitly declared at runtime - they're just available to be referenced by the script as long as they were registered beforehand).

The PScripter program suggests this is all available but just not how you can do it. The codeocean wiki for titanscript points at the old asphyresphinx website (i.e. not the new afterwarp one) but it then redirects to the new site and on there, there's no reference to it (pscripter presumably as opposed to titanscript) - I even managed to find their old forums but couldn't see anything that would help here.

Have you got a simple example project (as opposed to the runtime script) that shows the lazarus source using some base classes such as TStringList or TForm? I tried adding "uses classes;" to the above but it says it can't find "classes.pp" - that doesn't mean I'd need to include the relevant fpc/lazarus source code units with any program that uses these in titanscript, does it?

TheBlackSheep

Please Log in or Create an account to join the conversation.

Re: Pascalscript 12 years 9 months ago #1705

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4538
  • Thank you received: 1116
Yes Sir
in every TitanScript app you must include the relevant (Imported) fpc/lazarus source units
or to write and import your libraries

Please, give us time to finish the TitanScript library,
the missing part is the TitanScript Import tool.
but this tool use PasDoc library.

We must fix PasDoc (small but critical) problems first...

Oh, this week my programming team has "Windows 8 Passion" :blink:
they want to port CodeTyphon to Win8...
I can't convince them to start working on something else... :silly:

"Have fun" is our Team "moto"
PilotLogic Architect and Core Programmer

Please Log in or Create an account to join the conversation.

Last edit: by Sternas Stefanos.

Re: Pascalscript 12 years 9 months ago #1706

  • Chris
  • Chris's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 54
  • Thank you received: 4
Hi Sternas

I appreciate your help and would ideally help if I knew how...

I see there's a file called "Titan_PascalRegFunctions" which appears to add in lots of examples of code importing - adding this to the base project seemed to give the idea of how to add the extra functionality I was looking for, for example the "Pos" function becomes available in the codeocean sample application.

So, on the assumption it's just a case of adding the relevant classes/functions you need to this unit (or ideally other similar units) I modified this to add in the TStringList

RegisterClassType(TStringList, -1);

the compiler doesn't error at the declaration now but when using the TStringList as in my previous example

Program test;
var T:TStringList;
begin
T := TStringList.Create;
T.Add('test');
writeln(T.Text);
T.Free;
end.

but it errors at the class function "Add" instead;

ERROR : Property "Add" not found At pos 1 : 5 : 74

I think I can probably manage to write the classes I need manually (hopefully) without the import tool (the pascalscript import tool isn't perfect on doing this either as far as I remember and in the end you have to hack the files manually) but I'm still obviously missing something in the registration process for classes - do I have to include all the parent classes as well? i.e. TStrings, TPersistent etc.?

TheBlackSheep

Please Log in or Create an account to join the conversation.

Re: Pascalscript 12 years 9 months ago #1709

  • Chris
  • Chris's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 54
  • Thank you received: 4
Hi Sternas,

I realise now it's not that simple - the example Zeos registration units you attached in a previous message show all the class methods also need mapping which presumably is what the import tool does for you and so it's quite difficult without this. Standalone functions wouldn't be too hard to add (similar to the extra string functions we added to the pascalscript "library") but registering classes adds another layer of complexity.

I appreciate your guys will be chomping at the bit to try CT in Windows 8 so it'll be difficult to pry them away from that to some old code that needs fixing (talking about PasDoc/Titascript import) and there's a danger that something else will come along and then it'll get delayed again - if there's something I could do to assist then please let me know.

Alternatively ,if you have previously built an import unit for just the base classes (including TStringList etc), even if it currently needs work to make it work with Titanscript (e.g. one that worked for pscripter but just needs suff renaming for titanscript) - then I'd be grateful.

As an aside but linked to CT250 and Titanscript - in Lazarus Linux 64bit the TBaseScriptEngine and TTitanScripter seem to throw an error in Lazarus when being dropped on a form. It's fine in Win32 and haven't managed to try it in Linux 32bit so not sure if it's peculiar to Linux64 bit (or it could be my installation although I've rebuilt the BigIDE via CT250 several times and other components including TTitanPascal and TTitanDFMConvertor drop on a form fine) - it's the LXDE install of 64bit Ubuntu (although it's a standard Gnome install with XFCE added as it's faster and easier to work with than the Unity interface).

TheBlackSheep

Please Log in or Create an account to join the conversation.

Re: Pascalscript 12 years 9 months ago #1736

  • Chris
  • Chris's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 54
  • Thank you received: 4
Hi Sternas

I played around trying to follow the Zeos examples just to get a simple TStringList registered as an available class in the script demo;
...
procedure RegisterTStringList;

implementation

  var G:Integer;
      GoR,GoW:TTitanMethodDefinition;

 function TStringList__GetTextStr:string;
 begin
   result:=TStringList(_Self).Text;
 end;

 procedure TStringList__SetTextStr(value: string);
 begin
   TStringList(_Self).Text:=Value;
 end;

procedure _RegCIOs;
 Begin
   G:=RegisterClassTypeSX(TStringList);
   RegisterMethodSX(G,'constructor Create;',@TStringList.Create);
   RegisterMethodSX(G,'destructor Destroy; override;',@TStringList.Destroy);
   RegisterMethodSX(G,'function Add(const S: string): Integer; override;',@TStringList.Add);
   RegisterMethodSX(G,'procedure Clear; override;',@TStringList.Clear);
   RegisterMethodSX(G,'procedure Delete(Index: Integer); override;',@TStringList.Delete);
   RegisterMethodSX(G,'procedure Exchange(Index1, Index2: Integer); override;',@TStringList.Exchange);
   RegisterMethodSX(G,'function Find(const S: string; var Index: Integer): Boolean; virtual;',@TStringList.Find);
   RegisterMethodSX(G,'function IndexOf(const S: string): Integer; override;',@TStringList.IndexOf);
   RegisterMethodSX(G,'procedure Insert(Index: Integer; const S: string); override; ',@TStringList.Insert);
   RegisterMethodSX(G,'procedure Sort; virtual;',@TStringList.Sort);
   RegisterMethodSX(G,'procedure CustomSort(CompareFn: TStringListSortCompare);',@TStringList.CustomSort);
   GoR:=RegisterMethodSXF(G,'Function __GetTextStr:string',@TStringList__GetTextStr);
   GoW:=RegisterMethodSXF(G,'Procedure __SetTextStr(value: string);',@TStringList__SetTextStr);
   RegisterPropertySX(G,GoR,GoW,'Text','string');
 End;

 procedure RegisterTStringList;
 begin
   _RegCIOs;
 end;

 Initialization
   RegisterTStringList;
end.    

I assume that what we're actually doing here is registering a real TStringList class and then faking methods to it's real methods - so to be able to use a class you'd need to create fake routines for each (public?) method or property.

Anyway, it compiles ok but with the simple test script from an earlier post (using the add method) it throws a wobbler when pressing "Run Script" button so I'm obviously missing something still.

TheBlackSheep

Please Log in or Create an account to join the conversation.

Re: Pascalscript 12 years 9 months ago #1738

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4538
  • Thank you received: 1116
Yes Sir
this is the correct way

Oh, old import units of Delphi2009 for RTL and DB
I think, you have a lot of samples now
to help us with
codetyphon\CodeOcean\1Other\samples\PasDoc1
import tool and with pl_TitanScript
and have fun...
PilotLogic Architect and Core Programmer

Please Log in or Create an account to join the conversation.

Last edit: by Sternas Stefanos.

Re: Pascalscript 12 years 9 months ago #1739

  • Chris
  • Chris's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 54
  • Thank you received: 4
Hi Sternas

now I'm really confused...if this is right but errors at runtime then I suppose there must be an issue with my code somewhere.

In your Zeos samples (and in IMP_ActiveX.pas in pl_TitanScript\source) there's a file called "BASE_EXTERN.pas" but it's not there - is this required to do some initialization and that's why I'm seeing a runtime error?

The files in these zips look a bit strange - is that what PasDoc does to them? they seem to have an extra null character in between each ascii character so Lazarus or text editors don't think they're valid - is this the problem with PasDoc?

TheBlackSheep

Please Log in or Create an account to join the conversation.

Re: Pascalscript 12 years 8 months ago #1754

  • Chris
  • Chris's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 54
  • Thank you received: 4
Hi Sternas

did you get a chance to look at those zipped files you attached to your previous email - the pascal import files inside were all corrupt (embedded nulls and cropped) - have you got good copies?

TheBlackSheep

Please Log in or Create an account to join the conversation.

Re: Pascalscript 12 years 8 months ago #1755

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4538
  • Thank you received: 1116
Sorry Sir
I have replace the links with good files
please download again
PilotLogic Architect and Core Programmer

Please Log in or Create an account to join the conversation.

Last edit: by Sternas Stefanos.

Re: Pascalscript 12 years 8 months ago #1806

  • Chris
  • Chris's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 54
  • Thank you received: 4
Hi Sternas

I'm still struggling with this. The files are good now but I can't seem to get them incorporated into the demo - various issues - I've put the two import folders (i.e. the extracted zip files) as subdirectories to the demo Titanscript application in the CodeOcean folder.

When trying to register the import files I see many errors - I'm getting missing files; BASE_EXTERN is referenced in these import files but doesn't exist and there are references to Delphi pas files that don't exist in Lazarus.

If I just try and add in the classes import file (i.e. just add the classes_imp.pas to the project) and replace the "BASE_EXTERN" unit reference with the "Base_tScripter" reference I get references in the imported classes missing - capacity;

ImportWin\Classes_imp.pas(106,35) Error: identifier idents no member "Capacity"
ImportWin\Classes_imp.pas(108,27) Error: identifier idents no member "Capacity"
ImportWin\Classes_imp.pas(148,32) Error: identifier idents no member "LineBreak"
ImportWin\Classes_imp.pas(150,24) Error: identifier idents no member "LineBreak"
ImportWin\Classes_imp.pas(256,37) Error: identifier idents no member "Encoding"
ImportWin\Classes_imp.pas(295,31) Error: identifier idents no member "Position"
ImportWin\Classes_imp.pas(297,23) Error: identifier idents no member "Position"
ImportWin\Classes_imp.pas(309,66) Error: Identifier not found "TFindMethodInstanceEvent"
ImportWin\Classes_imp.pas(310,31) Error: identifier idents no member "OnFindMethodInstance"
ImportWin\Classes_imp.pas(311,71) Error: Identifier not found "TFindMethodInstanceEvent"
ImportWin\Classes_imp.pas(312,23) Error: identifier idents no member "OnFindMethodInstance"
ImportWin\Classes_imp.pas(339,72) Error: Identifier not found "TFindComponentInstanceEvent"
ImportWin\Classes_imp.pas(340,31) Error: identifier idents no member "OnFindComponentInstance"
ImportWin\Classes_imp.pas(341,77) Error: Identifier not found "TFindComponentInstanceEvent"
ImportWin\Classes_imp.pas(342,23) Error: identifier idents no member "OnFindComponentInstance"
ImportWin\Classes_imp.pas(345,31) Error: identifier idents no member "Position"
ImportWin\Classes_imp.pas(347,23) Error: identifier idents no member "Position"
ImportWin\Classes_imp.pas(359,58) Error: Identifier not found "TFindMethodNameEvent"
ImportWin\Classes_imp.pas(360,31) Error: identifier idents no member "OnFindMethodName"
ImportWin\Classes_imp.pas(361,63) Error: Identifier not found "TFindMethodNameEvent"
ImportWin\Classes_imp.pas(362,23) Error: identifier idents no member "OnFindMethodName"
ImportWin\Classes_imp.pas(365,31) Error: identifier idents no member "UseQualifiedNames"
ImportWin\Classes_imp.pas(367,23) Error: identifier idents no member "UseQualifiedNames"
ImportWin\Classes_imp.pas(376,31) Error: identifier idents no member "LinePos"
ImportWin\Classes_imp.pas(381,46) Error: Identifier not found "TParserErrorEvent"
ImportWin\Classes_imp.pas(382,31) Error: identifier idents no member "OnError"
ImportWin\Classes_imp.pas(383,51) Error: Identifier not found "TParserErrorEvent"
ImportWin\Classes_imp.pas(384,23) Error: identifier idents no member "OnError"
ImportWin\Classes_imp.pas(387,31) Error: identifier idents no member "ExternalThread"
ImportWin\Classes_imp.pas(398,31) Error: identifier idents no member "Finished"
ImportWin\Classes_imp.pas(422,31) Error: identifier idents no member "CurrentThread"
ImportWin\Classes_imp.pas(496,29) Error: Identifier not found "TStreamWriter"
ImportWin\Classes_imp.pas(498,21) Error: Identifier not found "TStreamWriter"
ImportWin\Classes_imp.pas(501,29) Error: Identifier not found "TStreamWriter"
ImportWin\Classes_imp.pas(503,21) Error: Identifier not found "TStreamWriter"
ImportWin\Classes_imp.pas(506,29) Error: Identifier not found "TStreamWriter"
ImportWin\Classes_imp.pas(509,29) Error: Identifier not found "TStreamWriter"
ImportWin\Classes_imp.pas(512,29) Error: Identifier not found "TStreamReader"
ImportWin\Classes_imp.pas(515,29) Error: Identifier not found "TStreamReader"
ImportWin\Classes_imp.pas(518,29) Error: Identifier not found "TStreamReader"
ImportWin\Classes_imp.pas(530,33) Error: Wrong number of parameters specified for call to "ToString"
Base_tScripter_Class_imp.inc(4846,10) Hint: Found declaration: ToString(const Variant):AnsiString;
ImportWin\Classes_imp.pas(531,34) Error: Wrong number of parameters specified for call to "ToInteger"
Base_tScripter_Class_imp.inc(4417,10) Hint: Found declaration: ToInteger(const Variant):LongInt;
ImportWin\Classes_imp.pas(546,49) Error: Identifier not found "TVerticalAlignment"
ImportWin\Classes_imp.pas(547,41) Error: Identifier not found "TTopBottom"
ImportWin\Classes_imp.pas(565,46) Error: Identifier not found "TStringsDefined"
ImportWin\Classes_imp.pas(587,55) Error: Identifier not found "TFindMethodInstanceEvent"
ImportWin\Classes_imp.pas(590,51) Error: Identifier not found "TFindMethodNameEvent"
ImportWin\Classes_imp.pas(591,50) Error: Identifier not found "TGetLookupInfoEvent"
ImportWin\Classes_imp.pas(592,48) Error: Identifier not found "TParserErrorEvent"
ImportWin\Classes_imp.pas(609,52) Error: Identifier not found "TStreamOriginalFormat"
ImportWin\Classes_imp.pas(609,52) Fatal: There were 50 errors compiling module, stopping

I expect this is because these units are taken from the Delphi source and not the Lazarus equivalents. I suppose that means I'll have to wait until you've finished the importing tool when these import files can be regenerated.

TheBlackSheep

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
  • 2