Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

word processor

Status
Not open for further replies.

qbasicking

Programmer
Aug 19, 2001
628
US
I am trying to write a word processor. I can't figure out how to begin. How should I make the program handle the input? Meaning: letter by letter, word by word, line by line, et cetera.
Also how would I save it?

Don't ask me to post what I've got so far, for I have nothing. I don't know how to start, once I get that done, i should be able to figure out the rest by myself.

Thanx in advance! :)
 
To even think of doing a word processor in basic is an exercise in futility.
Qbasic's editor ( which is a bare minimum start for a word processor ) isn't done in qbasic.
That should give you some food for thought.
I thought Alt255 had convinced you not to even try. Ed Fair
efair@atlnet.com

Any advice I give is my best judgement based on my interpretation of the facts you supply.

Help increase my knowledge by providing some feedback, good or bad, on any advice I have given.

 
I did give up for a while, but i've been getting bored making easy programs, i need a challange. I know that it is possible but extremely hard to build one.
I want to do something really hard in a relativly simple language.
It's like catching a big fish with a small tackle.
 
i searched the web a little bit and I found a great word processor code
this is the exact address :
if you can't go directly to it, this is how i got there. If you have AOL type in qbasic then it's the sixth one down. 'Qbasic download page' then it's easy to find.

Best of luck to anyone else trying to do this daunting task
 
All you people seem to have the attitude that QBasic is only good for simple maths and a small amount of graphics.

This is not true, QBasic is very powerful, if you use it correctly. It is like any other programming language, expect it just has different commands.

It is easily possible to write a word processor in QBasic, I have done it and I have seen many on the internet which also do. I have also seen some very good QBasic GUIs on the internet - again showing how powerful QBasic can be if you use it correctly.

Some of the best QBasic programs have written 3D gaming environments in QBasic and 3D gaming engines. There is even a book on it.

So I applaud QBasicKing for wanting to write a word processor and if he wants any help I will be willing to give it to him.
 
To GodofCuboids:

How should I make the program handle the input? The link that I posted does it line by line, but it doesn't seem that great.
Should I do it letter by letter or word by word?

PS. Where did you find the GUIs on the internet?
 
The command you want is called INKEY$ (search for it in QBasic help). However if you post your email address or send it to mine ( servercomputer@hotmail.com ) i will be able to more easily explain and help you.

There are QBasic GUI reviews and downloads at and The one I have looked at is GIMI (it needs QuickBasic 7.1 if you have not got it) - although is a little slow.
 
i was planning on using INKEY$ and DO-LOOP, but that wasn't what I asked. Let me clarify. Should I have the PROGRAM handle the input by words, or by individuals letters?
here is what I mean:

'this will process input one letter at a time
DO
X=X+1
LETTER$(X) = INKEY$
LOOP

but this is limited because the stirng can only be so big (28000 character i think)
If I make LETTER$ be a word then I can have 28000 words and it would be easier to make a spell check, but harder to edit.

Which should I use: letter by letter or word by word?
 
You will not be able to have 28000 words for the same reason that you can only have 28000 characters. The reason for these limitation is lack of memory for the arrays. The maximum in QBasic 1.1 for each array is 32Kb I belive. Therefore any array exceeding that causes an error.

The reason you can only have 28Kb (or about) for your other string is because QBasic has dynamically allocated numerours bytes for each variable of the array (usually about 256bytes). So your only put 1 byte (The letter pressed) into each of the 256byte long variables. Effecitively wasting 255bytes.

A way around this is to tell QBasic to allocate 1 byte per variable in the array.

DIM LETTER$(32000) AS STRING * 1

There are numerous reason for making the word processor line by line or letter by letter or word by word. In my word processor - if i remember correctly - it went line by line. This method means it is easier to draw the information on screen and to word wrap.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top