GadgetText:String() beginner question
BlitzMax Forums/MaxGUI Module/GadgetText:String() beginner question
| ||
I only need an integer value out of the text field, but it will only pass a string. Is there a way can I do this? Value = GadgetText:String(Level1_Width1_Input) |
| ||
Ok nevermind. I figured how to cast the string to an integer. |
| ||
edit: too late ;)Value=Int(GadgetText(level1_width1_input)) Basically GadgetText returns a string. Then you can cast it to whatever. ps: 'converting' a string number in a number depends on the way you write/type it (in italian we use comma to separates integers and decimals, in other nations the 'dot' and so on) So - the string from the button - should be checked depending on the result you want. |
| ||
Thanks for the reply. Yes it's a dot for me. I noticed it can be cast to a float as well so that I can enter decimal fractions. |
| ||
Just a small reminder : the string type has its own conversion -> MyString.ToInt() / ToFloat() / ToLong() / ToDouble() |