stringValueEx()

Synopsis

Returns a string containing a textual representation of value or its constant formula. The function extends the capabilities of stringValue. For some data types the AsString and AsFormula strings are equivalent. For the numeric data types, AsFormula delivers the highest precision string .

Syntax

stringValueEx ( value As Any, 
                outputType As Name) As String 
Argument Type Description
value Any The value to be represented as a string . This argument is permitted to be NoValue .
outputType Name

The output representation. The possible values are:

  • :AsString - formats the output as suitable for UI
  • :AsFormula - formats the output in the way it may be reused in Intent language
  • other values - the output is the same as per stringValue call

Example 1

Numbers
Intent >stringValueEx(sin(30.0),:AsString)
--> "0.5"
Intent >stringValueEx(sin(30.0),:AsFormula)
--> "0.5" 
Intent >stringValueEx(sin(30.0),:Default) 
--> "0.500" 

Example 2

Parts
Intent >stringValueEx(self(),:AsString) 
--> "Root" 
Intent >stringValueEx(self(),:AsFormula) 
--> "Root" 
Intent >stringValueEx(self(),:Default) 
--> "Assembly2<0000000040660C20>" 

Example 3

Lists
 Intent >stringValueEx(children,:Default) 
--> "List of 5" 
Intent >stringValueEx(children,:AsString) 
--> "{Root.J315_1, Root.J315_2, Root.Flush_1, Root.Flush_2, Root.Mate_1}" 
Intent >stringValueEx(children,:AsFormula) 
--> "{Root.J315_1, Root.J315_2, Root.Flush_1, Root.Flush_2, Root.Mate_1}"