OCLOperators scripteval
No edit summary
(Automatically adding template at the end of the page.)
 
(One intermediate revision by the same user not shown)
Line 11: Line 11:
  0.2222+self.SomeInt+self.SomeDateTime.Ticks
  0.2222+self.SomeInt+self.SomeDateTime.Ticks
  [[Category:OCLOperators]]
  [[Category:OCLOperators]]
{{Edited|July|12|2024}}

Latest revision as of 15:42, 10 February 2024

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

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 whether it returns a double - if so, the result will be converted to string and assigned to vSomeStringResult. If it's not a valid expression, the problem with the expression will be in vSomeStringResult.

Using the default model:

0.2222+self.SomeInt+self.SomeDateTime.Ticks
This page was edited 89 days ago on 02/10/2024. What links here