I have some existing codes resulting in variables as strings some of them are currently displayed juste like
out 2@ type
This is fine, answering a string or any number like 3.666 49.888 or whatever it contains
I would convert it as an integer to the top of the stack. something like
out 2@ convert
an optain for example 3 or 49 to keep same example
I tried some
: .$ swap over dabs compiled
<# # [CHAR] . hold # # #> ;
and so many similar string management but I always fail to get it
I can also use
out 2@ evaluate
but then I got a strange number 49888 instead of 49 ignoring the .888
I check all documentation about substring management with tools like word /string & so on but nothing about either getting a sub string from "." as separator nor string conversion to an integer of coherent value
I also tryied to check all in rosetta-code without success.
any Idea of words or procedure I would use to get the entire part of a number if this one is currently comming from a string variable ?
OK I got help from other people but it may help to post also here with a POC example
The variable muste be a 2variable state then I can capture as a string a system command or whatever I want
next step is to manage a delimiter on input address length char to get out put address new length.
then I can get from the delimiter a substring, if the string is containing a float , then with dot delimiter the substring is the entire part only. Then I can evaluate it to make it a number on top of the stack
here is the POC