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 list with all the methods which I could use while scripting (this includes all the internal and external types, functions, procedures, etc.). Fast script has the treeview component which exposes all the types you can use. I'm looking for something like this in dwscript. Thanks in advance.
You'll find all the types in the symbol tables (TSymbolTable) that are attached to every compiled DWScript entity, you have one in the compiled programs, in the compiled functions/methods, and in the blocks that have a scope.
If you want to enumerate all the symbols visible in a particular scope, you'll have not only to look at what a particular TSymbolTable contains, but also look at its parents (which are TSymbolTable too), which hold the symbols from the parent scopes (including unit and library symbols). For class methods & types, you'll find them in the Members[] of a TClassSymbol.
DWS2 repository on sourceforge contains some samples which haven't been converted yet in the DWS2.x repository, but should be reasonably straightforward to adapt.
© 2022 - 2024 — McMap. All rights reserved.