Changing Variable To String
Posted 05 February 2015 - 09:22 PM
Posted 05 February 2015 - 09:51 PM
You can't. ¯\_(ツ)_/¯
But, don't worry. What exactly is it that you want to achieve here? There might be ways around it.
For example, this is my 'Put' program, that I use to put characters on position A, B
Edited by Sheepolution, 05 February 2015 - 10:07 PM.
Posted 06 February 2015 - 05:02 AM
Posted 06 February 2015 - 09:35 AM
So just to be clear here, what exactly is it you want to achieve? It does seem like something that would be quite a brain teaser, but that's what makes casio basic so much fun.
- You ask the user for a number
- You give any number, for example: 123
- You add the number in reverse, so that it becomes a palindrome, for example: 123321
And then have that number stored in a variable for further use. That's it right?
Turning the number into a palindrome is going to be tough, but it shouldn't be impossible.
Posted 06 February 2015 - 09:39 AM
Variable to String
For log L-> K To 1 Step -1 Intg (D/(10^(K-1)))->Z 10(Frac(Z/10))->Y Str 1 + StrMid(Str 3, Y+1,1)->Str 1 Next
String back to variable
For (StrLen(Str 1))->A To 1 Step -1 If StrCmp(StrMid(Str 1,A,1),StrMid(Str 3,J+1,1))=0 Then B+(J*10^((StrLen(Str 1)-M-1))->B C+(J*10^M)->C M+1->M IfEnd Next
The code is somewhere in here: https://www.dropbox....LINDRM.G1M?dl=0
Posted 06 February 2015 - 05:00 PM
Number say 89 invert 98 add 187 then again reverse 781 add becomes 968 and continue until it becomes palindrome/symetrical.
So it is vital to have ability to change a variable to string. This makes program simple & short.
In d meantime i try to understand suggestion by somebody1234...here old man!!!
Posted 06 February 2015 - 08:10 PM
What kind of calculator do you have? I think the features somebody1234 uses aren't in my calculator.
Now I understand way better what you want to do.
and continue until it becomes palindrome/symetrical.
But isn't there a chance it will never become a palindrome?
Meanwhile, I'm going to try to come up with a solution.
Posted 06 February 2015 - 08:40 PM
This would simplify programs. The only possibility presently is changing expressions used for graphs into strings...not much help in my case.
Posted 07 February 2015 - 12:38 PM
Posted 07 February 2015 - 02:31 PM
So, there are ways around this, but it's going to be pretty long, it will take a lot more than 10 lines, and it's going to be quite slow. But here is what you can do:
First, you need to decide how many digits you have. You can do this by dividing the number by 10, adding value to your counter, until number < 1.
Then, you want to store each digit. Let's say our number is 736:
You divide the number by 10
And then take that number and abstract the floored number from it.
73.6 - 73 = 0.6
Then you multiply it by 10, and you have 6.
Now for the number 3.
You divide 736 by 10, and floor it.
Int 73,6 = 73
Then you divide it by 10 again, and substract the floored number from that.
7,3 - 7 = 0.3
Then you multiply it by 10, and you have 3.
And then we need to do 7 as well, and this is only a 3 digits number. And after that we need to place the numbers in reverse.
Do you get how long this is going to take? So yeah, it is possible, but I'm not sure if this is really what you want, if it's going to take so much lines and time.
Posted 08 February 2015 - 01:05 AM
Tnk u but i think it is for Casio engineers to provide a simple solution or is it also difficult for them !!!
As for somebody1234 i dont have dropbox so until i subscribe i cannot analyze.
I only hope Casio will consider this in their next update.
Posted 08 February 2015 - 03:41 AM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users