[Question] Smartparts - String in Zahl wandeln [Solved]


Hallo!

Gibt es einen Befehl mit dem man einen String in eine Dezimal-/ Ganzzahl umwandeln kann?
Kleines Beispiel:

--------------------------------------------

variable1 = "test 123"
variable2 = STRSUB ( variable1 , 6 , 3 )

--------------------------------------------

variable2 ist dann ein String mit dem Wert "123". Kann man variable2 so umwandeln, dass sie eine Dezimal-/ Ganzzahl mit dem Wert 123 ist?

Schon mal Danke im Voraus!

Attachments (2)

Type: image/png
Downloaded 33 times
Size: 1,62 KiB
Type: image/png
Downloaded 18 times
Size: 1,74 KiB

Show solution Hide solution

SPLIT splits a text according to the format into several parts (numeric or string) and assigns these parts to one or more variables. The execution of SPLIT is halted, when the first non-matching part is encountered. SPLIT returns the number of successfully read values as integer.

Syntax
SPLIT (string, format, variable1 [, variable2, ..., variablen])

Parameter
string (string): the string which should be split.
format: any combination of constant strings, %s and %n -s. Parts in the string must fit the constant strings, %s identifies any string value, which is delimited by spaces or tabs, while %n identifies any numeric value.
variablei (string or decimal, depends on format): the names of the variable, into which the split strings are stored.

Remarks
Decimal numbers must be separated by ".", otherwise only the places before the decimal point are considered.

siehe auch SPLIT

Attachments (1)

Type: image/png
Downloaded 97 times
Size: 33,84 KiB

SPLIT splits a text according to the format into several parts (numeric or string) and assigns these parts to one or more variables. The execution of SPLIT is halted, when the first non-matching part is encountered. SPLIT returns the number of successfully read values as integer.

Syntax
SPLIT (string, format, variable1 [, variable2, ..., variablen])

Parameter
string (string): the string which should be split.
format: any combination of constant strings, %s and %n -s. Parts in the string must fit the constant strings, %s identifies any string value, which is delimited by spaces or tabs, while %n identifies any numeric value.
variablei (string or decimal, depends on format): the names of the variable, into which the split strings are stored.

Remarks
Decimal numbers must be separated by ".", otherwise only the places before the decimal point are considered.

siehe auch SPLIT

Attachments (1)

Type: image/png
Downloaded 97 times
Size: 33,84 KiB

Danke für die schnelle Antwort!


https://campus.allplan.com/ uses cookies  -  More information

Accept