Message Base with Qbasic

I am working on an old BBS program (my own) on an old 80’s computer that is accessible via Telnet.

I need to write a message base to store messages in a file, maybe titles, to, from, date, msg # in another file.

I want it to be able to delete messages say once a board hit’s 30 messages it deletes the old message.

I have not figured out how to do this in Qbasic yet. Does anyone have anything i can use maybe a message base already done that I can modify for my use or can help me get this done?

You will get credit on the BBS for the coding.

QBasic has commands for opening, reading, and writing files. They’re pretty straightforward. What part are you having trouble with?

Oh joy.

I’d suggest asking this question over at You’ll get much better answers there.

Anyway, if you’re having trouble with the logic of handling multiple data fields for a single entry, I’d recommend a comma-separated-value (csv) format, though you’d probably want to pick a less common character for your separator.

Recording the data is easy, just insert your separator after writing each field and a line-feed (carriage return, line break, whatever you want to call it) after each record. Increment a counter each time you write a record. When that counter hits 30, erase the first line, decrement the counter and re-read all the messages. I’d recommend doing the cleanup with a separate subroutine and call it as needed.

For reading it, here’s your logic:
Open file for reading (not sure if this is needed in qbasic)
Read through file until you reach your separator or a line feed
if the character is a line feed assume all fields are null and move to the next message
Assign that value (before the separator) to field 1 of entry 1
if the character is a line feed assume all remaining fields are null and move to the next message
continue reading from that same position (should be right at separator) until the next separator
assign that value to field 2 of entry 1
repeat until you’ve handled all fields or reached a line feed.

Depending on how robust it needs to be, you might want to use a tombstone instead of deleting a message. Basically, you put some indicator at that record to indicate it’s been deleted. You then modify your reader so that it ignore everything between your tombstone marker and a line feed.

If you want some more

Are you looking for random access files? Try here.

This makes me feel very old.

I have not messed with it at all just yet. I have written an email program already which works good. But I am trying to set the each message base to have 30 messages and be able to delete the oldest one. I am having issues imagining the process that is going to be required.

I was thinking of having a title file that would store:

message #, To, From, Date, Title, message pointer(similar to a record)

another file that holds the body of the message and the program would use the message pointer to pull the correct message out of the file.

Of course when it hit’s 30 messages it should delete the old message and old title and replace it all. of course that is where I am having the issue of thinking through the process of how it will now rej-ugle the title file correctly.

Why not just re-implement the original JAM Message Base Format utilized in the original bulletin board systems? It’s well documented and easy to understand and code.

For that matter, you can probably find the original DOS utilities and code libraries to include in your program.

Bringing back some old memories here…

Link to the JAM message base format and specs .

The MBUTIL program in the Gecho package is what I used for board maintenance back in my sysoping days. Keep in mind the recommended system requirements of 300k RAM and a 386 processor.

i’m looking to do this in qbasic to be able to convert it to an older basic programming language for an older vintage computer.

So the JAM message base format will not work for me. I must do it from scratch.

Not sure I follow why JAM isn’t an option for you. It isn’t language dependent at all, but if you can’t use it, you should be able to use it as a template for rolling your own. I have written utilities for it in qbasic when I needed something done quickly for proof of concept and procedure testing. Then I turned around and recoded in C++ for speed.

Good luck!