AminetAminet
Search:
84782 packages online
About
Recent
Browse
Search
Upload
Setup
Services

util/cli/Return.lha

Mirror:Random
Showing: m68k-amigaos iconppc-amigaos iconppc-morphos iconi386-aros iconi386-amithlon iconppc-warpup iconppc-powerup icongeneric icon
No screenshot available
Short:Wait for return in scripts
Author:Nagilum
Uploader:nagilum chillout org
Type:util/cli
Architecture:m68k-amigaos
Date:1998-02-16
Requires:OS1.2
Distribution:Aminet
Download:util/cli/Return.lha - View contents
Readme:util/cli/Return.readme
Downloads:538

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 ===================================


Contents of util/cli/Return.lha
 PERMSSN    UID  GID    PACKED    SIZE  RATIO     CRC       STAMP          NAME
---------- ----------- ------- ------- ------ ---------- ------------ -------------
-rw-r--r-- 35854/35324     177     220  80.5% -lh5- 3009 Sep 21  1997 Return
-rw-r--r-- 35854/35324     778    1613  48.2% -lh5- ff95 Feb 11  1998 Return.readme
---------- ----------- ------- ------- ------ ---------- ------------ -------------
 Total         2 files     955    1833  52.1%            Feb 15  1998
Page generated in 0.02 seconds
Aminet © 1992-2024 Urban Müller and the Aminet team. Aminet contact address: <aminetaminet net>