stringValueEx()

概要

値またはその定数式のテキスト表現を含む文字列を返します。この関数は stringValue の機能を拡張します。一部のデータ タイプでは AsString と AsFormula の文字列が等しくなります。数値データ タイプでは、AsFormula は最も高い精度の文字列を提供します。

構文

stringValueEx ( value As Any, 
                outputType As Name) As String 
引数 [タイプ] 説明
value すべて 文字列として表される値です。この引数には NoValue を使用できます。
outputType [名前]

出力リプレゼンテーションです。有効な値は次のとおりです。

  • :AsString: UI に適するように出力をフォーマットします。
  • :AsFormula: Intent 言語で再利用できるような方法で出力をフォーマットします。
  • その他の値: 出力は stringValue の呼び出しと同じです。

例 1

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

例 2

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

例 3

一覧
 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}"