home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / os / vms / 17830 < prev    next >
Encoding:
Internet Message Format  |  1992-11-11  |  1.7 KB

  1. Xref: sparky comp.os.vms:17830 comp.lang.c:16374
  2. Path: sparky!uunet!cis.ohio-state.edu!zaphod.mps.ohio-state.edu!wupost!gumby!yale!yale.edu!ira.uka.de!ira.uka.de!gmd.de!Germany.EU.net!mcsun!sunic!seunet!front.se!samuel
  3. From: samuel@front.se
  4. Newsgroups: comp.os.vms,comp.lang.c
  5. Subject: Getting terminal width from VAX-C ?
  6. Message-ID: <1992Nov11.101009.87@front.se>
  7. Date: 11 Nov 92 10:10:09 MET
  8. Keywords: terminal_width
  9. Distribution: world
  10. Organization: Samuel Gustaf Siren
  11. Lines: 26
  12.  
  13. Hello
  14. Does anybody out there know how to get the TERMINAL WIDTH from VAX-C ?
  15. I'm implementing in VAX-C on VMS 5.4.
  16. What I'm trying to do is the following :
  17.  
  18.     width = terminal_width();          /* Get terminal width                 */
  19.     sprintf(buf,"...",...);            /* Write data into buffer             */
  20.     if (strlen(buf) > width)           /* Buffer too long ?                  */
  21.         strcpy(buf+width-3,"...");     /*     ==> 'Truncate' buffer          */
  22.     printf("%s\n",buf);                /* Write [truncated] data to terminal */
  23.  
  24. How do I implement the function "terminal_width()" ?
  25.  
  26. thanx
  27. /SS
  28.  
  29. +----------------------+--------------------------------------+
  30. |                      |        / \                           |
  31. | Samuel Gustaf Siren  |      __!_/_                          |
  32. | SAMUEL@front.se      |    / \ |  / \                        |
  33. |                      |   |/  || | \__oW)----------          |
  34. | All opinions and     |   !! / /\ \                          |
  35. | questions are my     |     / /  \ \                         |
  36. | own /SS              |    //    //                          |
  37. |                      |   /|    ((                           |
  38. +----------------------+--------------------------------------+
  39.