home *** CD-ROM | disk | FTP | other *** search
/ RBBS in a Box Volume 1 #3.1 / RBBSIABOX31.cdr / typd / twoscren.bas (.txt) < prev    next >
Encoding:
GW-BASIC  |  1984-04-24  |  15.0 KB  |  357 lines

  1. 10  ' TWOSCREN                                    Author : W W LYONS
  2. 30  GOSUB 640
  3. 60  KEY 5, ""
  4. 70  KEY 6, "TWOSCREN" + CHR$(13)  'Put primary program name here
  5. 80  KEY 10, "edit "               'I use this more than 'screen'
  6. 90  KEY 8, " DRAW " + CHR$(34)
  7. 100  KEY 7, "         " + CHR$(13)
  8. 110  KEY 9, "key on" + CHR$(13)
  9. 120  KEY OFF
  10. 128   SCREENFORMAT = 0
  11. 140  DIM MONITORBUFFER%(8001)
  12. 150  '.                    Opening statement
  13. 160  CLS : LOCATE 3,28 : PRINT "Two screen graphing program"
  14. 170  LOCATE 7,5 : PRINT "This program is written for the IBM Personal Computer. I hope you find it"
  15. 180  PRINT "useful.  The author is human and makes mistakes.  Any information prepared by" : PRINT "this program is not guaranteed in any way and is to be used at your personal "
  16. 190  PRINT "risk and discretion.  All of these disclaimers notwithstanding, I hope that you" : PRINT "find the program useful and will share it with others.  Please feel free to"
  17. 200  PRINT "share the program in unmodified form."
  18. 210  PRINT : PRINT "     If you found the program useful or if you have discovered errors or if you" : PRINT "have any hints or suggestions, please contact me at" : PRINT
  19. 220  LOCATE ,30 : PRINT "W W Lyons" : LOCATE ,30 : PRINT "4065 Beechwood Drive NW" : LOCATE ,30 : PRINT "Atlanta  GA  30327"
  20. 230  PRINT : PRINT "     Please do not distribute the program in modified form." : PRINT : LOCATE ,30 : PRINT "Thanks for your cooperation."
  21. 240  LOCATE 25,50 : COLOR 31 : INPUT "Press ENTER to proceed.  " , ANS : COLOR 7
  22. 250  '!Beginning of main program - all setup complete
  23. 260  GOSUB 640    'Let's be sure we are on the display
  24. 270  CLS : GOTO 440 'PRINT "Press h for menu                                             "
  25. 280  'PRINT "continuation                    -or- Press h for more information.
  26. 290  A$ = INKEY$
  27. 310  IF A$ ="1" GOTO 740   'Define format of graphics screen
  28. 320  'IF A$ ="2" GOTO xxxx   '
  29. 330  IF A$ ="3" GOTO 2400   'Draw a line on a graph
  30. 340  'IF A$ ="4" GOTO xxxx   '
  31. 350  'IF A$ ="5" GOTO xxxx   '
  32. 360  'IF A$ ="6" GOTO xxxx   '
  33. 370  'IF A$ ="7" GOTO xxxx   '
  34. 380  IF A$ ="8" GOTO 680   'Clear monitor screen
  35. 390  'IF A$ ="9" GOTO xxxx   '
  36. 400  IF A$ ="d" GOTO 3210   'Turn on data print option
  37. 410  IF A$ ="h" GOTO 440   'Display MENU
  38. 420  IF A$ ="p" THEN  PRINT "Bytes not used by BASIC =" FRE(X)
  39. 430  GOTO 290
  40. 440  CLS
  41. 450  A = 16 : LOCATE 5,1
  42. 460  PRINT TAB(A+20) " MENU" : PRINT
  43. 470  PRINT TAB(A-1) "KEY       FUNCTION" : PRINT
  44. 480  'PRINT TAB(A) "0        explanation"
  45. 490  PRINT TAB(A) "1        Define format of graphics screen"
  46. 500  'PRINT TAB(A) "2        "
  47. 510  PRINT TAB(A) "3        Draw a graph"
  48. 520  'PRINT TAB(A) "4        "
  49. 530  'PRINT TAB(A) "5        "
  50. 540  'PRINT TAB(A) "6        "
  51. 550  'PRINT TAB(A) "7        "
  52. 560  PRINT TAB(A) "8        Clear monitor screen"
  53. 570  'PRINT TAB(A) "9        "
  54. 580  LOCATE 22,20
  55. 590  PRINT "PRESS the key indicated to obtain the desired FUNCTION" : PRINT
  56. 600  GOTO 290
  57. 610  'Subroutine to switch to monitor
  58. 615  KEY OFF
  59. 620  DEF SEG = 0 : A = PEEK(&H410) : POKE &H410, (A AND &HCF) OR &H20
  60. 630  RETURN
  61. 640  'Subroutine to switch to monochrome display                             
  62. 650  DEF SEG = 0 : A = PEEK(&H410) : POKE &H410, A OR &H30
  63. 660  WIDTH 80 : SCREEN 0
  64. 670  RETURN
  65. 680  'Clear monitor screen                                                   
  66. 690  GOSUB 610      'Switch to monitor
  67. 700  SCREEN 1
  68. 710  SOUND 600,5
  69. 720  GOSUB 640      'Switch to display
  70. 730  GOTO 270
  71. 740  'Define format of graphics device                                       
  72. 750  CLS
  73. 760  A = 16 : LOCATE 5,1
  74. 770  PRINT TAB(A+20) " MENU" : PRINT
  75. 780  PRINT TAB(A-1) "KEY       FUNCTION" : PRINT
  76. 790  'PRINT TAB(A) "0        explanation"
  77. 800  PRINT TAB(A) "1        One full screen graph"
  78. 810  PRINT TAB(A) "2        Two graphs side by side"
  79. 820  'PRINT TAB(A) "3        "
  80. 830  PRINT TAB(A) "4        Four graphs"
  81. 840  'PRINT TAB(A) "5        "
  82. 850  PRINT TAB(A) "6        Place legends on graphs"
  83. 860  'PRINT TAB(A) "7        "
  84. 870  PRINT TAB(A) "8        One graph with your definition"
  85. 880  LOCATE 22,20
  86. 890  PRINT "PRESS the key indicated to obtain the desired FUNCTION" : PRINT
  87. 900  A$ = INKEY$
  88. 910  IF A$ ="1" GOTO 1060   'Define one full screen graph
  89. 920  IF A$ ="2" GOTO 1270   'Define two graphs side by side
  90. 930  'IF A$ ="3" GOTO xxxx   '
  91. 940  IF A$ ="4" GOTO 1380   'Define four graphs
  92. 950  'IF A$ ="5" GOTO xxxx   '
  93. 960  IF A$ ="6" GOTO 1030   'Place legends on graphs
  94. 970  'IF A$ ="7" GOTO xxxx   '
  95. 980  IF A$ ="8" GOTO 1530   'Define a single graph interactively
  96. 1000  'IF A$ ="0" GOTO xxxx   '
  97. 1010  GOTO 900
  98. 1020  'Definition of graph parameters                                         
  99. 1030  'MENU options which are not yet implemented                             
  100. 1040  INPUT "This option not implemented.  Press enter to return to MENU" , ANS$
  101. 1050  GOTO 270
  102. 1060  'Define one full screen graph                                           
  103. 1070  SCREENFORMAT = 1
  104. 1080  CLS : LOCATE 10,1,0
  105. 1090  PRINT "You have selected a full screen graph.  Do you want it centered?"
  106. 1100  INPUT "         (Enter c if you want the graph centered)  " , ANS$
  107. 1110  IF ANS$ = "c" OR ANS$ = "C" GOTO 1140
  108. 1120  GOSUB 2120 : GOTO 1150  'Set parameters for one large graph - lower left
  109. 1140  GOSUB 2080        'Set parameters for one large graph - centered
  110. 1150  PRINT : PRINT "Your graph will now appear on the other screen"
  111. 1160  SOUND 100,30
  112. 1170  GOSUB 610      'Switch to monitor
  113. 1180  SCREEN 1
  114. 1190  'Common exit for all screen definition options ****    ****    ****     
  115. 1200  GOSUB 3240      'Go draw abscissas and tics
  116. 1210  LOCATE 24,1 : PRINT "Sample text  4567890" ;
  117. 1220  GET (0,0) - (319,199), MONITORBUFFER%
  118. 1230  SOUND 500,5
  119. 1240  GOSUB 640      'Switch to display
  120. 1250  SOUND 600,5
  121. 1260  GOTO 270
  122. 1270  'Define two graphs side by side                                         
  123. 1280  SCREENFORMAT = 2
  124. 1290  GOSUB 2160   'Set parameters of left graph of side by side pair
  125. 1300  CLS : LOCATE 10,1,0
  126. 1310  PRINT "You have selected a two graph format which will now appear on the monitor"
  127. 1320  SOUND 100,30
  128. 1330  GOSUB 610      'Switch to monitor
  129. 1340  SCREEN 1
  130. 1350  GOSUB 3240      'Go draw abscissas and tics
  131. 1360  GOSUB 2200   'Set parameters of right graph of side by side pair
  132. 1370  GOTO 1190
  133. 1380  'Define four graphs on one screen                                       
  134. 1390  SCREENFORMAT = 4
  135. 1400  CLS : LOCATE 10,1,0
  136. 1410  PRINT "You have selected four graphs which will now appear on the monitor"
  137. 1420  SOUND 100,60
  138. 1430  GOSUB 610      'Switch to monitor
  139. 1440  SCREEN 1
  140. 1450  GOSUB 2240         'Set parameters for upper left graph
  141. 1460  GOSUB 3240      'Go draw abscissas and tics
  142. 1470  GOSUB 2280         'Set parameters for lower left graph
  143. 1480  GOSUB 3240      'Go draw abscissas and tics
  144. 1490  GOSUB 2320         'Set parameters for upper right graph
  145. 1500  GOSUB 3240      'Go draw abscissas and tics
  146. 1510  GOSUB 2360         'Set parameters for lower right graph
  147. 1520  GOTO 1190
  148. 1530  'Define one graph interactively                                         
  149. 1540  SCREENFORMAT = 8 : CLS : LOCATE 1,1,0
  150. 1550  PRINT "The graph format is defined as follows:"
  151. 1560  PRINT "                               l  <ybeg"
  152. 1570  PRINT "                              -l- <yuppertic = yut"
  153. 1580  PRINT "                               l        xo,yo"
  154. 1590  PRINT "            hunit             -l-  xorigin,yorigin   xend"
  155. 1600  PRINT "            ^^^                l /                 /"
  156. 1610  PRINT "           !---!---!---!---!---l---!---!---!---!---"
  157. 1620  PRINT "          /                    l                \"
  158. 1630  PRINT "       xbeg                   -l-]               xrighttic = xrt"
  159. 1640  PRINT "      xlefttic = xlt           l ]vunit"
  160. 1650  PRINT "                              -l-]    resolution    x       y"
  161. 1660  PRINT "  xtd = xticdisplace           l        medium    0-319   0-199"
  162. 1670  PRINT "  xts = xticsize              -l-       high      0-639   0-199"
  163. 1680  PRINT "  ytd = yticdisplace             \"
  164. 1690  PRINT "  yts = yticsize                  yend"
  165. 1700  PRINT "                                ylowertic = ylt"
  166. 1710  GOSUB 2120         'Set parameters for one large graph - lower left
  167. 1720  FOR I = 1 TO 3
  168. 1730  LOCATE 18,1
  169. 1740  PRINT "The values of the parameters are ae follows:"
  170. 1750  PRINT "xorigin =" XO "yorigin =" YO "hunit =" HU "vunit =" VU
  171. 1760  PRINT "xbeg =" XBEG "xend =" XEND "ybeg =" YBEG "yend =" YEND ;
  172. 1770  PRINT "xtd =" XTD "xts =" XTS "ytd =" YTD "yts =" YTS
  173. 1780  PRINT "xlt, xrt, yut, and ylt are derived, not defined"
  174. 1790  PRINT SPC(79) : PRINT SPC(79) : LOCATE 22,1
  175. 1800  ON I GOTO 1810, 1890, 1970
  176. 1810  PRINT "Enter new xorigin, yorigin, hunit, and vunit if you wish (0 and - values will be ignored)   "
  177. 1820  LOCATE 22,11 : COLOR 15 : PRINT "xorigin, yorigin, hunit, and vunit"
  178. 1830  COLOR 7 : LOCATE 23,13 : INPUT "", XOI, YOI, HUI, VUI
  179. 1840  IF XOI > 0 THEN XO = XOI
  180. 1850  IF YOI > 0 THEN YO = YOI
  181. 1860  IF HUI > 0 THEN HU = HUI
  182. 1870  IF VUI > 0 THEN VU = VUI
  183. 1880  GOTO 2040
  184. 1890  PRINT "Enter new xbeg, xend, ybeg, and yend (0 and - values will be ignored)                    "
  185. 1900  LOCATE 22,11 : COLOR 15 : PRINT "xbeg, xend, ybeg, and yend"
  186. 1910  COLOR 7 : LOCATE 23,13 : INPUT "", XBEGI, XENDI, YBEGI, YENDI
  187. 1920  IF XBEGI > 0 THEN XBEG = XBEGI
  188. 1930  IF XENDI > 0 THEN XEND = XENDI
  189. 1940  IF YBEGI > 0 THEN YBEG = YBEGI
  190. 1950  IF YENDI > 0 THEN YEND = YENDI
  191. 1960  GOTO 2040
  192. 1970  PRINT "Enter new xtd, xts, ytd, and yts (0 and - values will be ignored) "
  193. 1980  LOCATE 22,11 : COLOR 15 : PRINT "xtd, xts, ytd, and yts"
  194. 1990  COLOR 7 : LOCATE 23,13 : INPUT "", XTDI, XTSI, YTDI, YTSI
  195. 2000  IF XTDI > 0 THEN XTD = XTDI
  196. 2010  IF XTSI > 0 THEN XTS = XTSI
  197. 2020  IF YTDI > 0 THEN YTD = YTDI
  198. 2030  IF YTSI > 0 THEN YTS = YTSI
  199. 2040  NEXT I
  200. 2050  CLS : LOCATE 10,1,0 : PRINT "The graph you have defined will now appear on the other screen"
  201. 2060  SOUND 100,30 : GOSUB 610     'Switch to monitor
  202. 2070  SCREEN 1 : GOTO 1190
  203. 2080  'Subroutine to set parameters of single large graph - centered          
  204. 2090  XO = 160 : YO = 100 : HU = 12 : VU = 10
  205. 2100  XBEG = 40 : XEND = 280 : YBEG = 0 : YEND = 199
  206. 2110  XTD = 2 : XTS = 4 : YTD = 2 : YTS = 4 : RETURN
  207. 2120  'Subroutine to set parameters of single large graph - lower left        
  208. 2130  XO = 20 : YO = 180 : HU = 12 : VU = 10
  209. 2140  XBEG = 20 : XEND = 284 : YBEG = 0 : YEND = 180
  210. 2150  XTD = 2 : XTS = 4 : YTD = 2 : YTS = 4 : RETURN
  211. 2160  'Subroutine to set parameters of left graph of side by side pair        
  212. 2170  XO = 80 : YO = 100 : HU = 12 : VU = 10
  213. 2180  XBEG = 8 : XEND = 152 : YBEG = 20 : YEND = 179
  214. 2190  XTD = 2 : XTS = 4 : YTD = 2 : YTS = 4 : RETURN
  215. 2200  'Subroutine to set parameters of right graph of side by side pair       
  216. 2210  XO = 240 : YO = 100 : HU = 12 : VU = 10
  217. 2220  XBEG = 168 : XEND = 312 : YBEG = 20 : YEND = 179
  218. 2230  XTD = 2 : XTS = 4 : YTD = 2 : YTS = 4 : RETURN
  219. 2240  'Subroutine to set parameters of upper left graph of four               
  220. 2250  XO = 80 : YO = 50 : HU = 12 : VU = 10
  221. 2260  XBEG = 8 : XEND = 152 : YBEG = 10 : YEND = 90
  222. 2270  XTD = 2 : XTS = 4 : YTD = 2 : YTS = 4 : RETURN
  223. 2280  'Subroutine to set parameters of lower left graph of four               
  224. 2290  XO = 80 : YO = 150 : HU = 12 : VU = 10
  225. 2300  XBEG = 8 : XEND = 152 : YBEG = 110 : YEND = 190
  226. 2310  XTD = 2 : XTS = 4 : YTD = 2 : YTS = 4 : RETURN
  227. 2320  'Subroutine to set parameters of upper right graph of four              
  228. 2330  XO = 240 : YO = 50 : HU = 12 : VU = 10
  229. 2340  XBEG = 168 : XEND = 312 : YBEG = 10 : YEND = 90
  230. 2350  XTD = 2 : XTS = 4 : YTD = 2 : YTS = 4 : RETURN
  231. 2360  'Subroutine to set parameters of lower right graph of four              
  232. 2370  XO = 240 : YO = 150 : HU = 12 : VU = 10
  233. 2380  XBEG = 168 : XEND = 312 : YBEG = 110 : YEND = 190
  234. 2390  XTD = 2 : XTS = 4 : YTD = 2 : YTS = 4 : RETURN
  235. 2400  'Draw lines on graphs                                                   
  236. 2410  IF SCREENFORMAT = 1 GOTO 2480
  237. 2420  IF SCREENFORMAT = 8 GOTO 2480
  238. 2430  IF SCREENFORMAT = 2 GOTO 2550
  239. 2440  IF SCREENFORMAT = 4 GOTO 2650
  240. 2450  CLS : LOCATE 10,1 : SOUND 40,20 : PRINT "The monitor is not formatted."
  241. 2460  INPUT "Press enter to return to the MENU" , ANS$
  242. 2470  GOTO 270
  243. 2480  'Draw on full screen graph                                       
  244. 2490  CLS : LOCATE 6,10
  245. 2500  PRINT "The monitor is formatted for a single full screen graph"
  246. 2510  ID$ = ""
  247. 2520  GOSUB 2910    'Get definition of line, control screens, and draw line
  248. 2530  IF ANS$ = "m" GOTO 440
  249. 2540  GOTO 2480
  250. 2550  'Draw on two graph display                                       
  251. 2560  CLS : LOCATE 6,10
  252. 2570  PRINT "The monitor is formatted for two side by side graphs"
  253. 2580  INPUT "Press enter for left graph or enter r for right graph   " , ANS$
  254. 2590  GOSUB 2160      'Select left graph
  255. 2600  ID$ = "left" : IF ANS$ = "r" THEN ID$ = "right" : GOSUB 2200
  256. 2610  PRINT : PRINT "The " ID$ " graph will be used"
  257. 2620  GOSUB 2910    'Get definition of line, control screens, and draw line
  258. 2630  IF ANS$ = "m" GOTO 440
  259. 2640  GOTO 2550
  260. 2650  'Draw on four graph display                                      
  261. 2660  CLS : LOCATE 6,10
  262. 2670  PRINT "The monitor is formatted for four graphs"
  263. 2680  PRINT "Enter 1,             2,              3,            or 4      for:"
  264. 2690  INPUT "  Upper Left     Upper Right     Lower Left     Lower Right " , ANS
  265. 2700  IF ANS = 1 THEN ID$ = "upper left" :  GOSUB 2240 : GOTO 2770
  266. 2710  IF ANS = 2 THEN ID$ = "upper right" : GOSUB 2320 : GOTO 2770
  267. 2720  IF ANS = 3 THEN ID$ = "lower left" :  GOSUB 2280 : GOTO 2770
  268. 2730  IF ANS = 4 THEN ID$ = "lower right" : GOSUB 2360 : GOTO 2770
  269. 2740  SOUND 50,5
  270. 2750  INPUT "You have not selected a proper choice. Press enter to try again",A
  271. 2760  GOTO 2660
  272. 2770  PRINT : PRINT "The " ID$ " graph will be used"
  273. 2780  GOSUB 2910    'Get definition of line, control screens, and draw line
  274. 2790  IF ANS$ = "m" GOTO 440
  275. 2800  GOTO 2650
  276. 2810  'Subroutine to enter m and b for y = mx + b                             
  277. 2820  LOCATE 12,30
  278. 2830  PRINT "For the expression y = mx + b"
  279. 2840  LOCATE 14,40
  280. 2850  INPUT "Enter a value for m  " , M
  281. 2860  ' Test value of m
  282. 2870  LOCATE 16, 40
  283. 2880  INPUT "Now, enter a value for b  " , B
  284. 2890  ' TEST VALUE OF B
  285. 2900  RETURN
  286. 2910  'Subroutine to get line parameters, control screens, and draw line      
  287. 2920  'Subroutine to get m and b, control screens, and draw line              
  288. 2930  GOSUB 2810        'Enter m and b for y = mx + b
  289. 2940  GOSUB 3070    'Leave message on display
  290. 2950  GOSUB 610    'Switch to monitor
  291. 2960  SCREEN 1
  292. 2970  PUT (0,0), MONITORBUFFER%   'Restore previous screen
  293. 2980  GOSUB 3390    'Draw line
  294. 2990  GET (0,0) - (319,199), MONITORBUFFER%   'and now save again
  295. 3000  GOSUB 640    'Switch back to display
  296. 3010  GOSUB 3070    'Put message back on display (must be a better way)
  297. 3020  GOSUB 3130    'Display data
  298. 3030  LOCATE 20,20
  299. 3040  PRINT "Press enter if you wish to enter another expression"
  300. 3050  INPUT "      or enter m to return to the MENU.   " , ANS$
  301. 3060  RETURN
  302. 3070  'Subroutine to present expression                                       
  303. 3080  CLS
  304. 3090  LOCATE 10, 10, 0
  305. 3100  PRINT "The graph for the expression y =" M "x +" B "is shown on the "
  306. 3110  PRINT ID$ " graph on the other screen"
  307. 3120  RETURN
  308. 3130  'Subroutine to print out all variables                                  
  309. 3140  IF DATAPRINT = 0 GOTO 3200
  310. 3150  LOCATE 16,1
  311. 3160  PRINT "xorigin =" XORIGIN "yorigin =" YORIGIN "hunit =" HUNIT "vunit =" VUNIT
  312. 3170  PRINT "m =" M "b =" B
  313. 3180  PRINT "x1 =" X1 "y1 =" Y1 "x2 =" X2 "y2 =" Y2
  314. 3190  PRINT "px1 =" PX1 "py1 =" PY1 "px2 =" PX2 "py2 =" PY2
  315. 3200  RETURN
  316. 3210  'Turn on data print option                                              
  317. 3220  DATAPRINT = 1
  318. 3230  GOTO 270
  319. 3240  'Subroutine to draw x and y coordinates with tics                       
  320. 3250  XLT = XO - HU*INT((XO - XBEG)/HU) : XRT = XO + HU*INT((XEND - XO)/HU)
  321. 3260  YUT = YO - VU*INT((YO - YBEG)/VU) : YLT = YO + VU*INT((YEND - YO)/VU)
  322. 3270  'Draw abscissas
  323. 3280  LINE (XBEG, YO) - (XEND, YO)
  324. 3290  LINE (XO, YBEG) - (XO, YEND)
  325. 3300  FOR XC = XLT TO XRT STEP HU
  326. 3310  IF XC = XO GOTO 3330
  327. 3320  LINE (XC, YO-YTD) - (XC, YO-YTD+YTS)    'Draw vertical tic
  328. 3330  NEXT
  329. 3340  FOR YC = YUT TO YLT STEP VU
  330. 3350  IF YC = YO GOTO 3370
  331. 3360  LINE (XO-XTD, YC) - (XO-XTD+XTS, YC)    'Draw horizontal tic
  332. 3370  NEXT
  333. 3380  RETURN
  334. 3390  'Subroutine to draw line defined by y = mx + b                          
  335. 3400  'y abscissa is inverted!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  336. 3410  XUL = INT((XO - XBEG)/HU) : XUR = INT((XEND - XO)/HU)
  337. 3420  YUU = INT((YO - YBEG)/VU) : YUL = INT((YEND - YO)/VU)
  338. 3430  IF ABS(M) > 9.9999E-05 GOTO 3460    'If m <UNK! {00F7}> 0 let's draw a straight line
  339. 3440  X1 = - XUL : X2 = + XUR : Y1 = B : Y2 = B
  340. 3450  GOTO 3580
  341. 3460  X1 = - XUL : Y1 = M*X1 + B
  342. 3470  IF Y1 >= - YUL AND Y1 <= + YUU GOTO 3520
  343. 3480  IF Y1 < - YUL GOTO 3500
  344. 3490  Y1 = + YUU : GOTO 3510
  345. 3500  Y1 = - YUL
  346. 3510  X1 = (Y1 - B) / M
  347. 3520  X2 = + XUR : Y2 = M*X2 + B
  348. 3530  IF Y2 >= - YUL AND Y2 <= + YUU GOTO 3580
  349. 3540  IF Y2 < - YUL GOTO 3560
  350. 3550  Y2 = + YUU : GOTO 3570
  351. 3560  Y2 = - YUL
  352. 3570  X2 = (Y2 - B) / M
  353. 3580  PX1 = XO+(X1*HU) : PY1 = YO-(Y1 * VU)
  354. 3590  PX2 = XO+(X2*HU) : PY2 = YO-(Y2 * VU)
  355. 3600  LINE (PX1,PY1) - (PX2,PY2), 1
  356. 3610  RETURN
  357.