[demo version] String->Double?

BlitzMax Forums/BlitzMax Beginners Area/[demo version] String->Double?

Blaine(Posted 2005) [#1]
I'm looking for a way to convert "TextFieldText$(gadget)" into a double for use with a spinner gadget, but when I try to use "Double[TextFieldText$(gadget)]" it tells me that it's "Unable to convert from 'String Array' to 'Double'".

I'm using the demo version as I said in the tiltle. Thanks for your time!


assari(Posted 2005) [#2]
Try using normal brackets instead of the square ones
Double(TextFieldText$(gadget))

note syntax of TextFieldText$ should be
Function TextFieldText$( textfield:TGadget )



Blaine(Posted 2005) [#3]
Worked. Thanks! :)


FlameDuck(Posted 2005) [#4]
Or simply TextFieldText(gadget).toDouble()

Additionally, you may want to be sure that no non-numeric values are written to the TextField.