Run a script string.
Supported script languages currently include Python (via cdPython plugin) and ZeoScript (via ZeoScript plugin).
bool CExtAPI::script_Execute(const char* lpLangName, const char* lpScript, ZVAR hRval);
Name | Type | Comment |
---|---|---|
lpLangName | const char* | A handle to a C-style string identifying the script language. Accepted values are “py” for Python, and “zs” for ZeoScript. |
lpScript | const char* | A handle to a C-style string containing the script string to be run. |
hRval | ZVAR | A variable handle to receive the return value of the script. |
False if an error occurred, and true otherwise.
The following example runs a ZeoScript to open a “save file as…” dialog (using the 'file.SaveDlg' extension function), and stores the return value in the FileName string variable:
CzStr FileName; theAPI.script_Execute("zs", "file.SaveDlg bmp NULL \"Bitmap image (*.bmp)|*.bmp|\"", (ZVAR)FileName);
At the time of writing1), only the ZeoScript plugins supports the setting of the hRval return value.