Short:        Wait for return in scripts
Author:       Nagilum
Uploader:     nagilum chillout org
Type:         util/cli
Requires:     OS1.2
Architecture: m68k-amigaos
Distribution: Aminet

This small command can be used in scripts to make the user press return 
or enter.

Features: blinking 'Press RETURN! at the prompt', the prompt will
	  be clean after pressing return, no polling, easy to use.

Usage: just start it (without any parameters)

DISCLAIMER: THE AUTHOR IS NOT RESPONSIBLE FOR ANY DAMAGE OR LOSS
OF DATA OR WHATEVER CAUSED BY Return. ANYONE USES IT WITHOUT WARRANTY.

here is the source:
================================ cut here ===================================
	incdir	Include:
	include	dos/dos.i
	include	dos/dos_lib.i
	include	exec/exec_lib.i
	include	exec/libraries.i
	

rt		LEA	WaitStr(PC),A4
		LEA	[InBuf-WaitStr](A4),A5
		MOVE.L	$4.W,A6
		LEA	DosName(PC),A1
		MOVEQ	#0,D0
		CALLLIB	OpenLibrary
		TST.L	D0
		BEQ.B	QUIT
		MOVE.L	D0,A6
		CALLLIB	Output
		MOVE.L	D0,D7
		BEQ.B	QUITCloseDOS
WAIT		MOVE.L	D7,D1
		MOVE.L	A4,D2
		MOVEQ	#[InBuf-WaitStr],D3
		CALLLIB	Write
		MOVE.L	#1000000,D2
		MOVE.L	D7,D1				;StdOut
		CALLLIB	WaitForChar
		EORI.B	#1,[RVS-WaitStr](A4)
		TST.L	D0
		BEQ.B	WAIT
		MOVE.L	D7,D1				;StdOut
		MOVE.L	A5,D2
		MOVE.L	#$26,D3
		CALLLIB	Write
		MOVE.L	D7,D1
		MOVE.L	A5,D2
		MOVEQ	#$26,D3
		CALLLIB	Read
QUITCloseDOS	MOVE.L	A6,A1
		MOVE.L	$4.W,A6
		CALLLIB	CloseLibrary
QUIT		MOVEQ	#0,D0
		RTS

DosName	DOSNAME

WaitStr	DC.B	" ",$9B,"4"
RVS	DC.B	'2m Press RETURN! '
	DC.B	$9B,'0m ',$D

InBuf	DC.B	$1B,"M",13
	BLK.B	$22,$20
	DC.B	13
end
================================ cut here ===================================