Questions tagged [dwscript]

DWScript is an object-oriented scripting engine for Delphi based on the Delphi language, with extensions borrowed from other Pascal languages (FreePascal, Prism, etc.).

DWScript (Delphi Web Script) is an object-oriented scripting engine for Delphi based on the Delphi language, with extensions borrowed from other Pascal languages (FreePascal, Prism, etc.). It introduces a few Pascal language extensions of its own as well.

DWScript is an open-source project, issues that do not pertain to DWScript programming, usage or integration in host applications are probably best reported in the issue tracker.

93 questions
18
votes
1 answer

DWScript: using an event in an exposed Delphi class

I exposed a Delphi class to the scripts using TdwsUnit.ExposeRTTI method. It works very well with basic data types. However it doesn't work when I add a TNotifyEvent. My Delphi class has an OnChange : TNotifyEvent property and when assigning this…
fpiette
  • 11,983
  • 1
  • 24
  • 46
17
votes
8 answers

What are the pros and cons of RemObjects PascalScript versus the DWS script?

I'm planning to include a pascal script in my application. It does not require any web access, simply access to classes in my Application. It should be fast (compiled). I see that there are a number of scripts available, some are interpreters but…
Brian Frost
  • 13,334
  • 11
  • 80
  • 154
9
votes
2 answers

Is there a way to keep variable values when executing a DWScript twice?

The application I am working on allows embedding script sinppets into a document. For example: SomeText <* PrintLn("This line is generated by a script"); *> Some other text <* PrintLn("This line is generated by a script, too"); *> Some more…
RM.
  • 1,984
  • 19
  • 29
9
votes
2 answers

Is DWScript thread-safe?

I would like to know if DWScript is capable of using threads inside of scripts, as some engines do not synchronize access to it's internal data structures.
FHannes
  • 783
  • 7
  • 22
8
votes
1 answer

Serializing a TdwsProgram

As I understand it, DWScript does not compile scripts into an intermediary bytecode. However, I would like to be able to store a "compiled" script, to be able to send it through a stream or save it to a file. I was wondering: Is there a way to…
FHannes
  • 783
  • 7
  • 22
7
votes
1 answer

dwscript - how to enumerate all available types?

Hey, Delphi Web Script is really great scripting engine. I'm trying to use it in one of my projects. However, I'm not sure if it is possible to enumerate all the types, functions that are available within the scripting engine, e.g. I want to have a…
Linas
  • 5,485
  • 1
  • 25
  • 35
7
votes
1 answer

How to check return value of DWScript FileCreate function?

Using DWScript, I don't see obvious way of checking the return value of the FileCreate function. Example (not working) script: function TestFileCreate : Boolean; var F : File; begin F := FileCreate('MyTestFile.txt'); Result := (F = -1); …
fpiette
  • 11,983
  • 1
  • 24
  • 46
7
votes
1 answer

DWScript: Getting from IScriptObj to IInfo or TProgramInfo

Given a IScriptObj reference how does one get to a corresponding IInfo or TProgramInfo? I have a script object that wraps a Delphi object. In order to manage the life time of the script object the Delphi object stores a reference to the script…
SpeedFreak
  • 876
  • 6
  • 16
6
votes
2 answers

How to create a 'local variables' display using DWScript and its debugger

I'm writing an IDE for DWScript and have got it stepping through code using the debugger. I now wish to add a display of 'local variables' (i.e those in scope). Can someone give me a pointer to the means of doing this? I can get a list of all…
Brian Frost
  • 13,334
  • 11
  • 80
  • 154
6
votes
1 answer

How best to expose a class instance in DWScript

I am putting together a built-in script capability using the excellent Pascal DWScript. I have also add my own Delphi-side class definition (TDemo) to DWScript using: dwsUnit.ExposeRTTI( TDemo.ClassInfo ) This just works and is a great way of…
Brian Frost
  • 13,334
  • 11
  • 80
  • 154
6
votes
1 answer

DWScript: how do I get Result after Call

Alright, I am totally new to DWScript. For now I am fascinated by its abilities, but although I read all the pages in the accompanying wiki and questions/answers here I still cannot find a way to extract the result after a function is called from…
Nedko
  • 567
  • 4
  • 12
6
votes
1 answer

Dwscript web server

I want to use dwscript for web programming ( generating dynamic content). I was wondering if there is any module for apache web server? Or how can I run my own web server based on dwscript?
opc0de
  • 11,557
  • 14
  • 94
  • 187
5
votes
1 answer

How call the CreateOleObject function using dwscript?

I'm trying to execute this code (this is a minimal sample in order to use CreateOleObject) from inside of a dwscript function GetFileVersion(const FileName: string): string; var V : OleVariant; begin V :=…
Salvador
  • 16,132
  • 33
  • 143
  • 245
5
votes
3 answers

DWScript setter for a property which is a Record

my issue is pretty simple. I have a dwsUnit which have this code: type TPointCoord = record X: Float; Y: Float; Z: Float; end; type TMyClass = class private fPosition: TPointCoord; function GetPosition: TPointCoord; …
5
votes
1 answer

run-time evaluation of values in DelphiWebScript

My delphi application runs scripts using JvInterpreter (from the Jedi project). A feature I use is runtime evaluation of expressions. Script Example: [...] ShowMessage(X_SomeName); [...] JvInterpreter doesn't know X_SomeName. When X_SomeName's…
1
2 3 4 5 6 7