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 »

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: 14325
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: text to num

Post by Klaus »

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 »

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: 10504
Joined: Wed May 06, 2009 2:28 pm

Re: text to num

Post by dunbarx »

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