home *** CD-ROM | disk | FTP | other *** search
/ Turbo Toolbox / Turbo_Toolbox.iso / 1987 / 12 / comal1.lst < prev    next >
Encoding:
File List  |  1987-08-30  |  478 b   |  26 lines

  1. 0010 // Listing 1
  2. 0020 
  3. 0030 // TRAP HANDLER RETRY ENDTRAP - DEMO
  4. 0040 
  5. 0050 USE graphics
  6. 0060 graphicscreen(0)
  7. 0070 
  8. 0080 xmin:=-10; xmax:=10; dx:=(xmax-xmin)/640
  9. 0090 window(xmin,xmax,-10,10)
  10. 0100 moveto(xmin,f(xmin))
  11. 0110 x:=xmin
  12. 0120 REPEAT
  13. 0130   TRAP
  14. 0140     x:+dx
  15. 0150     drawto(x,f(x))
  16. 0160   HANDLER
  17. 0170     RETRY
  18. 0180   ENDTRAP
  19. 0190 UNTIL x=xmax
  20. 0200 
  21. 0210 END "Das war's"
  22. 0220 
  23. 0230 FUNC f(x) 
  24. 0240   RETURN (2*x-3)/(x*x-1)
  25. 0250 ENDFUNC f
  26.