converting text to numbers

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
churchken
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 66
Joined: Sun Apr 15, 2007 2:54 pm

converting text to numbers

Post by churchken » Mon Apr 16, 2007 1:54 pm

Hi,

I am attempting to use data from a text file as a numeric variable.

A text file is put into a field, that field is then parsed with the "split" command, and correctly places string data ( e.g. 110.25) into a separate card field.

If that field is then used in an "if then" statement doing a math comparison, the following error is produced:

"Expression: double binary operator"

Is it possible to "force" a conversion from text to decimal numbers, or am I missing something else.


Thanks,
Ken

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Mon Apr 16, 2007 2:40 pm

Hi Ken,

Please post your complete script.

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

churchken
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 66
Joined: Sun Apr 15, 2007 2:54 pm

thanks

Post by churchken » Mon Apr 16, 2007 3:40 pm

Mark,

Thanks, but I think I found it -- I was incorrectly using a global variable as part of the "if" test.

I'll post again if the error message persists.

Thank you.
Ken

Post Reply