Hey there, I have a problem with the inString command in ICE
This is my code:

iA
ClrHome
Disp inString('0123456789ABCDEF',"3")
Pause

the Result: 13740240

I want to change hexadecimal from a String to decimal.
if I change the code to tihs, the result is right;
...
Disp inString('0123456789ABCDEF',"3")-13740242
...

But when I change sth. else in the Programm (for example add Disp " HI"), the result is "15 HI" instead of "3 HI"


Is here any better way to do this?
Can you change decimal to String hexadecimal?

Thank you in advance Smile !
13740240 is a pointer to a location inside your program. The first time you compiled your code, that location corresponded to your string, but if you add code before the string, the location of the string in your program changes, and the old pointer no longer works.
Luckily, you can also get a pointer to a string just by storing it to a variable. I haven't used ICE in a while, but I believe this will work:

Code:
'0123456789ABCDEF'→S
Disp inString(S, "3")-S

S will be set to the address of the string (a number, like 13740237). This way, you don't need to know the address of the string before compiling, so you can add code without worrying about causing the addresses to change.
Thank you, it works very well Very Happy
  
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