So, I'm working on an application that will do text input, and I know I should use an edit buffer for it, but I only know that because people have said "you should use an edit buffer."

I get that an edit buffer is a buffer to edit text in so that it doesn't have to add/remove memory from the whole program every time you write or delete a character, but I don't understand exactly how edit buffers should be implemented.

A slightly more formal explanation (and possibly some examples) would be greatly appreciated!
ZippyDee wrote:
I get that an edit buffer is a buffer to edit text in so that it doesn't have to add/remove memory from the whole program every time you write or delete a character, but I don't understand exactly how edit buffers should be implemented.


The great thing is that you don't have to implement them yourself -- the OS has a whole set of routines for setting up and working with edit buffers. I suggest you take a look at the WikiTI documentation on it; the original PDFs (of all the routines) are gone since TI took down their awesome developer's site five years ago, but there are copies still floating around. (PM me.)

Basically, an edit buffer is created when the OS temporarily expands a program (or whatever var is being edited) so it takes up all available free RAM. So when an edit buffer is open, no other variables can be created, since free RAM at that point is effectively zero. As for how an edit buffer is actually structured, thepenguin77 made an awesome post about it here. Take a look at it and compare it to the WikiTI documentation I linked to earlier.

Hope that helps.
WOWOWOWOWOWOWOWOWOW! That makes my life SOOOOOOO much easier!!! Thank you so much!

I never expected to find something about edit buffers on WikiTI, so I never thought to look there. I always just kind of assumed it had mostly general purpose routines...but I guess edit buffers are kind of general purpose routines.
ZippyDee wrote:
WOWOWOWOWOWOWOWOWOW! That makes my life SOOOOOOO much easier!!! Thank you so much!

I never expected to find something about edit buffers on WikiTI, so I never thought to look there. I always just kind of assumed it had mostly general purpose routines...but I guess edit buffers are kind of general purpose routines.


Well, WikiTI aims to document all the important bcalls that aren't well-documented anywhere else, and the OS edit buffer comes with a full set of them.
I do some minor edit buffer manipulation to make the Instant Goto and 8-line editor features of Doors CS work, so hopefully I have some knowledge to help with if WikiTI proves insufficient in some sense. Smile
Okay, so I'm starting to understand how this works. The issue I see is that I'm trying to use single-byte characters for input, whereas it seems the edit buffer routines are all token-based.

Would it be best to just write my own buffer handling routines for things like _BufInsert, _BufLeft, _BufRight, _BufDelete, etc. so they use characters instead of tokens?

EDIT: I wrote my own routines. They were pretty easy. Now the hard part is going to be writing my display routines >.<

Anyway, thanks for the 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