So, I'm trying to figure out how to use the edit buffer. I have the "Unsupported Info" guide to edit buffers and related routines, as well as a couple of other resources, but there are still many things I'm confused about.

  1. What's editTail for? Is it basically just (editCursor)+1? That makes it sound pointless, but "Unsupported Info" says it's a "pointer to all the data that's after the cursor." Not sure what this means.
  2. What's all the iMath pointer stuff? All the guides I've found on opening an existing program with the edit buffer say that these need to be set up, but what are they?


I have lots of other questions, so these are the ones I need to figure out now. Thanks in advance for any help!
When the calculator puts info into an edit buffer, it splits the data up into two sections: What is in front of the cursor, and what is behind the cursor. These two sections are stored at either end of the free ram.

So a picture:

Code:

Edit buffer:
        a                   b                   c
    |----------|------------------------------|-----|
    1          2                              3     4


1 - EditTop
2 - EditCursor
3 - EditTail
4 - EditBtm

a - Before the cursor
b - unused data
c - after the cursor


So the data: ABCDEFGHIJK||LMNOPQRSTUVWXYZ, would look like this: (|| is cursor)

Code:

|ABCDEFGHIJK|---------------------------------|LMNOPQRSTUVWXYZ|
Oh thanks, I see... So _bufLeft and _bufRight would shift both editTail and editCursor to the right or left at the same time.

Wouldn't that mean that it would be much easier to insert data then? Why would most of the OS be in replace mode?
Yes, those shift it right or left and also copy over the byte or two that go with the current token. And yes, it probably would be easier to just insert stuff.

One interesting thing to note is that when the cursor is at the end, EditTail = EditBtm and at any time, the size of the edit buffer is EditBtm-EditTail+EditCursor-EditTop.
Thanks for the formulas! That'll make it easier for me to use the edit buffer without actually using the edit buffer (routines) Very Happy
Yup, Penguin has it covered; thanks, ThePenguin! Deep Thought, might I inquire as to what you will be doing with the edit buffer?
I'm restarting XDE (my on-calc Axe editor). This time it'll use the edit buffer because it's seems a lot safer than creating the program in 1K chunks. Having a continuous block of memory is pretty much the only reason I'm using it, since the programs wouldn't be tokenized when editing anyway (so the buffer bcalls won't work).
What if I recommended the Doors CS text-editing GUI functions along with the codebase that I use in Tokenizer DE 1.0 for tokenization? I'm not sure that that exact solves your problem, though. Smile
Tokenizing char strings is something I definitely will need to figure out. Would you mind if I used Tokenizer's code for that?

And as for DCS GUI functions, it won't help much with what I'm doing, unfortunately Sad XDE's using sprites for text because that makes it easier to do color coding (gray coding Razz) and other stuff.
Actually, you could even just use the RunProg call on Tokenizer, could you not? Although I think Tokenizer reads DCS AP files (not that you couldn't necessarily read and write AP files for your raw file storage!), but I'd be willing to share my somewhat convoluted tokenization code with you.
What are DCS AP files?
Deep Thought wrote:
What are DCS AP files?
The Doors CS AP or Associated Program feature lets you open files in their associated reader/editor simply by clicking on slash running the files. Think of it as launching Word and opening the specified file inside just by "running" the document in Windows. Smile The DCS FileSaveAs, FileSave, and FileOpen routines also have nifty GUI-styled dialog boxes for opening and saving files, including folder manipulation, as well.

More info: http://dcs.cemetech.net/index.php?title=Associated_Programs
Ah, heard about those but didn't make the connection to "AP" (College Board's advanced placement exams coming up Razz).

EDIT: Pi file? Shock
Deep Thought wrote:
Ah, heard about those but didn't make the connection to "AP" (College Board's advanced placement exams coming up Razz).

EDIT: Pi file? Shock
Haha, that makes sense. And yes, take a look at "PI" by Eeems:

http://www.cemetech.net/programs/index.php?mode=file&path=/83plus/asm/programs/PI.zip

I see.

Huh, now that I backed everything up on the computer and deleted it, I should start using DCS...
Yes, you should!
Deep Thought wrote:
I see.

Huh, now that I backed everything up on the computer and deleted it, I should start using DCS...
I think that that goes without saying, Deep Thought! Smile At any rate, I've been severely sidetracking your topic, so feel free to talk about Edit Buffers again if you want. Perhaps your project deserves a Your Projects thread?
Not yet. I don't have anything to show right now.
Deep Thought wrote:
Not yet. I don't have anything to show right now.
Your Projects topics don't just have to be for completed projects, you know; they can also be for projects in progress and for asking questions relevant to your projects! Cf. Sonlen's epic long thread.
Another question: How can you tell if a program is being edited?

EDIT: Found bit editOpen,(iy+editFlags), but how can you check if it's a program?
  
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