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
2
votes
1 answer

Is DWScript compatible to create Delphi XE5 code for Android and IOs?

Can I use DWScript classes in a Delphi XE5 program to run under Android and/or IOs and make the scripting works?
Eduardo Elias
  • 1,742
  • 1
  • 22
  • 49
2
votes
1 answer

What does "{$F 'filename'}" mean exactly?

In DWScript documentation we can see "{$F 'filename'}", but I don't understand what it means. Is it possible to describe It?
Shaahin Ashayeri
  • 918
  • 2
  • 13
  • 30
2
votes
1 answer

Calling script functions from a modal dialog gives "Object not instantiated"

From the following script code, I call the Run procedure from Delphi which calls the showmodal procedure which is also in Delphi. The global variable sl is not instantiated when calling Button1Click() from the newly created modal dialog. The Script…
Tom Robertson
  • 151
  • 10
2
votes
1 answer

Get result data context in an OnFastEval event in DWScript

How do you get an IDataContext for the result value in the OnFastEval event in a TDWSUnit function? The "magic functions"-functionality presented through the OnFastEval event can't return complex data, like records, as OnFastEval returns a Variant.…
FHannes
  • 783
  • 7
  • 22
2
votes
1 answer

DWScript basetype efficiency

The limited amount basetypes in DWScript can be very convenient, but doesn't it add a lot of overhead. Considering that integers are Int64, this should be quite a bit of overhead when you're working with byte values for example. Does DWScript…
FHannes
  • 783
  • 7
  • 22
2
votes
1 answer

Adding methods to records type from Delphi in DWScript

After I've created a TRecordSymbol, how do I add a constructor and methods to it? I've tried using TMethodSymbol with little success, as I can't find a way to define the execution of the method.
FHannes
  • 783
  • 7
  • 22
1
vote
1 answer

delphi DWScript - change script variable value of type TObject at scriptruntime

I have a DWScript like this var Outputter: TOutputter; procedure OutputterTester; begin Outputter.Print; end; TOutputter (is only a example for a complex class) is declared and created in delphi code and exposed to the DWScript via…
1
vote
1 answer

Creating macros using DWScript

I read this paragraph from the Delphi Tools Site Changes since the last SVN update are: Added support for FreePascal-like compile-time $INCLUDE “macros”: %FILE% and %LINE% insert the current filename and line number into the source …
Zeina
  • 1,573
  • 2
  • 24
  • 34
1
vote
1 answer

Using classes in dwsunit

1- Why is it necessary to name the methods of a class in a dwsunit this way? dwsUnitClasses'ClassName''MethodName'Eval(Info: TProgramInfo; var ExtObject: TObject) 2- Is there a link that must be done…
Zeina
  • 1,573
  • 2
  • 24
  • 34
1
vote
1 answer

Delphi Web Script: How to find the Class Name of a Script-TClass in Delphi

Imagine this procedure, which is callable in a script: // Foo is not implemented in the Script but via Delphi procedure Foo(ClassType: TClass); The Script looks like that: type TMyClass = class end; Foo(TMyClass); When Foo gets called my…
Steffen Binas
  • 1,463
  • 20
  • 30
1
vote
1 answer

DWS insert variable values on debug

I'm facing a problem I can't find the workaround... I have a script which take some parameter data before execution. When I run it my code looks like: Exec := FProgram.CreateNewExecution; Exec.BeginProgram; Exec.Info.ValueAsString['varName'] :=…
1
vote
1 answer

How to initialize an object in DWScipt?

What is the equivalent of this JS code in DWScript please? I use the DWScript codegen. // JavaScript: DoIt({name:"Fred", size:{width:3,height:2}}); I tried anonymous record but it seems not working: var obj: variant; obj := record Name =…
1
vote
1 answer

Does dwscript support operator overloading

I know dwscript has operator overloading for compound operators += etc. I would like to have operator overloading for +, - etc as well for use in addition, multiplication etc. of matrix objects. Does dwscript support this? And if so what this the…
Johan
  • 74,508
  • 24
  • 191
  • 319
1
vote
1 answer

How to expose a dynamic array of records in DWScript?

I've declared a simple record type in a DWScript unit: TSampleRecord = record name: string; end; How can I expose such an array from the Delphi application to the script ? For example, the following method in the Delphi application: // Delphi…
jonjbar
  • 3,896
  • 1
  • 25
  • 46
1
vote
2 answers

How to use dwsXPlatform.CollectFiles TCollectFileProgressEvent

As I am new to events in delphi I am struggling on how to use dwsXPlatform.TCollectFileProgressEvent in conjunction with dwsXPlatform.CollectFiles. In the DWScript repository there is no sample or even test code for it. type TForm1 =…
Fabio Vitale
  • 2,257
  • 5
  • 28
  • 38