text to num

Want to move your code and projects to LiveCode but don't know where to start?

Moderators: FourthWorld, heatherlaine, Klaus, robinmiller

Post Reply
TheRedLord
Posts: 12
Joined: Mon Dec 03, 2018 8:51 pm

text to num

Post by TheRedLord » Mon Dec 03, 2018 8:57 pm

hello i have text : 1+1 or 2+1 or 2+1 that doesnt matter how i convert him to full answer in numbers?
i mean i have 1+1 in field 1,how i am making field 2 to show 2,and not 1+1?
thank you!

Klaus
Posts: 13793
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: text to num

Post by Klaus » Mon Dec 03, 2018 9:29 pm

Hello TheRedLord,

welcome to the forum!

Not sure I understand, but looks like you mean something like:

Code: Select all

...
## fld 1 -> 1+1
put VALUE(fld 1) into fld 2
## fld 2 -> 2
...
Best

Klaus

TheRedLord
Posts: 12
Joined: Mon Dec 03, 2018 8:51 pm

Re: text to num

Post by TheRedLord » Tue Dec 04, 2018 9:42 am

wow! thank you very much! you helped me a lot !!!!!
its exactly how i wanted it!
:D :D :D :) :) :)

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9567
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: text to num

Post by dunbarx » Tue Dec 04, 2018 5:06 pm

What you are asking is how to make "1 + 1" evaluate itself.

Klaus has given you the short correct answer.

I would suggest that you change the way that information was entered into the field in the first place. In other words, do not leave such expressions the way you did, rather have the user enter those two numbers, and manage their sum in the program.

Just a suggestion...

Craig Newman

Post Reply

Return to “Converting to LiveCode”