[Вопрос] Smartparts - String in Zahl wandeln [Решен]


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!

Вложения (2)

img
2020-07-29_Problem-01.PNG
Type: image/png
Загружено 6 раз
Size: 1,62 KiB
img
2020-07-29_Problem-02.PNG
Type: image/png
Загружено 7 раз
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

Вложения (1)

img
split.png
Type: image/png
Загружено 20 раз
Size: 33,84 KiB
1 - 3 (3)
  • 1

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

Вложения (1)

img
split.png
Type: image/png
Загружено 20 раз
Size: 33,84 KiB

Danke für die schnelle Antwort!

1 - 3 (3)
  • 1

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

Accept