home *** CD-ROM | disk | FTP | other *** search
/ ftp.whtech.com / ftp.whtech.com.tar / ftp.whtech.com / club100 / ref / titles.doc < prev    next >
Text File  |  2006-10-19  |  1KB  |  48 lines

  1.  
  2.        JUSTIFYING SCREEN TITLES
  3.  
  4.           by Richard Hanson
  5.  
  6.                22-Feb-88
  7.  
  8.  
  9. There are times when you will want to justify screen titles either left, 
  10. center, right or all three; or whatever combination you wish.  The following 
  11. is a collection of algorhythms that will accomplish these tasks:
  12.  
  13. Start by placing your information into variables:
  14.  
  15. 10 A$="left"
  16. 20 B$="center"
  17. 30 C$="right"
  18.  
  19. Example of left, center, right justifying:
  20.  
  21. 40 PRINTA$
  22. 50 PRINTTAB((40-LEN(B$))/2)B$
  23. 60 PRINTTAB(40-LEN(C$))C$
  24.  
  25. Example of testing the combined length of all variables to be printed on one 
  26. line:
  27.  
  28. 70 IFLEN(A$+B$+C$)>=40THEN ...an error should be displayed here, and control 
  29. returned to the point of input for A$, B$ & C$.
  30.  
  31. Example of printing all three justifications on one line:
  32.  
  33. 80 D1=((40-LEN(B$))/2)-LEN(A$)
  34. 90 D2=40-(LEN(A$+B$+C$)+D1)
  35. 100 PRINTD1;D2
  36. 110 PRINTA$SPACE$(D1)B$SPACE$(D2)C$
  37.  
  38.  
  39. The above examples were developed with screen printing in mind, i.e., to the 
  40. Model 100, 102 or 200's 40 character display.  To drive a printout just change
  41. the 40 to the width of your printed page (60, 75, 80 ...whatever) or make it 
  42. an input variable.
  43.  
  44. These instructions are off-the-head, and I'm sure there are other ways to 
  45. accomplish the same tasks -- feedback is welcome.
  46.  
  47. <END>
  48.