home *** CD-ROM | disk | FTP | other *** search
- .pa
- GENERAL UTILITIES AND CRT CONTROL
-
- These general utilities should work on whatever system you have (as long
- as it is basically IBM compatible or an HP-1000). However, all of the
- CRT control procedures will only work on PCs with a monochrome or color
- graphics adaptor (CGA) or compatible, HP-26XX, or Tektronix 4XXX
- terminals.
-
- None of the CRT control procedures will work on a PC in 40 column mode.
- I did this intentionally because it looks too much like BASIC. I
- couldn't bare the thought of any of my software running in BASIC. In
- fact, I intentionally change the data offset register so as to croak
- BASIC.
- .pa
- QUICK LIST OF GENERAL UTILITIES AND CRT CONTROL
-
- ADATE: fetch the date
- ATIME: fetch the time of day
- BEEP: beep
- CLEAR1: clear one line on the CRT and move cursor to column 1
- CPU: fetch the time (also see SECNDS)
- ERASE: clear the CRT
- FFPRN: send a form-feed to the printer
- FTIME: fetch character string indicating date and time
- IFBRK: detect keyboard interrupt (if-break)
- PAUSE: display message and wait for any keystroke
- PRT1C: send 1 character to the printer
- READ1: read 1 character from the keyboard - don't wait for RETURN
- SECNDS: fetch the time (also see CPU)
- UP1LIN: move the cursor up 1 line on the CRT
- WRPRN: print a character string
- WRTTY: write a character string on the CRT
- READC: read a string from the keyboard
- .pa
- NAME: ADATE
- PURPOSE: fetch the date
- TYPE: subroutine (far external)
- SYNTAX: CALL ADATE(MONTH,IDAY,IYEAR)
- INPUT: none
- OUTPUT: MONTH (INTEGER*2) month
- IDAY (INTEGER*2) day of the month
- IYEAR (INTEGER*2) year 1986, 1987, etc.
-
-
- NAME: ATIME
- PURPOSE: fetch the time of day
- TYPE: subroutine (far external)
- SYNTAX: CALL ATIME(IHOUR,MIN,ISEC,IHUN)
- INPUT: none
- OUTPUT: IHOUR (INTEGER*2) hours in military time
- MIN (INTEGER*2) minutes
- ISEC (INTEGER*2) seconds
- IHUN (INTEGER*2) hundredths of seconds
-
-
- NAME: BEEP
- PURPOSE: beep
- TYPE: subroutine (far external)
- SYNTAX: CALL BEEP
- INPUT: none
- OUTPUT: none
-
-
- NAME: CLEAR1
- PURPOSE: clear one line on the CRT and move cursor to column 1
- TYPE: subroutine (far external)
- SYNTAX: CALL CLEAR1
- INPUT: none
- OUTPUT: none
-
-
- NAME: CPU
- PURPOSE: fetch the time
- TYPE: subroutine (far external)
- SYNTAX: CALL CPU(SEC)
- INPUT: none
- OUTPUT: SEC (REAL*4) seconds
- NOTE: on the PC this returns the elapsed time since midnight
- on the HP-1000F this returns cumulative session CPU
- this is useful for computing runtimes
- also see SECNDS
-
-
- NAME: ERASE
- PURPOSE: clear the CRT
- TYPE: subroutine (far external)
- SYNTAX: CALL ERASE
- INPUT: none
- OUTPUT: none
-
-
- NAME: FFPRN
- PURPOSE: send a form-feed to the printer
- TYPE: subroutine (far external)
- SYNTAX: CALL FFPRN
- INPUT: none
- OUTPUT: none
-
-
- NAME: FTIME
- PURPOSE: fetch character string indicating date and time
- TYPE: subroutine (far external)
- SYNTAX: CALL FTIME(DATE)
- INPUT: none
- OUTPUT: DATE (CHARACTER*30)
-
-
- NAME: IFBRK
- PURPOSE: detect keyboard interrupt (if-break)
- TYPE: LOGICAL*2 function (far external)
- SYNTAX: IF(IFBRK(0)) GO TO 100
- INPUT: none
- OUTPUT: none
- NOTE: you must pass a dummy parameter "0" so FORTRAN will generate
- the proper calling sequence
-
-
- NAME: PAUSE
- PURPOSE: display the message "hit the SPACE BAR to continue" and wait
- for any keystroke
- TYPE: subroutine (far external)
- SYNTAX: CALL PAUSE
- INPUT: none
- OUTPUT: none
- NOTE: you may want to follow this with CALL CLEAR1 to erase the line
-
-
- NAME: PRT1C
- PURPOSE: send 1 character to the printer (bypasses DOS)
- TYPE: subroutine (far external)
- SYNTAX: CALL PRT1C('a') or CALL PRT1C(CHAR(13))
- INPUT: one CHARACTER*1 variable
- OUTPUT: none
- NOTE: if you want to print a string use WRPRN
-
-
- NAME: READ1
- PURPOSE: read 1 character from the keyboard - don't wait for RETURN
- TYPE: subroutine (far external)
- SYNTAX: CALL READ1(ANS)
- INPUT: none
- OUTPUT: ANS (CHARACTER*1)
- NOTE: this is very handy for creating menus - also it is impossible
- to do in FORTRAN (READ1 is in assembler)
-
-
- NAME: SECNDS
- PURPOSE: fetch the time
- TYPE: REAL*4 function (far external)
- SYNTAX: T=SECNDS(0.) or T=SECNDS(T0)
- INPUT: T0 (REAL*4) offset time
- OUTPUT: seconds since midnight (REAL*4)
- NOTE: this is for compatibility with DEC machines
- also see CPU
-
-
- NAME: UP1LIN
- PURPOSE: move the cursor up 1 line on the CRT
- TYPE: subroutine (far external)
- SYNTAX: CALL UP1LIN
- INPUT: none
- OUTPUT: none
- NOTE: there is no way to do this in FORTRAN on the PC
- (UP1LIN is in assembler)
-
-
- NAME: WRPRN
- PURPOSE: print a character string
- TYPE: subroutine (far external)
- SYNTAX: CALL WRPRN('print this string<')
- INPUT: a character string (CHARACTER*? , it doesn't matter)
- OUTPUT: none
- NOTE: this bypasses DOS (which is often advantageous)
-
- CALL WRPRN('this is only a test_')
- CALL WRPRN(' for the next 60 seconds<')
-
- the above 2 lines will print on the same line as...
-
- this is only a test for the next 60 seconds
-
- The "_" tells WRPRN to not follow the string with a
- carriage return (CR) and line feed (LF) while the "<"
- does indicate this. Neither the "_" nor the "<" will
- actually be printed.
-
- If you want to change the symbols "_" and "<" to say
- "+" and "." use the following...
-
- CALL WRPRN('_+.this is only a test+')
- CALL WRPRN('_+.for the next 60 seconds.')
-
- Of course, in this case you can't print a "+" or a "."
- so you could use CHAR(0) and CHAR(13) instead. Beginning
- a string with a "_" tells WRPRN that the next 2 characters
- are to replace the "_" and "<" characters.
-
- Also see WRTTY.
-
- In case you are wondering why I wrote this, it's because some
- misguided persons at DEC and Microsoft had this bizarre idea
- that one should put some stupid character like "\" or "$" at
- the end of a format to suppress a carriage control, while the
- whole rest of the world uses "_" at the end of a string.
- If anyone out there knows, please tell me what comes over
- these people who do weird things like this?
-
- WARNING: should you forget to end the string with a proper terminator
- (e.g. "_" or "<") WRPRN will just continue indefinitely until
- it finds one or your system crashes...
-
-
- NAME: WRTTY
- PURPOSE: write a character string on the CRT
- TYPE: subroutine (far external)
- SYNTAX: CALL WRTTY('display this string<')
- INPUT: a character string (CHARACTER*? , it doesn't matter)
- OUTPUT: none
- NOTE: This bypasses DOS (which is often advantageous) AND the BIOS
- (which is also often advantageous) and pushes your string
- directly into the display memory (as a result Ctrl-PrtSc will
- not even see it). This is VERY much faster than DOS (which is
- often painfully slow) and the BIOS (which isn't any better).
- On the HP this goes directly to the OPSYS, not the FORTRAN I/O
- handler.
-
- For notes on how to use WRTTY see WRPRN.
-
-
- NAME: READC
- PURPOSE: read a string from the keyboard
- TYPE: subroutine (far external)
- SYNTAX: CALL READC(CBUF,NBUF,IERR)
- INPUT: NBUF (INTEGER*2) maximum number of characters to be read
- OUTPUT: CBUF (CHARACTER*1 CBUF(NBUF) or CHARACTER*80 CBUF, NBUF=80)
- IERR (INTEGER*2) error return indicator (IERR=0 is normal)
- NOTE: This bypasses DOS (which is often advantageous). On the HP
- this goes directly to the OPSYS.