Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!decwrl!ucbvax!husc6!cmcl2!adm!news From: J_SCHULL@acc.haverford.edu (Jonathan Schull) Newsgroups: comp.lang.pascal Subject: The UNDERLINE SOLUTION announced yesterday does not work in a Message-ID: <24422@adm.BRL.MIL> Date: 7 Sep 90 14:44:25 GMT Sender: news@adm.BRL.MIL Lines: 31 function embedded in a writeln statement, for reasons mentioned in one of the postings--the function (which manipulated TextColor and TextBackground) is evaluated and executed before ANY of the writing happens. The following trick (suggested by a list member whose name I've lost) DOES work, but requires ANSI.SYS (Turbo's CRT unit is NOT needed). function UNDERLINE (s: string): string; begin UNDERLINE := #27 + '[4m' + s + #27 + '[0m'; end; {UNDERLINE} begin writeln('This is ',UNDERLINE('underlined!'),' This isnt'); writeln('It requires ANSI.SYS') end. =================================================================== One can also declare two constants, as follows const Uon=#27 + '[4m'; const Uoff=#27 + '[0m'; begin writeln('This is another way of ',UON,'underlining',UOFF,' using constants.'); writeln('It requires ANSI.SYS') end. I haven't tried implementing the writing-to-video-memory approach (and probably won't....).