Support Forum

[Frage] Smartparts - String in Zahl wandeln [Gelöst]


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!

Anhänge (2)

Typ: image/png
33-mal heruntergeladen
Größe: 1,62 KiB
Typ: image/png
18-mal heruntergeladen
Größe: 1,74 KiB

Lösung anzeigen Lösung verbergen

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

Anhänge (1)

Typ: image/png
97-mal heruntergeladen
Größe: 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

Anhänge (1)

Typ: image/png
97-mal heruntergeladen
Größe: 33,84 KiB

Danke für die schnelle Antwort!


https://connect.allplan.com/ verwendet Cookies  -  Mehr Informationen

Akzeptieren