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
1
vote
1 answer

Retrieving record parameters from TProgramInfo in DWScript

How do you retrieve record parameters from a TProgramInfo object in the Eval events for functions in a TdwsUnit? It seems that the object only provides ways to retrieve the basic datatypes directly or possibly a script object.
FHannes
  • 783
  • 7
  • 22
1
vote
1 answer

Registering implicit/explicit typecast operators in dwscript

Is it possible to register an implicit and/or explicit typecasting operator from Delphi? I found http://code.google.com/p/dwscript/issues/detail?id=124, but it seems to deal with in-script operator overloading and it's a fairly old issue.
FHannes
  • 783
  • 7
  • 22
0
votes
1 answer

How to change the caption of a button, using DWScript

I want to interact with GUI elements, from within DWScript (created by Eric Grange). For example change the caption of a button from 'Click Me' to 'Clicked'; I think that within tdwsUnit the TButton class must be declared (under classes), as well as…
Rudolf
  • 3
  • 2
0
votes
0 answers

How to access properties or methods of another class object within a class in DWScript?

I am actually using dwscript with delphi and got stuck with the follwing problem: I have defined two classes as follows TClassOne = class private FName : String; public property Name: String read FName write FName; end; TClassTwo = class …
Radiesel
  • 371
  • 1
  • 3
  • 10
0
votes
0 answers

EdwsActivePrograms exception when closing the application

I'm getting the following EdwsActivePrograms exception when IdwsProgram and IdwsProgramExecution variables are defined globally: TDelphiWebScript instance "dws" still has 1 active IdwsProgram instance(s) Steps to reproduce based on the example…
Vlad
  • 43
  • 6
0
votes
2 answers

How registrate two class with circular references in DWScript?

I need to register TCollection and TCollectionItem classes, but because of the properties of {TCollection} property Items [Index: Integer]: TCollectionItem {TCollectionItem} property Collection: TCollection сonstantly raises the exception of the…
0
votes
0 answers

How I can register function without parameter type in DWScript

I want register into script some stream method. For example function Read(Self: TStream; var Buffer; Count: Longint): Longint; But parametr "Buffer" does not have type(by dws). How can I register this kind of parametrs into Delphi Web Script? What…
0
votes
1 answer

May DWS calling functions from sample unit?

May DWS calling functions from sample unit? For example: FExecution.Info.Func['Test.ClickProc'].Call(AParams); (This is not working) FExecution - IdwsProgramExecution; Function declared in Script code: unit Test; Uses UTestUnit; procedure…
0
votes
0 answers

Is DWScript fully thread safe?

Threaded script Execute and DWScript thread safe are not very clear about this situation: A script is run in the context of a worker thread. While a script function is executing, called by the worker thread, it calls Delphi code which does some…
fpiette
  • 11,983
  • 1
  • 24
  • 46
0
votes
1 answer

Using / injecting an interface instance implemented in Delphi in dwscript

I have an interface (in fact multiple interfaces) which I'd like to use this way: Make Units where the interfaces are declared available inside the dwscript script (if neccessary). Create the objects, that implement the interfaces, in the host…
0
votes
3 answers

Why multithreaded memory allocate/deallocate intensive application does not scale with number of threads?

Notice: Original post title Why multithreaded JSON parser from DWScript does not scale with number of threads? was changed because this problem is not related to processing JSON data with DWScript. The problem is in default memory manager in…
YpsArthur
  • 21
  • 6
0
votes
1 answer

DWScript, Monkey Patching: Add method or property at runtime

At the moment I wrote a ORM mapping for DWScript + SQLite. I have successfully implemented mapping for normal properties (like string or integer), but now I want to add Foreign Keys and Many To Many relations. For this I have planed, to declare the…
0
votes
1 answer

DWScript Write/Read a simple text file

I would like to write/read a simple text file using dwscript. My code is here below... but I am non able to get it run, please someone might help...: (I am using the Simple.exe in the Demos folder of DWS installation) // uses Classes; {$INCLUDE_ONCE…
giarussi
  • 3
  • 4
0
votes
1 answer

Why don't method calls work when I call DWScript's ExposeClassToUnit?

When exposing a host class and calling a procedure from it I get this exception: First chance exception at $7513C41F. Exception class ECompileError with message 'There is no accessible member with name "GetUnitCount"'. Process Project23.exe…
user1647411
0
votes
0 answers

DWScript, retrieving a property symbol for a global variable

I'm overriding TRTTIEnvironment and am implementing function FindUnknownName(). I'd like to return a Symbol that is already exposed to the program by ExposeInstanceToUnit(). In some of my scripts the property of a global object is in the script but…
Tom Robertson
  • 151
  • 10