Genetic (DNA) Software

SCRWAIT v2.2

General purpose Wait utility for batch files

This utility has been designed to be used in conjunction with batch files displaying 
SCRPAINT designed screens which have been save as ANSI escape sequences and 
redisplayed by typing them in a BATch file.

Parameters.

SCRWAIT parameters have the following format:-

	SCRWAIT -tnnn -i -xn,k1,k2,k3,k4,k5 -xn..... ..... 

-t is followed by the number of 10ths of a second for which to wait before returning an 
exit code of 0.

-i is provided to make SCRWAIT ignore all keystrokes until the timeout value is 
reached.

-x allows for the provision of speceific exit codes for upto 5 specific keys as follows:

The digit n in the -xn, is the required return code, which is then followed by a series 
of  upto 5 key identifiers, specified as follows:

	One of the characters A thru Z, 0 thru 9, ? + and -
	The character strings F0 thru F9
	LEF	LEFt arrow
	RIG	RIGht arrow
	UP	UP arrow
	DOW	DOWn arrow
	HOM	HOMe
	END	END
	PUP	Page UP
	PDO	Page Down
	INS	INSert
	DEL	DELete
	ENT	ENTer
	ESC	ESCape

These strings/characters may be supplied as is, or if they are required to represent 
an Alternate or Control key they may be prefixed with an @ (at sign) for ALT or a ^ 
(carat) for CTL.

The following example requests SCRWAIT to timeout after 10 seconds if no key is 
pressed (in which case the return code will be 0) or to make a return code of 1 if F1 is 
pressed, 2 if Alt-F2 is pressed, 3 if Ctl-F2 is pressed or 4 if the escape or enter key is 
pressed.

	SCRWAIT -t100 -x1,F1 -x2,@F2 -x3,^F2 -x4,ENT,ESC

if -x is not specified then SCRWAIT will return an error level to BATch routines which 
will identify the key that has been pressed or if timed out. The following table shows 
all possible response codes:-

	0	SCRWAIT has timed out

	128	An error has occurred

Any other value indicates a particular key as follows:-

These errorlevel return codes are tabulated below as 1 table for standard ASCII 
characters  up to 137  and then a  second for those key combinations where 138 has 
been added.

^@	0	Space	32	@	64	`	96
^A	1	!	33	A	65	a	97
^B	2	"	34	B	66	b	98
^C	3	#	35	C	67	c	99
^D	4	$	36	D	68	d	100
^E	5	%	37	E	69	e	101
^F	6	&	38	F	70	f	102
^G	7	'	39	G	71	g	103
^H	8	(	40	H	72	h	104
^I	9	)	41	I	73	i	105
^J	10	*	42	J	74	j	106
^K	11	+	43	K	75	k	107
^L	12	,	44	L	76	l	108
^M	13	-	45	M	77	m	109
^N	14	.	46	N	78	n	110
^O	15	/	47	O	79	o	111
^P	16	0	48	P	80	p	112
^Q	17	1	49	Q	81	q	113
^R	18	2	50	R	82	r	114
^S	19	3	51	S	83	s	115
^T	20	4	52	T	84	t	116
^U	21	5	53	U	85	u	117
^V	22	6	54	V	86	v	118
^W	23	7	55	W	87	w	119
^X	24	8	56	X	88	x	120
^Y	25	9	57	Y	89	y	121
^Z	26	:	58	Z	90	z	122
^[	27	;	59	[	91	{	123
^\	28	<	60	\	92	|	124
^]	29	=	61	]	93	}	125
^^	30	>	62	^	94	~	126
^_	31	?	63	_	95		127







This is the table of combinations where 138 has been added.

Alt-A	158	F1	187	Alt-F1	232	Shift-F1	213	^F1	222
Alt-B	176	F2	188	Alt-F2	233	Shift-F2	213	^F2	223
Alt-C	174	F3	189	Alt-F3	234	Shift-F3	214	^F3	224
Alt-D	160	F4	190	Alt-F4	235	Shift-F4	215	^F4	225
Alt-E	146	F5	191	Alt-F5	236	Shift-F5	216	^F5	226
Alt-F	161	F6	192	Alt-F6	237	Shift-F6	217	^F6	227
Alt-G	162	F7	193	Alt-F7	238	Shift-F7	218	^F7	228
Alt-H	163	F8	194	Alt-F8	239	Shift-F8	219	^F8	229
Alt-I	151	F9	195	Alt-F9	240	Shift-F9	220	^F9	230
Alt-J	164	F0	196	Alt-F0	241	Shift-F0	221	^F0	231
Alt-K	165	
Alt-L	166	Home	199	^Home	247	Alt-1	248
Alt-M	178	Up	200			Alt-2	249
Alt-N	177	PgUp	201			Alt-3	250
Alt-O	152	Left	203	^Left	243	Alt-4	251
Alt-P	153	Right	205	^Right	244	Alt-5	252
Alt-Q	144	End	207	^End	245	Alt-6	253
Alt-R	147	Down	208			Alt-7	254
Alt-S	159	PgDn	209			Alt-8	255
Alt-T	148					Alt-9	XXX
Alt-U	150	Ins	210			Alt-0	XXX
Alt-V	175	Del	211
Alt-W	145
Alt-X	173
Alt-Y	149
Alt-Z  172


Bear in mind that the redefinition of these key combinations using ANSI  will cause  
discrepancies.





