home *** CD-ROM | disk | FTP | other *** search
/ Boston 2 / boston-2.iso / WINDOWS / TOOLS / FCG / INV.PRG < prev    next >
Text File  |  1993-12-01  |  41KB  |  917 lines

  1. * This is the modified program for INV.FCG. The query statements have been
  2. * added manually in this program. The comments describe the changes that have
  3. * been added. All changes are in lower case. This file gets included in
  4. * INV.PRG each time INV.PRG is generated.
  5. *
  6. * NOTE: This form only uses the COURIER 10 and 12 point fonts to make it
  7. * portable to several different LaserJet printers.
  8. *
  9. SET TALK OFF
  10. SET CONSOLE OFF
  11. * The following line makes all procedures in this file accesible to the main
  12. * program. This line is not necessary for some systems (For example FoxPro).
  13. SET PROCEDURE TO INV
  14. DO FCGINIT
  15. SET PRINT ON
  16. DO FCGSTART WITH 1, 0, 2, 4, 300
  17.  
  18. select 1
  19. use custmers
  20. * The next 2 lines create index file specifically for your system (dBASE, Fox,
  21. * etc). We did not create the index file to make this program portable.
  22. set safety off
  23. index on cust_num to cust_num
  24. select 2
  25. use orders
  26. set relation to cust_num into custmers
  27.  
  28. DO WHILE .not. eof()
  29.     DO FCGFIXOBJ
  30. *   Code for printing table 0.
  31.     FCGTBROW = 0
  32.     mTOTAL = 0
  33.     mCUSTNUM = cust_num
  34.     DO WHILE cust_num = mCUSTNUM
  35.         DO FCGTBRW0 WITH FCGTBROW
  36. *       Do all variable assigmnent, file pointer movement, etc, here.
  37.         FCGTBROW = FCGTBROW + 1
  38.         mTOTAL = mTOTAL + cost
  39.         skip
  40.     ENDDO
  41. *   Make sure all totals fields are up to date at this point
  42.     mAPPREC = "We apraciate our customers!"
  43.     if (mTOTAL > 500)
  44.         mAPPREC = "You are one of our very special customers!!"
  45.     endif
  46.     if (mTOTAL > 1000)
  47.         mAPPREC = "You are one of our best customer!!!"
  48.     endif
  49.     DO FCGTBEN0
  50. *   back up to customer that we were working with so far
  51.     skip -1
  52.     DO FCGVAROBJ
  53.     skip
  54. *   Do all variable re-assignments, file pointer movements, etc, here.
  55.     ?? chr(12)
  56. ENDDO
  57. DO FCGEND
  58. SET PRINT OFF
  59. SET CONSOLE ON
  60. RETURN
  61.  
  62. * Following are all the program procedures. This is the fixed part of the
  63. * program so do not modify it. Changes will be lost when code is re-generated.
  64.  
  65. PROCEDURE FCGINIT
  66. PUBLIC FCGEXTVAR, FCGGTOVAR, FCGMOVVAR
  67. PUBLIC FCGFNT1S, FCGFNT1L, FCGFNT1U, FCGFNT1H, FCGFNT1F
  68. PUBLIC FCGFNT2S
  69. PUBLIC FCGFNT3S, FCGFNT3L, FCGFNT3U, FCGFNT3H, FCGFNT3F
  70. FCGFNT1S = "(0N(s3t0b0s10.00v12.00h0P*p0X*p32Y"
  71. FCGFNT1H = 14
  72. FCGFNT1F = 32
  73. FCGFNT1L = ""
  74. FCGFNT1L = FCGFNT1L+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)
  75. FCGFNT1L = FCGFNT1L+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)
  76. FCGFNT1L = FCGFNT1L+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)
  77. FCGFNT1L = FCGFNT1L+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)
  78. FCGFNT1L = FCGFNT1L+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)
  79. FCGFNT1L = FCGFNT1L+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)
  80. FCGFNT1L = FCGFNT1L+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)
  81. FCGFNT1L = FCGFNT1L+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)
  82. FCGFNT1L = FCGFNT1L+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)
  83. FCGFNT1L = FCGFNT1L+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)
  84. FCGFNT1L = FCGFNT1L+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)
  85. FCGFNT1L = FCGFNT1L+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)
  86. FCGFNT1L = FCGFNT1L+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)
  87. FCGFNT1L = FCGFNT1L+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)
  88. FCGFNT1L = FCGFNT1L+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)
  89. FCGFNT1L = FCGFNT1L+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)
  90. FCGFNT1L = FCGFNT1L+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)
  91. FCGFNT1L = FCGFNT1L+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)
  92. FCGFNT1L = FCGFNT1L+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)
  93. FCGFNT1L = FCGFNT1L+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)
  94. FCGFNT1L = FCGFNT1L+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)
  95. FCGFNT1L = FCGFNT1L+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)
  96. FCGFNT1L = FCGFNT1L+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)
  97. FCGFNT1L = FCGFNT1L+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)
  98. FCGFNT1L = FCGFNT1L+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)
  99. FCGFNT1L = FCGFNT1L+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)
  100. FCGFNT1L = FCGFNT1L+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)
  101. FCGFNT1L = FCGFNT1L+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)
  102. FCGFNT1L = FCGFNT1L+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)
  103. FCGFNT1L = FCGFNT1L+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)
  104. FCGFNT1L = FCGFNT1L+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)
  105. FCGFNT1L = FCGFNT1L+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)+chr(83)
  106. FCGFNT1U = ""
  107. FCGFNT1U = FCGFNT1U+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)
  108. FCGFNT1U = FCGFNT1U+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)
  109. FCGFNT1U = FCGFNT1U+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)
  110. FCGFNT1U = FCGFNT1U+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)
  111. FCGFNT1U = FCGFNT1U+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)
  112. FCGFNT1U = FCGFNT1U+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)
  113. FCGFNT1U = FCGFNT1U+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)
  114. FCGFNT1U = FCGFNT1U+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)
  115. FCGFNT1U = FCGFNT1U+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)
  116. FCGFNT1U = FCGFNT1U+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)
  117. FCGFNT1U = FCGFNT1U+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)
  118. FCGFNT1U = FCGFNT1U+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)
  119. FCGFNT1U = FCGFNT1U+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)
  120. FCGFNT1U = FCGFNT1U+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)
  121. FCGFNT1U = FCGFNT1U+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)
  122. FCGFNT1U = FCGFNT1U+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)
  123. FCGFNT1U = FCGFNT1U+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)
  124. FCGFNT1U = FCGFNT1U+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)
  125. FCGFNT1U = FCGFNT1U+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)
  126. FCGFNT1U = FCGFNT1U+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)
  127. FCGFNT1U = FCGFNT1U+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)
  128. FCGFNT1U = FCGFNT1U+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)
  129. FCGFNT1U = FCGFNT1U+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)
  130. FCGFNT1U = FCGFNT1U+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)
  131. FCGFNT1U = FCGFNT1U+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)
  132. FCGFNT1U = FCGFNT1U+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)
  133. FCGFNT1U = FCGFNT1U+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)
  134. FCGFNT1U = FCGFNT1U+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)
  135. FCGFNT1U = FCGFNT1U+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)
  136. FCGFNT1U = FCGFNT1U+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)
  137. FCGFNT1U = FCGFNT1U+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)
  138. FCGFNT1U = FCGFNT1U+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)
  139. FCGFNT2S = "(0N(s3t0b0s12.00v10.00h0P*p0X*p37Y"
  140. FCGFNT3S = "(0N(s3t1b0s12.00v10.00h0P*p0X"
  141. FCGFNT3H = 17
  142. FCGFNT3F = 32
  143. FCGFNT3L = ""
  144. FCGFNT3L = FCGFNT3L+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)
  145. FCGFNT3L = FCGFNT3L+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)
  146. FCGFNT3L = FCGFNT3L+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)
  147. FCGFNT3L = FCGFNT3L+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)
  148. FCGFNT3L = FCGFNT3L+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)
  149. FCGFNT3L = FCGFNT3L+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)
  150. FCGFNT3L = FCGFNT3L+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)
  151. FCGFNT3L = FCGFNT3L+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)
  152. FCGFNT3L = FCGFNT3L+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)
  153. FCGFNT3L = FCGFNT3L+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)
  154. FCGFNT3L = FCGFNT3L+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)
  155. FCGFNT3L = FCGFNT3L+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)
  156. FCGFNT3L = FCGFNT3L+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)
  157. FCGFNT3L = FCGFNT3L+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)
  158. FCGFNT3L = FCGFNT3L+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)
  159. FCGFNT3L = FCGFNT3L+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)
  160. FCGFNT3L = FCGFNT3L+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)
  161. FCGFNT3L = FCGFNT3L+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)
  162. FCGFNT3L = FCGFNT3L+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)
  163. FCGFNT3L = FCGFNT3L+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)
  164. FCGFNT3L = FCGFNT3L+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)
  165. FCGFNT3L = FCGFNT3L+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)
  166. FCGFNT3L = FCGFNT3L+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)
  167. FCGFNT3L = FCGFNT3L+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)
  168. FCGFNT3L = FCGFNT3L+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)
  169. FCGFNT3L = FCGFNT3L+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)
  170. FCGFNT3L = FCGFNT3L+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)
  171. FCGFNT3L = FCGFNT3L+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)
  172. FCGFNT3L = FCGFNT3L+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)
  173. FCGFNT3L = FCGFNT3L+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)
  174. FCGFNT3L = FCGFNT3L+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)
  175. FCGFNT3L = FCGFNT3L+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)+chr(100)
  176. FCGFNT3U = ""
  177. FCGFNT3U = FCGFNT3U+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)
  178. FCGFNT3U = FCGFNT3U+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)
  179. FCGFNT3U = FCGFNT3U+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)
  180. FCGFNT3U = FCGFNT3U+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)
  181. FCGFNT3U = FCGFNT3U+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)
  182. FCGFNT3U = FCGFNT3U+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)
  183. FCGFNT3U = FCGFNT3U+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)
  184. FCGFNT3U = FCGFNT3U+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)
  185. FCGFNT3U = FCGFNT3U+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)
  186. FCGFNT3U = FCGFNT3U+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)
  187. FCGFNT3U = FCGFNT3U+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)
  188. FCGFNT3U = FCGFNT3U+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)
  189. FCGFNT3U = FCGFNT3U+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)
  190. FCGFNT3U = FCGFNT3U+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)
  191. FCGFNT3U = FCGFNT3U+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)
  192. FCGFNT3U = FCGFNT3U+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)
  193. FCGFNT3U = FCGFNT3U+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)
  194. FCGFNT3U = FCGFNT3U+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)
  195. FCGFNT3U = FCGFNT3U+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)
  196. FCGFNT3U = FCGFNT3U+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)
  197. FCGFNT3U = FCGFNT3U+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)
  198. FCGFNT3U = FCGFNT3U+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)
  199. FCGFNT3U = FCGFNT3U+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)
  200. FCGFNT3U = FCGFNT3U+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)
  201. FCGFNT3U = FCGFNT3U+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)
  202. FCGFNT3U = FCGFNT3U+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)
  203. FCGFNT3U = FCGFNT3U+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)
  204. FCGFNT3U = FCGFNT3U+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)
  205. FCGFNT3U = FCGFNT3U+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)
  206. FCGFNT3U = FCGFNT3U+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)
  207. FCGFNT3U = FCGFNT3U+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)
  208. FCGFNT3U = FCGFNT3U+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)+chr(1)
  209. RETURN
  210.  
  211. PROCEDURE FCGFIXOBJ
  212. DO FCGBOX WITH 50, 50, 800, 150, 1, 2, 20, 1, 0
  213. DO FCGBOX WITH 100, 70, 330, 130, 1, 1, 0, 0, 1
  214. DO FCGLTXT WITH FCGFNT2S, 145, 86, "Micronix Inc.,", ;
  215.     0, 0
  216. DO FCGLTXT WITH FCGFNT2S, 145, 103, "P.O.Box 40081,", ;
  217.     0, 0
  218. DO FCGLTXT WITH FCGFNT2S, 105, 120, "Indianapolis, IN 46240", ;
  219.     0, 0
  220. DO FCGBOX WITH 590, 80, 760, 120, 1, 0, 0, 0, 0
  221. DO FCGLTXT WITH FCGFNT2S, 640, 103, "INVOICE", ;
  222.     1, 0
  223. DO FCGBOX WITH 190, 185, 260, 205, 1, 4, 0, 0, 0
  224. DO FCGBOX WITH 50, 185, 190, 205, 1, 4, 0, 0, 0
  225. DO FCGLTXT WITH FCGFNT1S, 52, 199, "Customer Number:", ;
  226.     0, 0
  227. DO FCGBOX WITH 100, 245, 380, 335, 2, 4, 0, 0, 1
  228. DO FCGBOX WITH 108, 268, 368, 282, 0, 4, 0, 0, 0
  229. DO FCGBOX WITH 108, 282, 368, 296, 0, 4, 0, 0, 0
  230. DO FCGBOX WITH 108, 254, 368, 268, 0, 4, 0, 0, 0
  231. DO FCGBOX WITH 108, 296, 368, 310, 0, 4, 0, 0, 0
  232. DO FCGBOX WITH 108, 310, 264, 324, 0, 4, 0, 0, 0
  233. DO FCGBOX WITH 264, 310, 290, 324, 0, 4, 0, 0, 0
  234. DO FCGBOX WITH 290, 310, 368, 324, 0, 4, 0, 0, 0
  235. DO FCGBOX WITH 100, 225, 240, 240, 1, 4, 0, 0, 0
  236. DO FCGLTXT WITH FCGFNT1S, 102, 236, "Invoice Address:", ;
  237.     0, 0
  238. DO FCGBOX WITH 465, 250, 745, 340, 2, 4, 0, 0, 1
  239. DO FCGBOX WITH 473, 273, 733, 287, 0, 4, 0, 0, 0
  240. DO FCGBOX WITH 473, 287, 733, 301, 0, 4, 0, 0, 0
  241. DO FCGBOX WITH 473, 259, 733, 273, 0, 4, 0, 0, 0
  242. DO FCGBOX WITH 473, 301, 733, 315, 0, 4, 0, 0, 0
  243. DO FCGBOX WITH 473, 315, 629, 329, 0, 4, 0, 0, 0
  244. DO FCGBOX WITH 629, 315, 655, 329, 0, 4, 0, 0, 0
  245. DO FCGBOX WITH 655, 315, 733, 329, 0, 4, 0, 0, 0
  246. DO FCGBOX WITH 465, 230, 580, 245, 1, 4, 0, 0, 0
  247. DO FCGLTXT WITH FCGFNT1S, 467, 241, "Ship Address:", ;
  248.     0, 0
  249. DO FCGRECT WITH 50, 427, 800, 476, 0, 0, 0
  250. DO FCGLTXT WITH FCGFNT3S, 220, 455, ;
  251.     "Description of Products/Services and Cost", 1, 0
  252. DO FCGRECT WITH 50, 480, 800, 529, 0, 4, 0
  253. DO FCGLTXT WITH FCGFNT3S, 67, 508, ;
  254.     "Date", 0, 0
  255. DO FCGLTXT WITH FCGFNT3S, 325, 508, ;
  256.     "Product Description", 0, 0
  257. DO FCGLTXT WITH FCGFNT3S, 738, 508, ;
  258.     "Cost", 0, 0
  259. DO FCGRECT WITH 50, 580, 800, 626, 0, 2, 10
  260. DO FCGRECT WITH 50, 673, 800, 718, 0, 2, 10
  261. DO FCGRECT WITH 50, 765, 800, 810, 0, 2, 10
  262. DO FCGRECT WITH 50, 814, 800, 863, 0, 4, 0
  263. DO FCGLINE WITH 50, 425, 800, 425, 3
  264. DO FCGLINE WITH 50, 865, 800, 865, 3
  265. DO FCGLINE WITH 50, 478, 800, 478, 3
  266. DO FCGLINE WITH 50, 531, 800, 531, 3
  267. DO FCGLINE WITH 50, 812, 800, 812, 3
  268. DO FCGLINE WITH 125, 477, 125, 866, 1
  269. DO FCGLINE WITH 715, 477, 715, 866, 1
  270. DO FCGBOX WITH 120, 925, 730, 975, 1, 4, 0, 0, 0
  271. RETURN
  272.  
  273. PROCEDURE FCGVAROBJ
  274. DO FCGLTXT WITH FCGFNT3S, 192, 198, CUSTMERS->CUST_NUM, 0, 0
  275. DO FCGLTXT WITH FCGFNT1S, 110, 279, rtrim(CUSTMERS->FNAME)+" "+CUSTMERS->LNAME, 0, 0
  276. DO FCGLTXT WITH FCGFNT1S, 110, 293, CUSTMERS->I_STREET1, 0, 0
  277. DO FCGLTXT WITH FCGFNT1S, 110, 265, CUSTMERS->COMPANY, 0, 0
  278. DO FCGLTXT WITH FCGFNT1S, 110, 307, CUSTMERS->I_STRETT2, 0, 0
  279. DO FCGLTXT WITH FCGFNT1S, 110, 321, CUSTMERS->I_CITY, 0, 0
  280. DO FCGLTXT WITH FCGFNT1S, 266, 321, CUSTMERS->I_STATE, 0, 0
  281. DO FCGLTXT WITH FCGFNT1S, 292, 321, CUSTMERS->I_ZIP, 0, 0
  282. DO FCGLTXT WITH FCGFNT1S, 475, 284, rtrim(CUSTMERS->FNAME)+" "+CUSTMERS->LNAME, 0, 0
  283. DO FCGLTXT WITH FCGFNT1S, 475, 298, CUSTMERS->S_STREET1, 0, 0
  284. DO FCGLTXT WITH FCGFNT1S, 475, 270, CUSTMERS->COMPANY, 0, 0
  285. DO FCGLTXT WITH FCGFNT1S, 475, 312, CUSTMERS->S_STREET2, 0, 0
  286. DO FCGLTXT WITH FCGFNT1S, 475, 326, CUSTMERS->S_CITY, 0, 0
  287. DO FCGLTXT WITH FCGFNT1S, 631, 326, CUSTMERS->S_STATE, 0, 0
  288. DO FCGLTXT WITH FCGFNT1S, 657, 326, CUSTMERS->S_ZIP, 0, 0
  289. DO FCGCTXT WITH FCGFNT1S, 425, 954, mAPPREC, 0, 0, FCGFNT1L, FCGFNT1U, FCGFNT1F
  290. RETURN
  291.  
  292.  
  293. PROCEDURE FCGTBRW0
  294. PARAMETERS FCGTBROW
  295. FCGROWOFF = FCGTBROW * 46 + 560
  296. FCGROWOFF = FCGROWOFF + MIN(FCGTBROW+1,2)
  297. DO FCGLTXT WITH FCGFNT1S, 55, FCGROWOFF, dtoc(ORDERS->DATE), 0, 0
  298. FCGROWOFF = FCGTBROW * 46 + 560
  299. FCGROWOFF = FCGROWOFF + MIN(FCGTBROW+1,2)
  300. DO FCGLTXT WITH FCGFNT1S, 146, FCGROWOFF, ORDERS->ITEM, 0, 0
  301. FCGROWOFF = FCGTBROW * 46 + 560
  302. FCGROWOFF = FCGROWOFF + MIN(FCGTBROW+1,2)
  303. DO FCGRTXT WITH FCGFNT1S, 795, FCGROWOFF, str(ORDERS->COST,7,2), 0, 0, FCGFNT1L, FCGFNT1U, FCGFNT1F
  304. RETURN
  305.  
  306. PROCEDURE FCGTBEN0
  307. DO FCGRTXT WITH FCGFNT3S, 795, 840, str(mTOTAL,7,2), 0, 0, FCGFNT3L, FCGFNT3U, FCGFNT3F
  308. RETURN
  309.  
  310. * The following procedures have been appended from file PCLDRV.PRG.
  311.  
  312. *****************************************************************************
  313. *   This file contains all the printer driver routines. These routines
  314. *   are called by the functions that FormCode/Gen generates for your design
  315. *   namely FCGFIXOBJ, FIXVAROBJ, etc. There are two ways these routines can
  316. *   be made accesible to these procedures:
  317. *       1) By appending them to the file that contains the generated code.
  318. *          FormCode/Gen does this for you if you select the Append Procedures
  319. *          From PCLDRV option from the Page Setup dialog box.
  320. *       2) By making these routines accesible to the generated procedures by
  321. *          issuing a SET PROCEDURE TO. This is what FormCode/Gen does if you
  322. *          do not check the Append Procedures From PCLDRV check box.
  323. *
  324. *   NOTE: The routines in this library can be called directly by code that you
  325. *   write yourself also. To do this, make sure you call FCGSTART before any
  326. *   other routines and call FCGEND after printing is done. You will also
  327. *   need to declare the following global variables (use the PUBLIC statement):
  328. *       FCGRSTVAR, FCGGTOVAR, FCGLINVAR, FCGRCTVAR, FCGMOVVAR, FCGEXTVAR
  329. *  The best way to hand write code is to use generated code as a starting point.
  330. *****************************************************************************
  331.  
  332. *****************************************************************************
  333. *   Function: Initializes printer and sets up job paramets. Must be called
  334. *          before the start of a job
  335. *   Parameters: fcgcopies - (numeric) number of copies (1-99)
  336. *           fcgorient - (numeric) sheet orientation. 0 means portrait,
  337. *                one means landscape
  338. *        fcgsize - (numeric) paper size. Must be one of the following:
  339. *            1 for Executive Size (7 1/4 x 10 1/2 in)
  340. *            2 for Letter Size (8 1/2 x 11 in)
  341. *            3 for Legal Size (8 1/2 x 14 in)
  342. *               26 for A4 Size (210mm x 297mm)
  343. *               80 for Monarch Size Envelope (3 7/8 x 7 1/2 in)
  344. *               81 for COM 10 Size Envelope (4 1/8 x 9 1/2 in)
  345. *               90 for DL Size Envelope (110mm x 220mm)
  346. *               91 for C5 Size Envelope (162mm 229mm)
  347. *        fcgbin - (numeric) paper bin to use. Must be one of the following:
  348. *            1 for Upper Tray
  349. *            2 for Manual Feed
  350. *            3 for Manual Envelope Feed
  351. *            4 for Lower Tray
  352. *            5 for Paper Deck
  353. *            6 for Envelope Feeder
  354. *        fcgres - (numeric) Raster Graphics Resolution (Dots Per Inch)
  355. *            Must be one of the following values:
  356. *            75, 100, 150, 300
  357. *****************************************************************************
  358. procedure fcgstart
  359. parameters fcgcopies,fcgorient,fcgsize,fcgbin,fcgres
  360.  
  361. ?? chr(27)+"E"+chr(27)+"&l"+ltrim(str(fcgcopies))+"x"+ ;
  362.    ltrim(str(fcgorient))+"o"+ltrim(str(fcgsize))+"a4d1e42f"+ ;
  363.    ltrim(str(fcgbin))+"h"+ltrim(str(fcgres))+"R"
  364. ?? chr(27)+"*v1O"
  365. return
  366.  
  367.  
  368. *****************************************************************************
  369. *   Function: End the job by resetting the printer.
  370. *****************************************************************************
  371. procedure fcgend
  372. ?? chr(27)+"E"
  373. return
  374.  
  375.  
  376. *****************************************************************************
  377. *   Function: Sets the public variable FCGGTOVAR to PCL cursor position
  378. *             command to move cursor to specified coordinate position.
  379. *          Coordinates are specified in hundredths of inches, and point 0,0
  380. *          corresponds to the upper left corner of the physical page.
  381. *   Parameters: fcgx,fcgy - (numeric) cursor position
  382. *****************************************************************************
  383. procedure fcggoto
  384. parameters fcgx, fcgy
  385.  
  386. fcggtovar =  chr(27)+"*p"+ltrim(str(3*fcgx-75))+"x"+ltrim(str(3*fcgy-75))+"Y"
  387. return
  388.  
  389.  
  390. *****************************************************************************
  391. *   Function: Sets the public variable FCGMOVVAR to PCL cusror position command
  392. *             to move the PCL cursor horizontaly by specified relative ammount.
  393. *          Coordinates are specified in hundredths of inches, and point 0,0
  394. *          corresponds to the upper left corner of the physical page.
  395. *   Parameters: fcgx, - (numeric) ammount to move cursor by
  396. *****************************************************************************
  397. procedure fcgmovby
  398. parameters fcgx
  399.  
  400. fcgmovvar =  chr(27)+"*p+"+ltrim(str(3*fcgx))+"X"
  401. return
  402.  
  403.  
  404. *****************************************************************************
  405. *   Function: Calculates extent of text based on font metric information.
  406. *             Stores the calculated value in public variable FCGEXTVAR
  407. *   Parameters: fcgfntl,fcgfntu - (character) font metric arrays (upper/lower)
  408. *               fcgfntf - (numeric) first character in character set
  409. *               fcgstr - (character) the character string
  410. *   NOTE: The font metric information is generated by FormCode/Gen for fonts
  411. *   that need this information.
  412. *****************************************************************************
  413. procedure fcgtxtext
  414. parameters fcgfntl, fcgfntu, fcgfntf, fcgstr
  415. private fcglen, fcgidx, fcgchidx
  416.  
  417. fcgextvar = 0
  418. fcgidx = 1
  419. fcglen = len(fcgstr)
  420. do while fcgidx <= fcglen
  421.     fcgchidx = asc(substr(fcgstr,fcgidx,1)) - fcgfntf + 1
  422.     fcgextvar = fcgextvar + asc(substr(fcgfntl,fcgchidx,1)) + ;
  423.         (asc(substr(fcgfntu,fcgchidx,1))-1) * 256
  424.     fcgidx = fcgidx + 1
  425. *    @0,0 say fcgfntf+chr(fcgchidx+fcgfntf-1)+fcgextvar
  426. *    suspend
  427. enddo
  428. fcgextvar = int(fcgextvar / 10)
  429. return
  430.  
  431.  
  432. *****************************************************************************
  433. *   Function: Draws a verticle or horizontal line between specified points.
  434. *          Coordinates are specified in hundredths of inches, and point 0,0
  435. *          corresponds to the upper left corner of the physical page. Line
  436. *          coordinates specify center line for thick lines.
  437. *   Parameters: fcgx1,fcgy1 - (numeric) line starting position
  438. *        fcgx2,fcgy2 - (numeric) line ending position
  439. *        fcgthick - (numeric) line width in hundredths of inches
  440. *   NOTE: The ending position must specify coordinates that are larger than
  441. *      or equal to start cordinates (i.e x2 >= x1, and y2 >= y1)
  442. *****************************************************************************
  443. procedure fcgline
  444. parameters fcgx1, fcgy1, fcgx2, fcgy2, fcgthick
  445. private fcgposx,fcgposy,fcgsizex,fcgsizey,fcgtmp
  446.  
  447. if fcgx1 = fcgx2
  448.     fcgposx = fcgx1 - int(fcgthick/2)
  449.     fcgposy = fcgy1
  450.     fcgsizex = fcgthick
  451.     fcgsizey = fcgy2 - fcgy1 + 1
  452. else
  453.     fcgposy = fcgy1 - int(fcgthick/2)
  454.     fcgposx = fcgx1
  455.     fcgsizey = fcgthick
  456.     fcgsizex = fcgx2 - fcgx1 + 1
  457. endif
  458.  
  459. do fcggoto with fcgposx,fcgposy
  460. ?? fcggtovar+chr(27)+"*c"+ltrim(str(3*fcgsizex))+"a" + ;
  461.    ltrim(str(3*fcgsizey))+"b0P"
  462. return
  463.  
  464.  
  465. *****************************************************************************
  466. *   Function: Draws a rectangle with or without a border and with or without a
  467. *             fill. Coordinates are specified in hundredths of inches, and
  468. *             point 0,0 corresponds to the upper left corner of the physical page.
  469. *   Parameters: fcgleft,fcgtop - (numeric) upper left corner coordinates
  470. *        fcgright,fcgbot - (numeric) lower left corner coordinates
  471. *        fcgthick - (numeric) border width in hundredths of inches
  472. *        fcgfillt - (numeric) fill type. Must be one of the following:
  473. *            0 for black fill
  474. *            1 for white fill
  475. *            2 for HP defined gray shading pattern
  476. *            3 for HP defined cross-hatched pattern
  477. *                       4 for no fill
  478. *        fcgfillp - (numeric) the fill pattern. Value depends upon the
  479. *            value of fcgfillt (ignored for fcgfillt = 0 or 1)
  480. *            for fcgfillt = 2, a gray shading percentage value from
  481. *            the following (2,10,15,30,45,70,90,100)
  482. *            for fcgfillt = 3, a number between 1 and 6 corresponding
  483. *                       to the six predefined patterns.
  484. *   NOTE: The ending position must specify coordinates that are larger than
  485. *      or equal to start cordinates (i.e x2 >= x1, and y2 >= y1)
  486. *****************************************************************************
  487. procedure fcgrect
  488. parameters fcgleft,fcgtop,fcgright,fcgbot,fcgthick,fcgfillt,fcgfillp
  489.  
  490. if fcgfillt <> 4
  491.     do fcggoto with fcgleft, fcgtop
  492. ?? fcggtovar+chr(27)+"*c"+ltrim(str(fcgfillp))+"g"+;
  493.    ltrim(str((fcgright-fcgleft+1)*3))+"a"+ltrim(str((fcgbot-fcgtop+1)*3))+"b"+;
  494.    ltrim(str(fcgfillt))+"P"
  495. endif
  496.  
  497. if fcgthick > 0
  498.     do fcgline with fcgleft,fcgtop,fcgright,fcgtop,fcgthick
  499.     do fcgline with fcgleft,fcgbot,fcgright,fcgbot,fcgthick
  500.     do fcgline with fcgleft,fcgtop-int(fcgthick/2),fcgleft, ;
  501.             fcgbot+int((fcgthick-1)/2),fcgthick
  502.     do fcgline with fcgright,fcgtop-int(fcgthick/2),fcgright, ;
  503.             fcgbot+int((fcgthick-1)/2),fcgthick
  504. endif
  505. return
  506.  
  507.  
  508. *****************************************************************************
  509. *   Function: Draws a box with specified border width, type, sahdow, etc.
  510. *          Coordinates are specified in hundredths of inches, and point 0,0
  511. *          corresponds to the upper left corner of the physical page.
  512. *   Parameters: fcgleft,fcgtop - (numeric) upper left corner coordinates
  513. *        fcgright,fcgbot - (numeric) lower left corner coordinates
  514. *        fcgthick - (numeric) border width in hundredths of inches
  515. *        fcgfillt - (numeric) fill type. Must be one of the following:
  516. *            0 for black fill
  517. *            1 for white fill
  518. *            2 for HP defined gray shading pattern
  519. *            3 for HP defined cross-hatched pattern
  520. *                       4 for no fill
  521. *        fcgfillp - (numeric) the fill pattern. Value depends upon the
  522. *            value of fcgfillt (ignored for fcgfillt = 0 or 1)
  523. *            for fcgfillt = 2, a gray shading percentage value from
  524. *            the following (2,10,15,30,45,70,90,100)
  525. *            for fcgfillt = 3, a number between 1 and 6 corresponding
  526. *                       to the six predefined patterns.
  527. *        fcgborder - (numeric) if = 0, specifies a single border. If = 1
  528. *            specifies a double border.
  529. *        fcgshadow - (numeric) if = 0, specifies no shadow. If = 1
  530. *            specifies a shadow.
  531. *   NOTE: The ending position must specify coordinates that are larger than
  532. *      or equal to start cordinates (i.e x2 >= x1, and y2 >= y1)
  533. *****************************************************************************
  534. procedure fcgbox
  535. parameters fcgbleft, fcgbtop, fcgbright, fcgbbot, fcgbthick, fcgbfillt, ;
  536.     fcgbfillp, fcgbborder, fcgbshadow
  537. private fcgbmargin,fcgft
  538.  
  539. fcgft = fcgbfillt
  540. fcgbmargin = 2 * fcgbthick
  541. if fcgbborder = 1
  542.     do fcgrect with fcgbleft+fcgbmargin, fcgbtop+fcgbmargin, fcgbright-fcgbmargin, ;
  543.     fcgbbot-fcgbmargin, fcgbthick, fcgft, fcgbfillp
  544.     fcgft = 4
  545. endif
  546.  
  547. do fcgrect with fcgbleft, fcgbtop, fcgbright, fcgbbot, fcgbthick, fcgft, fcgbfillp
  548.  
  549. if fcgbshadow = 1
  550.     do fcgrect with fcgbleft+5-int(fcgbthick/2), fcgbbot+int(fcgbthick/2), ;
  551.     fcgbright+5+int(fcgbthick/2), fcgbbot+5+int(fcgbthick/2), 1, 0, 0
  552.     do fcgrect with fcgbright+int(fcgbthick/2), fcgbtop+5-int(fcgbthick/2), ;
  553.     fcgbright+5+int(fcgbthick/2), fcgbbot+5+int(fcgbthick/2), 1, 0, 0
  554. endif
  555. return
  556.  
  557.  
  558. *****************************************************************************
  559. *   Function: Prints left justified text at specified position
  560. *   Parameters:
  561. *    fcgfnts - (character) Font selection string
  562. *    fcgtlft,fcgttop - (numeric) Position of first character in string
  563. *    fcgtext - (numeric) The text string to print
  564. *       fcgfillt,fcgfillp - (numeric) the pattern to use to draw text. These
  565. *                           parametrs are interpreted the same as in FCGBOX
  566. *   NOTE: PCL printer will place the baseline at fcgttop (not cell top)
  567. *****************************************************************************
  568. procedure fcgltxt
  569. parameters fcgfnts, fcgtlft, fcgttop, fcgtext, fcgfillt, fcgfillp
  570.  
  571. if len(fcgtext) = 0
  572.     return
  573. endif
  574.  
  575. do fcggoto with fcgtlft, fcgttop
  576. ?? fcgfnts
  577. if (fcgfillt <> 0)
  578.     ?? chr(27)+"*c"+ltrim(str(fcgfillp))+"G"+chr(27)+"*v"+ltrim(str(fcgfillt))+"T"
  579. endif
  580. ?? fcggtovar+fcgtext
  581. if (fcgfillt <> 0)
  582.    ?? chr(27)+"*v0T"
  583. endif
  584. return
  585.  
  586.  
  587. *****************************************************************************
  588. *   Function: Prints L/R justified single line text at specified position
  589. *   Parameters:
  590. *    fcgfnts - (character) Font selection string
  591. *    fcgtlft,fcgttop - (numeric) Position of first character in string
  592. *    fcgtext - (numeric) The text string to print
  593. *       fcgfillt,fcgfillp - (numeric) the pattern to use to draw text. These
  594. *                            parametrs are interpreted the same as in FCGBOX
  595. *    fcgbrkxtra - (numeric) The break extra ammount to spread in breaks
  596. *    fcgbrkcnt - (numeric) The number of break characters in string
  597. *    fcgbrkch - (numeric) The actual break character for symbol set
  598. *   NOTE: PCL printer will place the baseline at fcgttop (not cell top)
  599. *****************************************************************************
  600. procedure fcglrstxt
  601. parameters fcgfnts, fcgtlft, fcgttop, fcgtext, fcgfillt, fcgfillp, ;
  602.     fcgbrkxtra, fcgbrkcnt, fcgbrk
  603. private fcgbrkamt, fcgbrkrm, fcgstpos, fcgtmpstr, fcgbrkch, fcgamt, fcgcurch
  604. private fcgstrlen
  605.  
  606. if len(fcgtext) = 0
  607.     return
  608. endif
  609.  
  610. fcgbrkch = chr(fcgbrk)
  611. if fcgbrkcnt <> 0
  612.     fcgbrkamt = int(fcgbrkxtra/fcgbrkcnt)
  613.     fcgbrkrm = int(fcgbrkxtra - (fcgbrkamt * fcgbrkcnt))
  614. endif
  615. fcgstrlen = len(fcgtext)
  616. fcgstpos = 1
  617. do fcggoto with fcgtlft, fcgttop
  618. fcgtmpstr = fcgfnts+fcggtovar
  619. do while fcgstpos <= fcgstrlen
  620.     fcgcurch = substr(fcgtext,fcgstpos,1)
  621.     if fcgcurch = fcgbrkch
  622.         fcgamt = fcgbrkamt
  623.     if fcgbrkrm > 0
  624.         fcgamt = fcgamt + 1
  625.         fcgbrkrm = fcgbrkrm - 1
  626.     endif
  627.         if fcgamt > 0
  628.         do fcgmovby with fcgamt
  629.         endif
  630.     endif
  631.     if fcgcurch = fcgbrkch .AND. fcgamt > 0
  632.         fcgtmpstr = fcgtmpstr + fcgcurch + fcgmovvar
  633.     else
  634.         fcgtmpstr = fcgtmpstr + fcgcurch
  635.     endif
  636.     fcgstpos = fcgstpos + 1
  637. enddo
  638. if (fcgfillt <> 0)
  639.     ?? chr(27)+"*c"+ltrim(str(fcgfillp))+"G"+chr(27)+"*v"+ltrim(str(fcgfillt))+"T"
  640. endif
  641. ?? fcgtmpstr
  642. if (fcgfillt <> 0)
  643.    ?? chr(27)+"*v0T"
  644. endif
  645. return
  646.  
  647. *****************************************************************************
  648. *   Function: Prints multi line L/R justified dynamic text at specified position
  649. *   Parameters:
  650. *    fcgfnts - (character) Font selection string
  651. *    fcgtlft, fcgttop - (numeric) center position of string
  652. *    fcgtext - (numeric) The text string to print
  653. *       fcgfillt,fcgfillp - (numeric) the pattern to use to draw text. These
  654. *                           parameters are interpreted the same as in FCGBOX
  655. *       fcgfntl, fcgfntu - (character) text metric arrays
  656. *       fcgfntf - (numeric) first character position in character set
  657. *       fcgfnth - (numeric) font height
  658. *       fcgfntbrk - (numeric) ascii value of the font break character
  659. *       fcgextent - (numeric) text extent in hundredths of inches
  660. *   NOTE: PCL printer will place the baseline at fcgttop (not cell top)
  661. *****************************************************************************
  662. procedure fcglrtxt
  663. parameters fcgfnts, fcgtlft, fcgttop, fcgtext, fcgfillt, fcgfillp, fcgfntl, ;
  664.     fcgfntu, fcgfntf, fcgfnth, fcgfntbrk, fcgextent
  665. private fcgcurpos, fcgendpos, fcgtmp, fcgword, fcgstrlen, fcgcurch, fcgbrkch
  666. private fcgcurext, fcgwrdext, fcgchidx, fcgbrkext, fcgspxtra, fcgbrkcnt, fcgdone, ;
  667.         fcglinend
  668.  
  669. if len(fcgtext) = 0
  670.     return
  671. endif
  672.  
  673. fcgcurpos = 1
  674. fcgcurext = 0
  675. fcgbrkcnt = 0
  676. fcgextent = fcgextent * 10
  677. fcgtmp = ""
  678. fcgstrlen = len(fcgtext)
  679. fcgbrkch = chr(fcgfntbrk)
  680. fcgdone = .F.
  681. fcgbrkext = asc(substr(fcgfntl,fcgfntbrk-fcgfntf+1,1)) + ;
  682.         (asc(substr(fcgfntu,fcgfntbrk-fcgfntf+1,1))-1) * 256
  683. ?? fcgfnts
  684. if (fcgfillt <> 0)
  685.     ?? chr(27)+"*c"+ltrim(str(fcgfillp))+"G"+chr(27)+"*v"+ltrim(str(fcgfillt))+"T"
  686. endif
  687. do while .T.
  688. *    suspend
  689.     do while fcgcurpos <= fcgstrlen
  690.         fcgcurch = substr(fcgtext,fcgcurpos,1)
  691.         if fcgcurch <>  fcgbrkch
  692.             exit
  693.         endif
  694.         fcgcurpos = fcgcurpos + 1
  695.     enddo
  696.     fcgendpos = fcgcurpos
  697.     fcgwrdext = 0
  698.     do while fcgendpos <= fcgstrlen
  699.         fcgcurch = substr (fcgtext,fcgendpos,1)
  700.         if fcgcurch = fcgbrkch .OR. fcgcurch = chr(13) .OR. fcgcurch = chr(10)
  701.             exit
  702.         endif
  703.         fcgchidx = asc(fcgcurch) - fcgfntf + 1
  704.         fcgwrdext = fcgwrdext + asc(substr(fcgfntl,fcgchidx,1)) + ;
  705.         (asc(substr(fcgfntu,fcgchidx,1))-1) * 256
  706.         fcgendpos = fcgendpos + 1
  707.     enddo
  708.     if fcgcurext = 0
  709.         fcgspxtra = 0
  710.     else
  711.         fcgspxtra = fcgbrkext
  712.     endif
  713.     if (fcgcurext + fcgwrdext + fcgspxtra <= fcgextent) .OR. ;
  714.         (fcgcurext = 0 .AND. fcgwrdext >= fcgextent)
  715.         if fcgcurext <> 0
  716.             fcgtmp = fcgtmp + fcgbrkch
  717.             fcgbrkcnt = fcgbrkcnt + 1
  718.             fcgcurext = fcgcurext + fcgbrkext
  719.         endif
  720.         fcgtmp = fcgtmp + substr(fcgtext,fcgcurpos,fcgendpos-fcgcurpos)
  721.         if fcgcurch = chr(10) .OR. fcgcurch = chr(13)
  722.             fcglinend = .T.
  723.         else
  724.             fcglinend = .F.
  725.         endif
  726. *        @3, 5 say fcgtmp + "    CurCh["+fcgcurch+"]"
  727. *        suspend
  728.         fcgcurext = fcgcurext + fcgwrdext
  729.         fcgcurpos = fcgendpos + 1
  730.         if fcgcurch = chr(13) .AND. fcgcurpos <= fcgstrlen .AND. substr(fcgtext,fcgcurpos,1) = chr(10)
  731.             fcgcurpos = fcgcurpos + 1
  732.         endif
  733.     else
  734.         fcglinend = .F.
  735.         fcgdone = .T.
  736.     endif
  737.     if fcgcurext >= fcgextent .OR. fcglinend .OR. fcgcurpos > fcgstrlen .OR. fcgdone
  738. *        clear
  739. *        @4,5 say fcgtmp
  740. *        @6,5 say str(fcgextent,6)+str(fcgcurext,6)+str(fcgbrkcnt,6)
  741. *        @7,5 say "CurCh["+fcgcurch+"]  Pos: "+str(fcgcurpos,4)+"  Len: "+str(fcgstrlen,4)
  742. *        suspend
  743.         if fcgcurpos > fcgstrlen .OR. fcglinend
  744.         do fcgltxt with "", fcgtlft, fcgttop, fcgtmp, 0, 0
  745.     else
  746.         do fcglrstxt with "", fcgtlft, fcgttop, fcgtmp, 0, 0, ;
  747.             (fcgextent-fcgcurext)/10, fcgbrkcnt, fcgfntbrk
  748.         endif
  749.         fcgdone = .F.
  750.         fcgcurext = 0
  751.         fcgtmp = ""
  752.         fcgbrkcnt = 0
  753.         fcgttop = fcgttop + fcgfnth
  754.         if fcgcurpos > fcgstrlen
  755.             exit
  756.         endif
  757.     endif
  758. if (fcgfillt <> 0)
  759.    ?? chr(27)+"*v0T"
  760. endif
  761. enddo
  762.  
  763.  
  764. *****************************************************************************
  765. *   Function: Prints center justified text at specified position
  766. *   Parameters:
  767. *    fcgfnts - (character) Font selection string
  768. *    fcgtcnt, fcgttop - (numeric) center position of string
  769. *       fcgfillt,fcgfillp - (numeric) the pattern to use to draw text. These
  770. *                           parameters are interpreted the same as in FCGBOX
  771. *    fcgtext - (numeric) The text string to print
  772. *       fcgfntl, fcgfntu - (character) text metric arrays
  773. *       fcgfntf - (numeric) first character position in character set
  774. *   NOTE: PCL printer will place the baseline at fcgttop (not cell top)
  775. *****************************************************************************
  776. procedure fcgctxt
  777. parameters fcgfnts, fcgtcnt, fcgttop, fcgtext, fcgfillt, fcgfillp, fcgfntl, ;
  778.     fcgfntu, fcgfntf
  779. private fcgtmp
  780.  
  781. if len(fcgtext) = 0
  782.     return
  783. endif
  784.  
  785. fcgtmp = trim(fcgtext)
  786. do fcgtxtext with fcgfntl, fcgfntu, fcgfntf, fcgtmp
  787. fcgtcnt = fcgtcnt - fcgextvar/2
  788. do fcggoto with fcgtcnt, fcgttop
  789. ?? fcgfnts
  790. if (fcgfillt <> 0)
  791.     ?? chr(27)+"*c"+ltrim(str(fcgfillp))+"G"+chr(27)+"*v"+ltrim(str(fcgfillt))+"T"
  792. endif
  793. ?? fcggtovar+fcgtmp
  794. if (fcgfillt <> 0)
  795.    ?? chr(27)+"*v0T"
  796. endif
  797. return
  798.  
  799. *****************************************************************************
  800. *   Function: Prints right justified text at specified position
  801. *   Parameters:
  802. *    fcgfnts - (character) Font selection string
  803. *    fcgtrt, fcgttop - (numeric) center position of string
  804. *       fcgfillt,fcgfillp - (numeric) the pattern to use to draw text. These
  805. *                           parameters are interpreted the same as in FCGBOX.
  806. *    fcgtext - (numeric) The text string to print
  807. *       fcgfntl, fcgfntu - (character) text metric arrays
  808. *       fcgfntf - (numeric) first character position in character set
  809. *   NOTE: PCL printer will place the baseline at fcgttop (not cell top)
  810. *****************************************************************************
  811. procedure fcgrtxt
  812. parameters fcgfnts, fcgtrt, fcgttop, fcgtext, fcgfillt, fcgfillp, fcgfntl, ;
  813.     fcgfntu, fcgfntf
  814. private fcgtmp
  815.  
  816. if len(fcgtext) = 0
  817.     return
  818. endif
  819.  
  820. fcgtmp = trim(fcgtext)
  821. do fcgtxtext with fcgfntl, fcgfntu, fcgfntf, fcgtmp
  822. fcgtrt = fcgtrt - fcgextvar
  823. do fcggoto with fcgtrt, fcgttop
  824. ?? fcgfnts
  825. if (fcgfillt <> 0)
  826.     ?? chr(27)+"*c"+ltrim(str(fcgfillp))+"G"+chr(27)+"*v"+ltrim(str(fcgfillt))+"T"
  827. endif
  828. ?? fcggtovar+fcgtmp
  829. if (fcgfillt <> 0)
  830.    ?? chr(27)+"*v0T"
  831. endif
  832. return
  833.  
  834. *****************************************************************************
  835. *   Function: Defines printer macro with specified ID
  836. *   Parameters:
  837. *    fcgmacid - (character) macro id
  838. *****************************************************************************
  839. procedure fcgdefmac
  840. parameters fcgmacid
  841. ?? chr(27)+"&f"+fcgmacid+"y0X"
  842. return
  843.  
  844. *****************************************************************************
  845. *   Function: Ends definition for a printer macro
  846. *   Parameters: none
  847. *****************************************************************************
  848. procedure fcgendmac
  849. ?? chr(27)+"&f1X"
  850. return
  851.  
  852. *****************************************************************************
  853. *   Function: Executes printer macro with last ID
  854. *   Parameters: none
  855. *****************************************************************************
  856. procedure fcgdomac
  857. parameters fcgmacid
  858. ?? chr(27)+"&f2X"
  859. return
  860.  
  861. *****************************************************************************
  862. *   Function: Draws check box at specified location
  863. *   Parameters: fcgleft, fcgtop (numeric) top left corner of box
  864. *               fcgcheck (logical) check box checked or not ?
  865. *****************************************************************************
  866. procedure fcgchkbox
  867. parameters fcgleft, fcgtop, fcgcheck
  868. do fcgrect with fcgleft, fcgtop, fcgleft+15, fcgtop+15, 1, 4, 0
  869. if .NOT. fcgcheck
  870.     return
  871. endif
  872.  
  873. do fcggoto with fcgleft+1, fcgtop+1
  874. fcgbitmap = fcggtovar+chr(27)+"*t75R"+chr(27)+"*r11t11s1A"+chr(27)+"*b0M"
  875. fcgbitmap = fcgbitmap + chr(27)+"*b2W" + chr(128) + chr(32)
  876. fcgbitmap = fcgbitmap + chr(27)+"*b2W" + chr(64) + chr(64)
  877. fcgbitmap = fcgbitmap + chr(27)+"*b2W" + chr(32) + chr(128)
  878. fcgbitmap = fcgbitmap + chr(27)+"*b1W" + chr(16+1)
  879. fcgbitmap = fcgbitmap + chr(27)+"*b1W" + chr(8+2)
  880. fcgbitmap = fcgbitmap + chr(27)+"*b1W" + chr(4)
  881. fcgbitmap = fcgbitmap + chr(27)+"*b1W" + chr(8+2)
  882. fcgbitmap = fcgbitmap + chr(27)+"*b1W" + chr(16+1)
  883. fcgbitmap = fcgbitmap + chr(27)+"*b2W" + chr(32) + chr(128)
  884. fcgbitmap = fcgbitmap + chr(27)+"*b2W" + chr(64) + chr(64)
  885. fcgbitmap = fcgbitmap + chr(27)+"*b2W" + chr(128) + chr(32)
  886. ?? fcgbitmap+chr(27)+"*rB"
  887. return
  888.  
  889.  
  890. *****************************************************************************
  891. *   Function: Draws bitmap image at specified position
  892. *   Parameters: fcgleft, fcgtop (numeric) top left corner of image
  893. *               fcgname (character) name of bitmap file (must be in curr dir)
  894. *   WARNING: This function uses the DOS COPY command (with the /b switch for
  895. *   binary data) to copy the bitmap file to the printer. On systems other than
  896. *   DOS (e.g Novel, Unix, etc) this needs to be changed. Also the file is
  897. *   copied to standard printer PRN. If your printer is connected to a different
  898. *   port you need to change this also !!!
  899. *****************************************************************************
  900. procedure fcgimage
  901. parameters fcgleft, fcgtop, fcgname
  902.  
  903. * The following lines are dummy lines. They must be deleted by the user.
  904. * Their only porpose is to serve as a reminder for the new user
  905. *clear
  906. *@12, 10 say "PCLDRV.PRG has not been modified as described in the users manual."
  907. *@13, 10 say "Please read the section on Printing Bitmaps to acomplish this."
  908. *return
  909.  
  910. do fcggoto with fcgleft, fcgtop
  911. ?? fcggtovar
  912. * The next line should be changed so that it copies the file &fcgname to
  913. * your printer port. The copy command works for DOS but may need to be
  914. * changed for other systems such as Unix, Novel, etc.
  915. run copy /b &fcgname prn
  916. return
  917.