DWScript: how to get the result after a call

Well, I'm completely new to DWScript. At the moment, I am passionate about my abilities, but although I read all the pages in the accompanying wiki and questions / answers here, I still can not find a way to extract the result after calling the function from Delphi as follows:

func := m_dwsExec.info.Func[funcname]; func.call(params); 

and then I'm stuck: exec.result.toString gives nothing. So far, I see that there Result no Result in the exec object, and therefore, when clearing elements from the script stack, the result is deleted and lost. Please advise me how to perform this simple task correctly?

+6
source share
1 answer

Edit:

As Eric Grunge said in the comments below, the best practice is 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 in the data property of the returned IInfo object:

  func := m_dwsExec.info.Func[funcname]; info := func.call(params); funcresult := info.data[0] 
+7
source

All Articles