Ok, I know this has been discussed a billion times over, but so far, there seems to be no good way to do this.

I want to be able to take a real number, either stored in a variable, or not, and put it into a string.

I also want to be able to do the reverse.

I can easily go from String to Number:


Code:
Input "Point x",Str1
String►Equ(Str1,Y₁)
Y₁→X


That part is simple enough. But the reverse, isnt.

Im getting stuck trying to figure out how to store X back to a string.


Code:
(Cant get X→Y₁)
Equ►String(Y₁,Str1)


Here is my current code:


Code:
ClrHome
Input "Point x:",Str1
Input "Point y:",Str2
Input "Slope:",Str3
ClrHome
Disp "Equation:"
String►Equ(Str1,Y₁)
String►Equ(Str2,Y₂)
String►Equ(Str3,Y₃)
Y₁→X
Y₂→Y
Y₃→M

(M▪⋅X)+Y→B

Disp "y="+Str3+"x +"
Output(2,9,B)
Pause
BlackOnyx wrote:


Im getting stuck trying to figure out how to store X back to a string.


Code:
(Cant get X→Y₁)
Equ►String(Y₁,Str1)


The only way your going to store X into Y₁ is if X is a string, i.e., "X→Y₁
But then when using the Equ►String() it will make Str1=="X
You can also do this "2000→Y₁ and Equ->Str will return "2000
I'm not sure if this helps, sorry.
Cant do 2000→Y₁

You just get an ERR: DATA TYPE

I posted the code to my program in the OP
I think it's worth asking why you want the number to be a string in the first place. It's possible we can solve your problem by circumventing the problem entirely.
You know that there's a command for that in Celtic III, which by the way is included in Doors CS 7.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement