home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 October / Chip_2001-10_cd1.bin / sharewar / gdidbpro / data1.cab / Example_Files / projects / default / graphs.scp < prev    next >
Text File  |  2000-05-26  |  1KB  |  52 lines

  1. ##########################################################
  2. # GDIdb demo script (c) 1998 Global Data Industries
  3. #
  4. # This example shows how a simple graph can be included
  5. # on a web page. The graph can be drawn using small "gif"
  6. # block images, or even just text characters. The data for
  7. # the graph is here generated by the script, but could just
  8. # as easily come from a database.
  9. ##########################################################
  10.  
  11.  
  12.  
  13.  
  14. ##########################################################
  15. # declare variables used in script
  16.  
  17. &defvar(?count?,?function?)
  18.  
  19.  
  20.  
  21.  
  22. ##########################################################
  23. # Print the information screen
  24.  
  25. &cls
  26. &print("Graphs Demo Script")
  27. &print("-----------------------------------")
  28.  
  29.  
  30.  
  31.  
  32. ##########################################################
  33. # generate the html
  34.  
  35. &html("index.html")
  36. {
  37.     <HTML>
  38.     <HEAD>
  39.     <TITLE>Graph of X Squared</TITLE>
  40.     </HEAD>
  41.     <BODY>
  42.     <H1>Graph showing function X Squared</H1>
  43.     &for(?count?,0,?count?<12,1)
  44.     {
  45.         # calculate X Squared.
  46.         &assign(?function?,?count?*?count?)
  47.         <NOBR>&repeat(?function?){<IMG SRC=\"graph.gif\">}</NOBR><BR>
  48.     }
  49.     </BODY>
  50.     </HTML>
  51. }
  52.