Yes immediate action if a key is pressed but not to speed up if a key
is pressed and that the speed to remain constant if different systems
are used, i.e. I am writing the programme to work a required speed on
a standard QL and not change significantly if emulated at full speed.
The only perceived difference would that maybe the graphics would
appear smoother. 

Therefore If I tested (for example) a delay for 50 mS before doing
something on the QL it may act straight away due to the speed of the
QL execution, however on a faster emulated or SGC system it would wait
until that 50Ms time has passed before doing something, which would be
at the same time that the original QL would be doing it. Is this
making sense?

Thanks, Lee

-----Back to the QL-----
http://backtotheql.blogspot.com/
https://sites.google.com/site/iwant2learn2/
https://sites.google.com/site/theqlimagerepository/


-----Original Message-----
From: ql-users-boun...@lists.q-v-d.com
[mailto:ql-users-boun...@lists.q-v-d.com] On Behalf Of Rich Mellor
Sent: 23 May 2011 23:32
To: ql-us...@q-v-d.com
Subject: Re: [Ql-Users] Delaying code

On 23/05/2011 22:45, Lee Privett wrote:
> Based on the fact that Turbo'd programmes will FTL QL SuperBasic in 
> newer emulators (a mistake of my far past programming examples) I
find 
> myself needing to put slow down routines in to the code so that when

> compiled or used on a PC 100 Gigahertz Super Duper all singing and 
> dancing with go faster stripes down the side computer it will still 
> run at the same speed (especially graphics or control operations).
>
> In the past on the original QL I have rather naïvely used a plethora

> of for/next loops (yes I know) to do this,  The only thing I can
think 
> of now is to use something similar to TIMER (QuickBasic) which gives

> you the number of cycles since the machine has switched on. Cycles?
> what cycles? no idea, I think it's' fractions of milliseconds or 
> similar, well this is what I need. Also in Quickbasic you can use
this 
> TIMER number as a really good randomiser seed number, however I 
> digress.
>
> So if I want to move something across the screen at the same speed 
> regardless of host speed how do I do it?
>
> Something like
>
>               10 FOR F = 1 TO 25
>               20 PRINT CHR$(31);
>               25 A$ = INKEY$ : do something else with this (stops me
using the 
> Pause command so…)
>               30 DELAY (100)
>               40 END FOR F
>
> DELAY 100 gives a 100 millisecond delay
>
> The QL doesn't seem to have anything suitable, DATE doesn't work, 
> PAUSE doesn’t work if you press a key and I need to do that, so
there 
> must be a PEEK somewhere, or am I missing something simple, anyone?
>
> Thanks, Lee
>
> -----Back to the QL-----
> http://backtotheql.blogspot.com/
> https://sites.google.com/site/iwant2learn2/
> https://sites.google.com/site/theqlimagerepository/
>
>
> _______________________________________________
> QL-Users Mailing List
> http://www.q-v-d.demon.co.uk/smsqe.htm
>
>
I am not sure if we are missing the point here...

Surely you can use

25 A$=INKEY$(20)

This will allow you to do something else if a key is pressed,
otherwise, the machine waits for 20 frames.... (using the 50Hz
interrupt)

Don't you want the program to take immediate action if a key is
pressed?

--
Rich Mellor
RWAP Services

http://www.rwapsoftware.co.uk
http://www.rwapservices.co.uk

-- Try out our new site: http://sellmyretro.com


_______________________________________________
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm

_______________________________________________
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm

Reply via email to