QBasic => QB Discussion & Programming Help => Topic started by: jacobb on February 11, 2008, 09:46:16 AM

Title: wrong characters in XP graphics.
Post by: jacobb on February 11, 2008, 09:46:16 AM
Years ago I  wrote a large qbasic program which is still very important to me.
It has been perfectly running in windows 98 and xp machines (my WP and OEM ones) for years.
 (in vista I have a problem in the graphics windows - it simply does not work - period.)

It still runs perfectly in my old pentium 2 IBM thinkpad now with XP sp2.
I have installed it in a new desktop intel core 2 duo with the same windows XP sp2 that is running in the thinkpad, but although everything goes fine in the text windows, the graphic windows are not working okay
the graphics in those windows come out fine, but the text in those graphics window seems to be written in a crazy unknown language.
I compared the exe and bat properties that I used in both systems and they are precisely the same.  Unless I am missing something, the windows XP sp2 parameters are also the same for both systems in terms of regional languages, etc.
Can a good soul please give me a hint on where the difference may be?
Thanks a lot


Title: Re: wrong characters in XP graphics.
Post by: Mac on February 14, 2008, 04:37:08 AM
Can a good soul please give me a hint on where the difference may be?
Thanks a lot

Well, I tried your question at another forum to see if there were any ideas. There were. The basic take was this: Vista no longer supports a full screen DOS window.

You could try this
LOCATE 10, 35
PRINT "Hello, World!"

Let me know if it works. I don't have Vista. There were some ideas about some download called "DOSBox, Virtual machine, etc.". You could check for other ideas at


Title: Re: wrong characters in XP graphics.
Post by: jacobb on February 15, 2008, 04:46:58 PM
Hi, Mac
Thanks for your reply.
However, my present problem is not Vista, but XP.
My qbasic program is behaving differently in two systems running the same XP version, same display size and same language setup.
In my old Thinkpad notebook, text and graphic windows run fine. (this is also true for a pentium 4 toshiba notebook). 
In my new desktop, however, although text and graphic windows run fine, any text inside a graphic window comes up illegible, garbage, with strange characters.
Can you help me with that? By the way, the exe files are identical in both cases and the properties are also exactly the same.

As to Vista, forget a graphic qbasic windows. It does not work and dos-box does not help either. As to the size of a text window, just change to 10x18 raster fonts for 88x600 display, experiment, or lucida console fonts 20 to 22 and you will get a much larger window. 

Title: Re: wrong characters in XP graphics.
Post by: jacobb on February 15, 2008, 05:35:13 PM
I meant of course 800 by 600 display, and not 88x600 as I typed.

Title: Re: wrong characters in XP graphics.
Post by: Mac on February 16, 2008, 06:09:51 AM
I meant of course 800 by 600 display, and not 88x600 as I typed.

Go check the thread I posted above. Give the info there, too.


Title: Re: wrong characters in XP graphics.
Post by: Ralph on February 16, 2008, 04:07:25 PM

After reading your and Mac's posts here, it occurs to me that you are probably having trouble with some other program that is running in the background, and claiming memory that QB is also trying to use.  That program is started automatically when you turn your computer on, and runs all the time, in the background, ready to do its job when called for.  But, it may not ever be used by you! 

In my case, I had a program called Flatbed.exe, which was necessary for a scanner that I no longer used. and that program turned out to be the one that did not let me use my QB graphics programs.  Oh, and this occurred when I went to a new computer, with Windows XP Home.   

To try this possibility out, I recommend that you do a Start, Run, and enter msconfig.  Then, click on the Startup tab and press the Disable All button.  Now, close down and restart your computer.  Run your QB program and see if it now runs as it is supposed to.  If it does, that was the problem.

