Hi,
I'm relatively new to PBCC (but experienced at VB6 and Basic PDS). I'm doing a program that does dialog with the user in a console window and
shows graphics in a graphic window. The graphics involve constructing 11 curves with about 150 straight line segments each. The straight line segments are done with a GRAPHIC LINE statement that is reused repeatedly. Everything compiled OK. However, when the program was run, sometimes segments of curves or entire curves were missing.
I noticed when I inserted some print statements in the loop to help debug, the problem seldom happened. It occurred to me that the delay caused by the print statements actually was solving the problem. So, I put in a time waster in the loop (FOR i% = 1 to n%, NEXT i%). The time waster runs for each line segment. When I got n% up to 1000000, the problem became uncommon; at 2000000, it disappeared. Program execution speed was acceptable. SLEEP 1 slowed the program too much, but worked too.
I can't help but think the problem is a flaw in PBCC, but perhaps it's the OS (WinXP). I worry that the time waster loop will be too much or too little on machines other than my own. Comments or suggestions?
My OS is Win XP.
I'm relatively new to PBCC (but experienced at VB6 and Basic PDS). I'm doing a program that does dialog with the user in a console window and
shows graphics in a graphic window. The graphics involve constructing 11 curves with about 150 straight line segments each. The straight line segments are done with a GRAPHIC LINE statement that is reused repeatedly. Everything compiled OK. However, when the program was run, sometimes segments of curves or entire curves were missing.
I noticed when I inserted some print statements in the loop to help debug, the problem seldom happened. It occurred to me that the delay caused by the print statements actually was solving the problem. So, I put in a time waster in the loop (FOR i% = 1 to n%, NEXT i%). The time waster runs for each line segment. When I got n% up to 1000000, the problem became uncommon; at 2000000, it disappeared. Program execution speed was acceptable. SLEEP 1 slowed the program too much, but worked too.
I can't help but think the problem is a flaw in PBCC, but perhaps it's the OS (WinXP). I worry that the time waster loop will be too much or too little on machines other than my own. Comments or suggestions?
My OS is Win XP.
Comment