Making a console for my program

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

Post Reply
DaveUnit
Veteran
Posts: 72
Joined: Sat Oct 29, 2005 10:07 am

Making a console for my program

Post by DaveUnit »

First off, sorry for creating so many topics. :oops:

Anyway, I'm trying to make a console for my program to help with debugging and whatnot.

I have two ideas for holding the data being displayed:
1) I make an array that holds the last only a certain number of messages I send to the console.
2) Make a log file that records all of the messages. This is the slower method, but the ability to see every single message is good.

Which way do you believe is the better way to do things?

Also, has anyone found any tutorials that discuss things like making a console? I haven't been able to find one yet.

Thanks.

Dave
Z!re
Veteran
Posts: 887
Joined: Wed Aug 04, 2004 11:15 am

Post by Z!re »

I prefer debug files myself..
In the final release I get rid of the debug call..

Easy to do in FB if you use macros
I have left this dump.
User avatar
Zamaster
Veteran
Posts: 174
Joined: Wed Jun 15, 2005 1:51 pm

Post by Zamaster »

Im thinking that youre goin' a bit farther than you need to here Dave. I rarely use debug files unless its a really massive program that must be 100% bug-less and perfect in every way. Im sensing your making a game here right? What Id do is just break everything up into subs, I mean everything. Create a global variable called ErrorRet$(0). In every sub have a check for EVERY possible thing that could go wrong, like maybe the "DrawSprite" command got an invalid memory location to blit from. Use ErrorRet$ like a stack, the last error generated gets slapped on(in other words make it a dynamic array). And if you do this for everything,(though there would be a slight program speed decrease as goes for any other debuggin tool), your program will be sooooo easy to debug, it works like magic for me. You can break the program and check all possible errors contained in "ErrorRet$"(these error messages should also have a tag identifying where they came from). People will probably slam me for telling you this(I must be saying SOMETHING wrong here), but try it and do what works for you. It really depends on the person, this is just what works fore me.
C:\DOS
C:\DOS\RUN
RUN\DOS\RUN
DaveUnit
Veteran
Posts: 72
Joined: Sat Oct 29, 2005 10:07 am

Post by DaveUnit »

That was my original idea actually, Zamaster. I have stuff in some subs already that just prints to the screen the error until I thought of how to really store them and display them.

Thanks for your help yet again Zamaster.

Dave
Post Reply