home *** CD-ROM | disk | FTP | other *** search
- Date: 19 Mar 92 23:26:00 From: Joe Fischer
- To: Michael Arnett Subj: ANSI CONSOLE DEVICE WRITES
-
- Hi:
- I guess maybe my message about Ansi Console device
- writes in BASIC and Pascal passed yours on another network.
- The Console needs to be opened as a device to write
- Ansi through DOS ANSI.SYS in most languages because the
- high level languages usually do direct screen writes
- for speed.
- The name Mnemonic for Console may be different even
- in different versions of the same language.
- Here is a sample program in BASIC if any echo users
- want to try it, but the word "CONS:" may have to be
- changed according to the manual for the version being
- used.
-
- 10 CLS
- 20 OPEN "CONS:" AS #1
- 30 A$ = CHR$(27) + "[34m Does it work?"
- 40 PRINT #1, A$
- 60 A$ = CHR$(27) + "[32m Does it work?"
- 70 PRINT #1, A$
- 80 A$ = CHR$(27) + "[36;43;1m Does it work?"
- 85 PRINT #1, A$
- 90 A$ = CHR$(27) + "[20;40H IT DOES work?"
- 99 PINT #1, A$
- 100 PRINT:PRINT:PRINT
- 120 A$ = CHR$(27) + "[37;40;0m Yes, it works!!!!!!!!"
- 160 PRINT #1, A$
-
- The same thing works in Pascal 4.0 and up using
- the word CON instead of CONS: but in Turbo Pascal 3.0
- a compiler directive {$P } must be inserted in the
- line above Program [name];
- I hope everyone has fun with this,
-
- Joe Fischer
-
- .ORIGIN: 001/030 - ░░▒▒▓█ THE GAVEL █▓▒▒░░ * RES IPSA * HST-DS * HOUSTON
-