Click to See Complete Forum and Search --> : General Question on Graphics
stmacy
12-29-2006, 02:27 AM
I was a bit puzzled about that Fischer program. When I cleared the created screen displaying the piece positions I couldn't figure out why, when the new piece positions were drawn, everything was drawn in its correct position. Not finding the answer in the Psion manuals I rechecked the gCLS statement itself in Leigh Edward's book and sure enough there was the reason. Not only does the statement clear the current drawable, but it also resets the current graphics position to 0,0. So the line in procedure Graphx:, "gAT 0,0", is quite useless. I didn't know that. But I came across another question that I'm still scratching my head at. Here is a piece of code:
PROC test:
DO
PAUSE 20
gMOVE 0,20
gPRINT "Hello"
GET :gCLS
UNTIL 0
ENDP
Shouldn't this program pause for 1 second, gprint "Hello", wait for a key press, clear the current drawable and then display an empty screen for another second to be done again? On my Psion, when I press a key, something happens, but much quicker than a second! If I rearrange the program leaving out any graphics keywords then the program does indeed pause for that second. Any insight? :confused:
Nemo20000
12-29-2006, 05:26 AM
I think there's something you're not telling us. The above program works exactly as expected (allowing for the fact that keyboard auto-repeat can cause it to loop many times with "Hello" hardly visible).
PAUSE would only end early if given a negative value. Are you sure you have exactly the above program - you haven't rewritten it to post it here? Which Psion are you using?
stmacy
12-29-2006, 07:04 AM
Are you sure you have exactly the above program - you haven't rewritten it to post it here? Which Psion are you using?
The code you see is the exact code written on the Psion and it behaves as I described. This is happening on a Psion 3c. I've also checked it out on a 3a and I get the same effect.
Nemo20000
12-29-2006, 02:09 PM
Aha, I'm no authority on the 3's version of OPL. I wonder if pause returns early if there's a keypress even with a positive parameter? On the 5, 7 and Netbook it operates as you'd expect, and would only end the pause early if you wrote PAUSE -20.
I could dig out a 3a to experiment, but not for a few days.
stmacy
12-30-2006, 01:36 AM
I wonder if pause returns early if there's a keypress even with a positive parameter?
That what it appears to be. But the funny bit is when I rearrange the program to exclude any graphics commands then the program runs as expected. I remember in the past I had some strange experiences with PAUSE but always put it off for later thinking I had programmed wrong. I now wonder. If we haven't missed out on something then this is probably a bug of some sort. "Even the best miniature computers on the planet have bugs." I have a number of Series 3 computers and the ones I've checked up on all do the same thing.
Even I rechecked my old problem and here is something similar in code:
PROC Pause:
DO
PAUSE -100
AT 1,4 :PRINT "Hello"
GET :CLS
UNTIL 0
ENDP
This program will pause for 5 seconds no matter what!
edit: I did some playing around and found that "PAUSE 0" will pause the program indefinitely unless followed by a "GET, KEY, GET$ or KEY$". If "PAUSE" is given a negative value then the program WILL pause for the time specified regardless of any key press. On the other hand, if "PAUSE" is given a positive value then the program will pause for the specified time, but under certain conditions it may not even pause for that time.
PDA Street
Copyright Internet.com Inc. All Rights Reserved.