To locate which program is the culprit, go back to the msconfig, Startup, and enable, say, half of the programs there, close down your computer, restart, and try your QB program.  Do this repetively, until you find out which program is the culprit.  At that point, you can continue to run your computer without that program being run at start up, and, if you never have a problem in anything else, just leave that program disabled for running at startup.  Otherwise, you can have it enabled all the time, but, before running yourQB program, disable it.  Someone might even be able to provide you with some code to do this automatically whenever you run the QB program, and to reanable it when the program finishes.  But, that would be a completely new thread, and it might even require going to a forum for another language, I don't know.

I know that the above involves a lot of work and time, but, it is very much worth it to know what the problem is, and what the cure is!  Do let us know if this works out for you.

Title: Re: wrong characters in XP graphics.
Post by: Mac on February 18, 2008, 05:23:01 AM
After reading your and Mac's posts

I doubt that Jacobb checked on this URL:

Title: Re: wrong characters in XP graphics.
Post by: Ralph on February 19, 2008, 12:03:20 AM
I agree that Jacobb SHOULD have answered to that URL, at least as a matter of courtesy.  He might have gotten turned off by so many references to Vista, though.  It seemed to me that his post, which is a little involved, might not have been read carefully enough.

In the present forum, he HAS responded, so, I believe that he will respond to our latest posts, too.  After all, he does seem to be interested in getting his problem solved!

Title: Re: wrong characters in XP graphics.
Post by: jacobb on February 19, 2008, 08:59:37 AM
Guys, I apologize for the delay.
After Mac's suggestion I decided to go into my program and check if screen and other commands are not compatible to the LG monitor. I thought that it would take me 24 hours. I was wrong.
My program has 410 kb but does a huge amount of stuff. I started to write it using the first basic system available when memory was short and each sub had to do many things supported on a combination of switches. Powerful but crazy.
I kept changing the basic system - last version I used was professional 7.1 - used assembler subs mach.qlb for acceleration, and built new routines on top of the original program without ever restructuring it when memory became inexpensive. Since the exe was stable, I forgot it, never touched it again.
Then one day, still years ago, I decided to make a shorter structured version, started to change it, gave up and dropped it. Now, I don't know what I've changed, it does not run at all in its bas format, and it will take me a lot of time to figure it out. Believe me, I even forgot what command carries me instruction by instruction to track errors. 
That is why I disappeared. Only today I've seen Ralph's suggestion. The msconfig did not help by disabling the startup functions, I even stopped some of the services (like remote support and others). Nothing. My next step is to see if the error is a function of the LG monitor driver, although it does not make much sense. (it may be something linked to cga, ega, vga, etc.). But where is my screen command??? How did I put the text into the graphics window???
 Ralph's suggestion makes a lot of sense, the desktop has a huge set of applications, including virtual disks. Maybe msconfig did not take care of all of them. I'll have to work on that.
