Is there a way to add a byte to an arbitrary point in an appvar, without overwriting any data. Would I have to push all of the data 1 forward? I looked though the fileioc docs and couldn't find anything. I am just hoping there's an easier way before I make any rash decisions. Thanks.
Short answer: no

Any singular file you store in flash is going to be contiguous, including appvars. This means that all the bytes in the file are stored in order from the start of the file to the end of the file. This is what allows the use of pointers. If you, for instance, have an array of sixteen two-byte values stored at some point in an appvar, you can iterate through them by using the pointer (memory address) of the start of the data and adding 2 to it to locate the next value. If you "added a byte to an arbitrary point" that would require moving everything after it down 1 byte, which would ruin all your pointers.

In any case, I'm confused as to why exactly you would need to do this. If you let us know what you're trying to do, we may be able to help.
  
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