home *** CD-ROM | disk | FTP | other *** search
- ─ Fido Pascal Conference ────────────────────────────────────────────── PASCAL ─
- Msg : 323 of 474
- From : Mark Ouellet 1:240/20.4 09 Apr 93 20:37
- To : Pat Jankowski
- Subj : Pascal & ANSI
- ────────────────────────────────────────────────────────────────────────────────
- On 05 Apr 93 , you, Pat Jankowski, of 1:280/317.0 wrote...
-
- PJ> How would I get my Pascal program to display ANSI menus? I
- PJ> don't want to fool around with the setforeground and background colors.
- PJ> I would rather have it just display a file. How would I do this?
-
- RULE 1
- if you use the CRT unit anywhere in your main program or if any
- of the units you use use it, then you need to reinstate
- redirectability so that normal screen output goes through DOS
- rather than being handled by TP.
-
- for that add these 4 lines at the start of your program:
-
- Assign(Input, ''); {Reassign Input to Standard Input}
- Assign(OutPut, ''); {Reassign Output to Standard OutPut}
- Reset(Input); {Reopen it for reading}
- Rewrite(OutPut); {Reopen it for writing}
-
- RULE 2
- if you don't use the CRT unit anywhere in your program then you
- might have to add this command to your program:
-
- DirectVideo := False;
-
- I'm not sure about this one, I think it redirects video I/O
- through BIOS rather than DOS or Vice-Versa.
-
-
- RULE 3
- Ansi.sys or an equivalent ANSI driver needs to be present in the
- machine. Either loaded from config.sys if a .SYS file, loaded
- from Autoexec.bat or Config.sys if .COM or .EXE file. (Some
- .EXE/.COM files are actually device drivers loadable from
- config.sys)
-
- That's all there is to it. Just read your menu file as normal text
- and simply write it out to screen. Ansi.sys will take care of the
- rest. If you need to output ANSI colored text from your program
- simply include the ANSI sequence needed in the write string.
-
- Example: To clear the screen simply do a:
-
- write(#27,'[2J');
-
- This writes an <ESC>[2J= Ansi clear screen command.
- <ESCAPE>=(#27)
-
- Best regards,
- Mark Ouellet.
-