Alright, I am totally new to DWScript. For now I am fascinated by its abilities, but although I read all the pages in the accompanying wiki and questions/answers here I still cannot find a way to extract the result after a function is called from Delphi like this:
func := m_dwsExec.info.Func[funcname];
func.call(params);
and then I'm stuck: exec.result.toString
gives me nothing. As long as I see I have no Result
in the exec object and that's why when clearing the items from the script stack the result is being removed and lost. Please advice me on what is the proper way to do this simple task?
Edit:
As Eric Grange stated in the comments below the best practice is like this:
func := m_dwsExec.info.Func[funcname];
info := func.call(params);
funcresult := info.ValueAsString; //or Value, ValueAsInteger, etc.
Original answer:
Well I found the answer - the missing result is located in the data
property of the returned IInfo
object:
func := m_dwsExec.info.Func[funcname];
info := func.call(params);
funcresult := info.data[0]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With