OCLOperators scripteval
(Created page with "ScriptEval is an operator on a model object (the context) that lets you have expressions as data and evaluate those expressions. You must state the valid Return type. let in...")
 
No edit summary
Line 4: Line 4:
  let info=self.ScriptEvalCheck(false,Double, self.SomeString) in
  let info=self.ScriptEvalCheck(false,Double, self.SomeString) in
  (
  (
   (info='ok').casetruefalse(self.ScriptEval(false,Double, self.SomeString).asstring,info)
   vSomeStringResult:=(info='ok').casetruefalse(self.ScriptEval(false,Double, self.SomeString).asstring,info)
  )
  )
The above code will check if the self.SomeString value is a valid expression in the context of self and that it returns a double - if so the result will be converted to string and assigned to vSomeStringResult - if not a valid expression - the problem with expression will be in vSomeStringResult

Revision as of 16:00, 30 March 2022

ScriptEval is an operator on a model object (the context) that lets you have expressions as data and evaluate those expressions.

You must state the valid Return type.

let info=self.ScriptEvalCheck(false,Double, self.SomeString) in
(
  vSomeStringResult:=(info='ok').casetruefalse(self.ScriptEval(false,Double, self.SomeString).asstring,info)
)

The above code will check if the self.SomeString value is a valid expression in the context of self and that it returns a double - if so the result will be converted to string and assigned to vSomeStringResult - if not a valid expression - the problem with expression will be in vSomeStringResult

This page was edited 47 days ago on 02/10/2024. What links here