Hello there;
I'm trying to make a sprite editor which uses an appvar while editing the sprites, to allow large sprites with more than 4000 bytes.
But I think it would be better to edit the string directly and to rename it after that to one of the "normal strings" (Str0 - 9).

So I wrote a code to create a string named "A" which I wanted to rename to "Str1". But there went something wrong; do you know any solution?
Code:
sum(0)
sum(2,“A“,“w+“,4)→S
sum(4,“HELLO“,5,1,S)
sum(0)
sum(33,“A“,‘Str1‘,4)


Thanks in advance!
I thought you said that you were storing the data in an appvar instead of a string, but in your second line of code, you create a string, not an appvar. If you wanted to create an appvar, it would be:

Code:

sum(0)
sum(2,“A“,“w+“,21)→S
sum(4,“HELLO“,5,1,S)
sum(0)
sum(33,“A“,‘Str1‘,4)

And, if you wanted to rename the appvar to Str1, even if that worked, it would still be an appvar. You would have to copy the data from the appvar into a string, and the OS strings might not be able to hold that much data.
randomguy wrote:
I thought you said that you were storing the data in an appvar instead of a string, but in your second line of code, you create a string, not an appvar. If you wanted to create an appvar, it would be:

Code:

sum(0)
sum(2,“A“,“w+“,21)→S
sum(4,“HELLO“,5,1,S)
sum(0)
sum(33,“A“,‘Str1‘,4)

And, if you wanted to rename the appvar to Str1, even if that worked, it would still be an appvar. You would have to copy the data from the appvar into a string, and the OS strings might not be able to hold that much data.

Ehm, I think he wanted to use a real string so he could copy paste the sprite data into his program. I am certain you can write to Real strings just like you can write to any memory address using pointers (and the system variables afaik always occupy the same memory location), but I'm not exactly sure how to properly format a write to a real string, but if Frederik wants to give it a shot, I know he can find some sort of general directions here? It may be helpful to read the entire course Razz
Sorry; my code could also be:

Code:
sum(0)
sum(2,‘Str2‘,“w+“,4)→S
sum(4,“HELLO“,5,1,S)
sum(0)
sum(33,‘Str2‘,‘Str1‘,4)

I wrote "A" because I don't wanted to overwrite any String.
(except for the last line, everything works fine)
  
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