News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu

WAIT in Basic

Started by litwr, 08:21, 05 January 16

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

litwr

Is there any useful example for this command?  Commodore 64 Basic allows WAIT203,64,64 to wait until any key is pressed.  Does Locomotive Basic have the similar feature?  I am looking for something better than
10 r$=inkey$:if r$="" goto 10

AMSDOS

* Using the old Amstrad Languages :D   * with the Firmware :P
* I also like to problem solve code in BASIC :)   * And type-in Type-Ins! :D

Home Computing Weekly Programs
Popular Computing Weekly Programs
Your Computer Programs
Updated Other Program Links on Profile Page (Update April 16/15 phew!)
Programs for Turbo Pascal 3

litwr

Wow!  I was fixed in the Commodorish ways and missed so obvious solution.  :(  Thanks.

TFM

Quote from: litwr on 08:21, 05 January 16
Is there any useful example for this command?  Commodore 64 Basic allows WAIT203,64,64 to wait until any key is pressed.  Does Locomotive Basic have the similar feature?  I am looking for something better than
10 r$=inkey$:if r$="" goto 10


Without a call you can...

9 if inkey$="" goto 9

;)
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

dodogildo

Isn't that same as @litwr's code :)
M'enfin!

TFM

No, I changed the number of the line.  8)
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

||C|-|E||

This is funny, the other way I was fighting to implement something that waits a few seconds and I was also looking for a keyword in BASIC for it. At the end, I solved the matter in the worst possible way, with a FOR loop with a sum inside  :picard:

TFM


Nothing wrong with FOR-NEXT.You can add the FRAME command, so you get steps of 1/50 seconds.
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

||C|-|E||

Thank you! But somehow I felt that it was something not elegant at all  :) . I will add the FRAME thing, anyway, it is a great idea!

TFM

Quote from: ||C|-|E|| on 00:08, 06 January 16
Thank you! But somehow I felt that it was something not elegant at all  :)


Well, we will never know.... [nb]Uups, tooo late![/nb]
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

andycadley

It always struck me as odd, given how well implemented the Locomotive BASIC multitasking is, that there wasn't something along the lines of the PAUSE command from Sinclair BASIC in it. Seems like something obvious (and far more so than WAIT is, given the CPC architecture).

AMSDOS

Quote from: andycadley on 00:11, 06 January 16
It always struck me as odd, given how well implemented the Locomotive BASIC multitasking is, that there wasn't something along the lines of the PAUSE command from Sinclair BASIC in it. Seems like something obvious (and far more so than WAIT is, given the CPC architecture).


Seems too obvious calling it PAUSE or WAIT, on a CPC it gives you the opportunity to explore with it's firmware & CALL &BB18 is an easy workable Keypress Routine for BASIC, you can even name a variable (anything you want) and CALL <your variable name> and it will work.  :D
* Using the old Amstrad Languages :D   * with the Firmware :P
* I also like to problem solve code in BASIC :)   * And type-in Type-Ins! :D

Home Computing Weekly Programs
Popular Computing Weekly Programs
Your Computer Programs
Updated Other Program Links on Profile Page (Update April 16/15 phew!)
Programs for Turbo Pascal 3

TFM

Since the CPC comes from the UK it contains one of the most underestimated commands...


ON TEATIME CONTINUE



TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

villain

Quote from: TFM on 17:56, 06 January 16
Since the CPC comes from the UK it contains one of the most underestimated commands...


ON TEATIME CONTINUE

Yep, and I'm quite sure the 472 knows exclusively the command

mañana mañana

8)

Anybody knows the german equivalent for the Schneiders? :-)

ZbyniuR

#14
10 t=TIME+300*sec:WHILE t<TIME :WEND

sec = mean how many second you want wait. :)

Or in slide show:

t=TIME+300*8:WHILE t<TIME AND INKEY$="":WEND

That wait 8 second, but if you press any key, loop will end early. :)

It's work fine in my slide show:
First tests using the ConvImgCPC + minor adjustments graphics ... :)

In STARS, TREK is better than WARS.

||C|-|E||

I actually like that version, I think that it is the one I will use at the end! Thank you!  :D

ZbyniuR

I made mistake, should be  TIME<t   or    t>TIME    not   t<TIME. Sorry. :)
In STARS, TREK is better than WARS.

TFM

You can use t<>TIME too.
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

Powered by SMFPacks Menu Editor Mod