home *** CD-ROM | disk | FTP | other *** search
- { ╔═══╦══════════════════════════════════════════════╦═══╗
- ║ ║ Pascal Library by Scott Wade ║ ║
- ║ ║ 715 FM 1959 Apt 310 ║ ║
- ║ ║ Houston, TX 77034 ║ ║
- ┌──────╨───╨──────────────────────────────────────────────╨───╨──────┐
- │ This group of routines is contributed to public domain, and no │
- │ one can possibly get any commercial value out of them since they │
- │ must be used in other programs. I require that if these are used │
- │ as is in any program, that this banner remain with the source │
- │ code of the program. I would appreciate any comments or sugges- │
- │ tions on improvements, & am curious to hear how these are used. │
- │ You can leave a message for me on these BBS's: │
- │ Ziggy's 821-1391 ScoreBoard 583-7848 │
- │ TBL-COMM 661-9040 Test-Mode 660-9252 │
- └────────────────────────────────────────────────────────────────────┘
-
- ZKEYS.LIB v1.1
- keyboard input reader & type converter library.
- v1.1: 9/27/85 : Zstring, a useless proc, was removed. code was cleaned up
- some. }
-
- procedure ZStripBlanks(var Blankit : Buffer);{
- This strips the leading blanks off of strings so i can convert them to
- real numbers, since the inadequecies of the VAL proc won't allow them.}
- begin
- BlankIt := ' ' + BlankIt ;
- Repeat
- BlankIt := copy( BlankIt ,2, Length(BlankIt)-1)
- Until (copy(BlankIt,1,1) <> ' ');
- end{ StripBlanks };
-
- procedure ZGetKey;
- begin
- Write('Press a key to continue...');
- Repeat Until Keypressed ;
- Writeln;
- end{ ZGetKey };
-
- procedure ZInt(var KeyInt : integer ; PromptLin : Buffer );{
-
- KeyInt is the value keyed in & will be returned to the caller. PromptLin is the
- prompt set right before calling this. The prompt is printed then input is
- called for. If the input is invalid, an errmsg is printed and input is asked
- for again.}
-
- var
- Keystr : Buffer;
- Errf, I : Integer ;
- begin
- REPEAT
- write( PromptLin);
- Readln( KeyStr);
- ZStripBlanks ( KeyStr);
- ErrF := 0;
- Val( KeyStr, KeyInt, ErrF );
- If ErrF > 0 then begin
- For I := 1 to ErrF + Length( PromptLin) - 1 do write(' ');
- writeln( '^ Err - Not Integer! Please try again.');
- end{ If ErrF };
- UNTIL ErrF = 0 ;
- end{ ZInt };
-
- procedure ZReal(var KeyReal : Real ; PromptLin : Buffer );{
- KeyReal is the value keyed in & will be returned to the caller. PromptLin is
- the prompt set right before calling this. The prompt is printed then input
- is called for. If the input is invalid, an errmsg is printed and input is
- asked for again.}
-
- var
- KeyStr : Buffer ;
- Errf, I : Integer ;
- begin
- REPEAT
- write( PromptLin);
- Readln( KeyStr);
- ZStripBlanks( KeyStr);
- ErrF := 0;
- Val( KeyStr, KeyReal, ErrF );
- If ErrF > 0 then begin
- For I := 1 to ErrF + Length( PromptLin) - 1 do write(' ');
- writeln( '^ Err - Not A Real Number! Please try again.');
- end{ If ErrF };
- UNTIL ErrF = 0 ;
- end{ ZReal };
- { end ZKEYS.LIB
- *****************************************************************************}