So, again forgive me for not replying sooner (I still have to do all my other tasks in life).
I'll probably have to study basic 7.1 again to go into my program and then come back to you. Unless someone, for example, finds out that some of the windows XP updates have messed up with dos graphic windows. I've realized the my old thinkpad runs xp sp2 but not with full update because it is offline. (it has 128 kb of memory! and runs ok xp, office, etc etc. (a lot of paging)
Mac, I'll go into the other forum and explain how to increase the text screen size in vista.
Thanks, don't forget me if you have new ideas.
(I wonder why the forum did not notify me of replies, although the box is checked in additional options. My email is correct.).

Title: Re: wrong characters in XP graphics.
Post by: Ralph on February 19, 2008, 07:27:04 PM

Thanks for your very detailed explanations.  Sorry my msconfig suggestion didn't turn out to fix your problem.

To run a program in step mode (one line at a time), I create a "toggle breakpoint" by pressing the F9 key.  Then, I run the program (Shift+F5), which runs and stops at my first breakpoint,  Now, I can run the step-by-step mode by pressing the F8 key.  I put breakpoints at strategic places, and press F5 to run through code that I don't need to step through. This method should let you find the lines where you have a problem, which you might then be able to address.  Good luck! 

Title: Re: wrong characters in XP graphics.
Post by: jacobb on February 20, 2008, 10:31:20 AM
Hi, Ralph - F8! Right! How could I forget that? Breakpoint, variables tracking, etc, I recalled, but F8 was the one I forgot.
But there is another problem. Since I messed up with the program when I started trying to structure it, I killed some subs, so the shift-F5 and F8 do not even start the program because bc71 alerts that there are inexistent subs that are called somewhere by the program. Search is no showing the subs, that is, they are in some lost module. What a mess.  To Rem those calls may be the only temporary solution. What a mess. 
I 've realized that screen and other commands work with parameters that are changed within the program.

Anyway, I know already that the monitor spec does not have anything to do with the problem. The monitor works fine with a toshiba notebook running updated xp sp2. So the XP update issue is not the cause too.
I've noticed that the text is coming in special characters (signs) instead of the standard alphabet. Same number of characters. However, in a exclusively text window of my program, the characters come out ok. Only the graphics windows puts its text in special symbols instead of normal alphabetical wording. Therefore, it seems that it cannot be another software in the background too.
Does this makes you suspect of anything? 

Title: Re: wrong characters in XP graphics.
Post by: Ralph on February 21, 2008, 12:13:13 AM
Perhaps Mac can better answer your question, but, here's my thought.  If normal, alphabetical letters and digits are being shown as strange symbols, it may be that the normal characters have had a constant added to them.  How?  No idea.  But, it might be interesting to have a list of the characters that are appearing; someone may be able to de-encrypt them!  Well, it's just a thought, but, who knows?

As to you having altered your original code, etc., are you saying that you changed the original code, without using a copy?  Wow!  But, if you still have the original code somewhere (look for it ardentlay!), then, all is not lost.

Title: Re: wrong characters in XP graphics.
Post by: gummo on May 27, 2008, 01:25:11 AM
This may just be my personal preference, but when working in qbasic, I write and run in a vmware or virutal pc virtual machine of dos 6.22. I'm sure DosBox emulates properly, but if not, someone please write me back. If I ever distribute any of my qb programs, I plan of including  a copy of DosBox, ala the re-release of Wolfenstein 3d. BTW I'm running both Vista and XP.

Title: Re: wrong characters in XP graphics.
Post by: Ralph on May 27, 2008, 03:08:16 PM

When the code for a program becomes unintelligible, or when some of the code is missing, and we struggle for a while and decide it's just not possible, about the only sane and reasonable solution is to start from scratch, that is, rewrite the whole thing!  And, this time, begin by writing up a good desciption of the proyect in a good word processor, saving the file with the intended program's name. 

The second step is to do some general coding that works, and save it with the desciptor, say, filenm00.bas, saved as text.  I also like to preface my code with a brief description of the program's use, as well as a numbered single-line title for each of the intended steps for the program, which I modify as I progress with the code, doing an update on each finished "version". 

For the next step, call up filenm00.bas, save it immediately as filenm01, and start working on it.  Write the next bits of code and run it, making sure it works...if not, fix it...; if you cannot, then, bring up the last, working copy (filenm00 will be the first), save it immediately as the next number in line (filenm01, for the case in point), and continue in this manner, ending up with as many "versions" as you need. 

Now, save all the "versions" to some conveniently located folder named, say, filenm,  copy the last and greatest one to your qb folder (directory), and proceed to compile it. 

Oh, I almost forgot!  DO USE GOOD, EXPLANATORY REMARKS for each new paragraph of code, either just before writing it, or just after, so that, when you have to go back to your code next month or next year, you will have good reminders of what the code is supposed to do.  These remarks will someday be worth more than one can believe!!!

And, good luck!

Title: Re: wrong characters in XP graphics.
Post by: LPG on May 28, 2008, 02:21:44 AM
it might be adding 127 or 128 to the character code e.g.

print chr$(65)

prints a capital A but it might be printing character 192 or character 193 because of a screen driver, both of which are special characters.