home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / sys / atari / st / tech / 5543 < prev    next >
Encoding:
Text File  |  1992-11-09  |  1.7 KB  |  51 lines

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