dwscript

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

我怕爱的太早我们不能终老 提交于 2020-01-25 04:20:12
问题 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 Delphi App sees an Int64-Value for the ClassType. e.g. Foo(661259635); You can see in the DWS sources that a TClass is explicitly converted to an Int64 (see dwsCompiler.pas, procedure TObjectClassTypeMethod.Execute -> Info.ResultAsInteger := Int64(info

'designide' must be recompiled when installing DWScript on Delphi XE2

蹲街弑〆低调 提交于 2019-12-23 12:25:59
问题 I'm running Delphi XE2 w/ update 3. I've just checked out the read-only branch of DWScript from the svn repository. I try to install dwsLib.dpk from the DelphiXE2 folder but receive the following error: [DCC Fatal Error] dwsLibRuntime.dpk(30): E2225 Never-build package 'designide' must be recompiled I tried building dwsLibRuntime.dpk first, but I get an error about missing TdwsUnit component, so that doesn't work, either. I'm not having any luck finding contact info for the author, so am

How to install DWSScript

本秂侑毒 提交于 2019-12-22 09:49:59
问题 I am having trouble installing DWSScript component. I am using Delphi XE2 and when I try to compile the dwsLibRuntime.dpk I get an error ( Array type required ). I am using the latest DWScript source pulled from the project's svn repo. What am I doing wrong? toStr:=TStringListCracker(sl).FList[i].FString; //produces error System.MonitorExit(sl); 回答1: You're not using the latest version, the monitor isn't used anymore (due to contention bugs in the RTL implementation), the second line should

How to declare a method of a Delphi object called from a script having a procedure type argument

橙三吉。 提交于 2019-12-13 13:24:10
问题 In have a Delphi application running a DWS script. The Delphi application exposes an object instance, let's call it "MyApplication", to the script. The exposed object has a method which has one argument being a procedure. Fundamentally by goal is to have a Delphi method doing some computation and stopping this computation when a callback procedure says it is done. The callback procedure is Inside the script. I have implemented this by passing the name of the callback function as a string. It

DWScript Install

守給你的承諾、 提交于 2019-12-12 12:13:03
问题 I'm trying to install DWScript in XE2 and I seem to be struggling. I can't find any up to date installation instructions, and the older instructions I did find no longer seems applicable. I've tried both head from the svn repository, and also one of the previous releases and haven't had much luck with either. I've added the source directory to my library path. When I opened dwsLib originally I had a TdwsUnit not found message, although it appears to compile. Both dwsLibDesignOnly and

How to install DWScript

我只是一个虾纸丫 提交于 2019-12-11 12:02:31
问题 I am trying to install DWScript into Delphi XE4: (I did copy the package files into a DelphiXE4 folder and change the package suffix property to XE4...) In the packages folder there are 3 files: dwsLibRuntime.dpk dwsLib.dpk dwsLibDesignOnly.dpk I manage to install dwsLibRuntime and then dwsLib (although I get a few warnings which I ignore), but then have problems trying to install dwsLibDesignOnly. Is one meant to install both dwsLib.dpk and dwsLibDesignOnly.dpk, or only one of them?? (They

Delphi Web Script (DWScript) link a script method to an external control event

﹥>﹥吖頭↗ 提交于 2019-12-10 14:48:47
问题 I'm wondering if DWScript supports using a script method as an event handler for a control on a Delphi form. For example I want to link a TButton OnClick event to a method that exists in script. I am able to do this with the RemObjects Delphi script engine by calling GetProcMethod which returns a TMethod object. I then use SetMethodProp to assign the script method to the OnClick event of a button. procedure LinkMethod(SourceMethodName: String; Instance: TObject; ScriptMethodName: String); var

Is DWScript thread-safe?

江枫思渺然 提交于 2019-12-10 12:59:33
问题 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. 回答1: Arnaud gave the key points: each compiler instance can only be invoked from one thread at a time. You can have multiple compiler instances invoked in multiple threads at the same time, and a particular compiler instance can be used from multiple threads, provided only one thread uses it a time. each compiled program can have multiple

How to install DWSScript

喜你入骨 提交于 2019-12-05 22:58:56
I am having trouble installing DWSScript component. I am using Delphi XE2 and when I try to compile the dwsLibRuntime.dpk I get an error ( Array type required ). I am using the latest DWScript source pulled from the project's svn repo. What am I doing wrong? toStr:=TStringListCracker(sl).FList[i].FString; //produces error System.MonitorExit(sl); You're not using the latest version, the monitor isn't used anymore (due to contention bugs in the RTL implementation), the second line should read as "sl.FLock.Leave;". You're likely on a pre-Delphi XE2 version, as the Monitor was dropped in february

What's exactly is the web part of delphi web script?

孤街醉人 提交于 2019-12-01 06:29:34
I'm currently starting to integrate "Delphi Web Script" in my application basically only as a scripting engine (interfacing with functions, classes, etc.); awesome software for the standard delphi open source quality in my opinion, but just for curiosity, What's exactly the "web part" of the project? How is intended to be used? It was used somewhere with some success commercially? Thanks! As ain said, the original use was for PHP-like, ASP-like server-side web-page generation, but it was also capable of general purpose use, which is what I used it for. And as I did not use the "web" side of