Path: news.uiowa.edu!chi-news.cic.net!news.math.psu.edu!news.cse.psu.edu!uwm.edu!math.ohio-state.edu!howland.reston.ans.net!news-e2a.gnn.com!newstf01.news.aol.com!newsbf02.news.aol.com!not-for-mail From: rubywand@aol.com (RUBYWAND) Newsgroups: comp.sys.apple2.programmer Subject: Re: Input Anything routine Date: 18 May 1996 20:10:48 -0400 Organization: America Online, Inc. (1-800-827-6364) Lines: 37 Sender: root@newsbf02.news.aol.com Message-ID: <4nlou8$lmh@newsbf02.news.aol.com> References: <4nglek$qu@newsbf02.news.aol.com> NNTP-Posting-Host: newsbf02.mail.aol.com X-Newsreader: AOL Offline Reader In article <4nglek$qu@newsbf02.news.aol.com>, cbrmaster@aol.com (CbrMaster) writes: >Could someone provide me with an input anything routine? The one I >currently have alwasy dumps me too the monitor on a IIgs. I need to use >that for a Applesoft Basic program I'm doing. > > This routine is handy for allowing a user to input ProDOS, etc. commands in a program because it allows inputing commas and colons: 500 Q$="": PRINT": ";: CALL 64879: FOR J= 512 TO 611: IF PEEK(J) <> 141 THEN Q$= Q$ + CHR$(PEEK(J)-128): NEXTJ 510 RETURN CALL 64879 lets you type in the stuff. The FOR NEXT loop scans through the input buffer starting at $200 and adds characters to the Q$ string until a RETURN is encountered. For example, after 700 ?"Command";: GOSUB 500 Q$ will contain the stuff you typed in, such as CATALOG,S5,D2 and you could execute the command via 710 PRINT CHR$(4)Q$ 720 PRINT " ";: GET Q$: PRINT 730 RETURN Rubywand