home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!spool.mu.edu!agate!doc.ic.ac.uk!uknet!warwick!dcs.warwick.ac.uk!leo
- From: leo@dcs.warwick.ac.uk (Leo Hendry)
- Newsgroups: comp.sys.atari.st.tech
- Subject: Re: Extended characters with printf()
- Message-ID: <1992Nov9.112003.25510@dcs.warwick.ac.uk>
- Date: 9 Nov 92 11:20:03 GMT
- References: <HyewTB4w165w@sys6626.bison.mb.ca> <hjv.721232850@groucho.phil.ruu.nl>
- Sender: news@dcs.warwick.ac.uk (Network News)
- Organization: Department of Computer Science, Warwick University, England
- Lines: 38
- Nntp-Posting-Host: stone
-
- In article <hjv.721232850@groucho.phil.ruu.nl> hjv@phil.ruu.nl (Hendrik Jan Veenstra) writes:
- >marco@sys6626.bison.mb.ca (John Perry) writes:
- >
- >>Does anyone know how to use the extended character set with printf()? For
- >>example, how would I go about printing the "arrow" symbol?
- >
- >As far as I know this is not possible. The control-chars (<32 ?) and the 'high'
- >ascii chars (>127 ?) are just 'non-printable characters'.
- >If I'm mistaken (which I surely hope :), let someone please correct me.
-
- Use Bconout(5,chr) to print a non-printable character (5 is the raw conout
- device). To do this from printf write the following:
-
- #include <osbind.h>
-
- #define BUF_SZ something big
-
- int printf(void *wibble)
- {
- char buffer[BUF_SZ], *ptr;
- int len=sprintf(buffer, wibble);
- for (ptr=buffer; *ptr; Bconout(5, *ptr++));
- return len;
- }
-
- Obviously this could be improved, but gives you the general idea (remember \n
- won't work!)
-
- Hope this helps
-
- - Leo
-
- >
- >--
- >Hendrik Jan Veenstra hjv@phil.ruu.nl * How can I save my dreams
- >Dept. of Philosophy * in the nightmare, in the flood
- >University of Utrecht * But I try.
- >The Netherlands *
-