TIP: Click on subject to list as thread! ANSI
echo: apple
to: comp.sys.apple2
from: Michael J. Mahon
date: 2009-02-27 15:32:30
subject: Re: help diagnosing an Apple IIe, please.

John B. Matthews wrote:
> In article 
> ,
>  adric22  wrote:
> 
> [...]
> 
>>Well I'm an old school C64 programmer, so let me ask you this.  How do
>>you write a program in BASIC that continues to loop and do stuff while
>>waiting for a keypress?  For example, I was trying to write a simple
>>drawing program for the low-res graphics mode and I wanted it to blink
>>the pixel it was currently sitting on when no keys were being
>>pressed.  How would I achieve this?  On the C64 we would use a command
>>like this:
>>
>>10 GET A$: IF A$ = "" THEN GOTO 10
>>
>>That would achieve the same thing as the GET statement alone achieves
>>on the Apple, but I could remove that GOTO 10, and put it at the end
>>of several other commands.. That way those commands would continue to
>>execute until something was pressed.
> 
> 
> Maybe something like this?
> 
> 10  HOME :A$ = " ": ONERR  GOTO 90
> 20  PRINT "Press any key; ^C exits."
> 30  KB = -16384 : KC = KB +16
> 40  IF PEEK(KB) >  128 THEN POKE KC,0 : A$ = CHR$(PEEK(KB))
> 50  VTAB 12: PRINT ">  ";A$
> 60  VTAB 12: PRINT "-> ";A$
> 70  VTAB 12: PRINT "-->";A$
> 80  GOTO 30
> 90  END

You can also GET the key after determining that one has
been pressed:

40 IF PEEK(KB)>127 THEN GET A$

-michael

NadaNet and AppleCrate II: parallel computing for Apple II computers!
Home page: http://home.comcast.net/~mjmahon

"The wastebasket is our most important design
tool--and it's seriously underused."
--- SBBSecho 2.12-Win32
* Origin: Derby City Gateway (1:2320/0)
SEEN-BY: 10/1 3 34/999 120/228 123/500 128/2 140/1 222/2 226/0 236/150 249/303
SEEN-BY: 250/306 261/20 38 100 1404 1406 1410 1418 266/1413 280/1027 320/119
SEEN-BY: 393/11 396/45 633/260 267 712/848 800/432 801/161 189 2222/700
SEEN-BY: 2320/100 105 200 2905/0
@PATH: 2320/0 100 261/38 633/260 267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.