home *** CD-ROM | disk | FTP | other *** search
/ Global Amiga Experience / globalamigaexperience.iso / applications / databases / sbase4pro / ideas / sb_to_sp.sbp < prev    next >
Encoding:
Text File  |  1995-07-10  |  1.7 KB  |  74 lines

  1. SBP
  2.  ÿ½
  3.  ÿ½ Demonstration of data transfer between Superbase Pro and Superplan.
  4.  ÿ½ Also illustrates use of ARexx for data transfer going out of SBPro.
  5.  ÿ½ Author : Darin Arrick, Precision Technical Support, 02/06/91
  6.  ÿ½ Superplan should be run first, then SBPro.
  7.  ÿ½
  8.  ÿ½ This program will take values from fields in a database and plot a  
  9.  ÿ½ pie graph of them. 
  10.  ÿ½ 
  11. 
  12.  ÿ½ These commands set up the graph title and first command.
  13.  ÿŠ"/zy",",pia>ENT","=b1>ENT","Data from Superbase via Arexx>ENT"
  14.  ÿŠ"=a2>ENT",",pie>ENT"
  15.  
  16.  filename$ÿ"graphthis1"
  17.  ÿ´ÿ™filename$
  18.  fieldname$ÿ"Price"
  19.  recnum%ÿÿA(filename$)
  20.  
  21.  ÿ½ Clear the sheet, set up the graph title
  22.  ÿ›I%ÿ1ÿq6
  23. ÿ¼cmd$
  24. ÿƒ"SpRexx"ÿ–cmd$
  25. ÿ¡ÿ&ÿ0ÿ
  26. ÿ&ÿÿ1ÿpÿwehandle
  27.  ÿ±i%
  28.  
  29.  ÿ½ Move the values from the fields into an array for easier processing
  30.  ÿ×a%(recnum%)
  31.  ÿÉÿ`
  32.  ÿ›x%ÿ1ÿqrecnum%
  33. a%(x%)ÿPrice 
  34. ÿÉÿ±
  35.  ÿ±x%
  36.  
  37.  ÿ½ Replicate the ",pie" command based on the number of records
  38.  cmd$ÿ"/rra2,a3:a"ÿÿH(ÿF(ÿ(recnum%ÿ1)))ÿ">ENT"
  39.  ÿƒ"SpRexx"ÿ–cmd$
  40.  
  41.  ÿ½ Go to cell c2 and get ready to insert data
  42.  ÿƒ"SpRexx"ÿ–"=c2>ENT"
  43.  r%ÿrecnum%
  44.  
  45.  ÿ½ Send the data from the array to SuperPlan
  46.  ÿ›q%ÿ1ÿqrecnum%
  47. r%ÿr%ÿ1
  48. cmd$ÿ"=c"ÿÿH(ÿF(ÿ(q%ÿ1)))ÿ">ENT"
  49. ÿƒ"SpRexx"ÿ–cmd$
  50. ÿƒ"SpRexx"ÿ–ÿH(ÿF(ÿ(a%(q%))))ÿ">ENT"
  51.  ÿ±q%
  52.  
  53.  ÿ½ Plot the pie graph
  54.  ÿƒ"SpRexx"ÿ–"/vs>ENT"
  55.  
  56.  ÿ½ Reset SuperPlan menu to top level
  57.  ÿƒ"SpRexx"ÿ–">ESC"
  58.  
  59.  ÿ½ Shut everything down 
  60.  ÿƒ""ÿ†
  61.  ÿ†ÿ™"graphthis1"
  62.  ÿ’
  63.  
  64.  ÿ½ Error handler
  65. ehandle: 
  66.  ÿ¡ÿ&ÿÿ1ÿp
  67. ÿÂ"Superplan not responding","Please run it first",0,a%
  68. ÿ’
  69.  ÿ’ÿ¡
  70.  e$ÿ"Number"ÿÿ(ÿ&)
  71.  ÿÂ"Superplan returned an error : ",e$,0,a%
  72.  ÿ’
  73.  
  74.  
  75.