Home | Reviews | GUIpedia | Forum | Fun500


trollytext editor
hi, do someone have a example how to make a texte editor especialy how to handle the buffer and the edit box control
2008-10-016:05 PM

ToddRe:text editor
I don't know of any text editors off-hand other than looking for one and converting it to run in SCREEN 12. For the buffer, you would need to have an array of strings (256 characters per string). You can typically have 256 items in an array for QB to handle it properly or you can use EMS/XMS but I don't recommend it since it won't work well on every computer. If you're really desperate, you can have a page-full of strings and read/write to a file on the hard disk.
2008-10-016:32 PM

Re:text editor
If you had this "buffer" in QBasic and the size of the file was super large, wouldn't it give some error? And arrays have limits. Just make you text editor pure, without any of the "buffer" stuff, and save only whats been modified? For the input routine, you'd have to code your own. It might be something like this?: [code] CLS PRINT "Press to exit": PRINT DO LOCATE , 3: PRINT c$ + "_" + CHR$(0); DO a$ = INKEY$ LOOP WHILE a$ = "" IF ((ASC(a$) >= 33 AND ASC(a$)
2008-10-018:52 PM

trollyRe:text editor
okey i chalenge you to make a text editor control for my gui (q-step) you can download the sources i the related topic in "gui" section, i've include a template app, for beginging app developping
2008-10-0110:09 PM

BrandonRe:text editor
I would help, but if you look, I've never made a text editor myself.
2008-10-026:52 AM

ysftRe:text editor
All right I'll do it. I don't exactly understand the template so i'll just make it in screen 0 for now. I have started on the editing box, and am writing code to handle files. Please reply on almost exactly on how you want it to look and behave. As I will be away tomorrow and saturday. It will be done on sunday at around the afternoon.
2008-10-028:06 PM

BrandonRe:text editor
He has started trying to make one himself, you can see in his lastest QStep Demo.
2008-10-028:10 PM

Re:text editor
Well, i'm gonna make one anyway, i got nothing better to do lol.
2008-10-028:13 PM

BrandonRe:text editor
Yeah, his could use some help, I was just saying its a start for you to build from.
2008-10-028:15 PM

SonicBritRe:text editor
So I'm working on a base idea for a text editor, which whilst its text only it will be moved to gui. At the moment it is more of a glorified text viewer, which has some limitations (20kb of text max, 2048 lines max) So the way I see text viewers (and editors) is 3 parts: 1. How it gets stored in memory. 2. How it gets displayed on the screen. 3. How Editing is processed 1. In memory I keep the text file in a single string, whilst I have pointers to each line of text, and the size of that line, (this will help later on with edits because the new pieces can be stored outside of the original, also using multiple edits as an undo mechanism) 2. The display needs to know the current line its looking at and the current character start, so that it can display the current area of text. 3. Next will be moving a cursor around the display, for scrolling the text as well as finding places for edits. After that I'll add some basic text editing features, inserting text as well as deleting. The biggest limitation is qbasic's memory model, it uses the medium memory model (from c), which basically says code size can be greater then 64k (64k is the size of a segment of memory under the 16-bit limitations of the IBM PC platform), but data size can only be a maximum of 64k (and a lot less in reality due to the way qb manages memory for strings and other variables). So The text string will need to be stored in XMS/EMS memory and possibly the text pointers too. [file name=TEXTED.zip size=1001]http://theguiblog.com/images/fbfiles/files/TEXTED.zip[/file]
2008-10-233:29 PM

BASIC Programming Help


2021 Brandon Cornell