home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 7 / FreshFishVol7.bin / bbs / misc / multiplot-xln-s1.01.lha / Multiplot / Rexx / PointTrunkateSet.mpt < prev    next >
Text File  |  1994-04-17  |  1KB  |  69 lines

  1. /* This script trunkates a data set at a selected point */
  2.  
  3.  
  4. port= 'MULTIPLOT.01'
  5. RESULT=''
  6. RC=0
  7.  
  8. /* Check Multiplot is running */
  9. options results
  10. if(~show('p',port)) then do
  11.   say "Please start Multiplot first"
  12.   exit 1
  13. end
  14. address value port
  15.  
  16. /* Check a PLOT WINDOW is active */
  17. 'QUERY'
  18. if(rc ~=0) then do
  19.   say "QUERY command failed!"
  20.   exit 1
  21. end
  22. if(compare('PLOWIN',RESULT)<6) then do
  23.   'SAY Please select a PLOT WINDOW first.'
  24.   exit 1
  25. end
  26.  
  27. /* Check one (and no more) Data Set is selected */
  28. 'PEEK 2'
  29. if(rc =0) then do
  30.   'SAY Please select a single point.'
  31.   exit 1
  32. end
  33. 'PEEK 1'
  34. if(rc~=0) then do
  35.   'SAY Please select a single point.'
  36.   exit 1
  37. end
  38.  
  39. /* Find out point and set numbers */
  40. 'LAUNCH'
  41. 'QUE'
  42. if(rc ~=0) then do
  43.   'SAY ERROR: Failed to query selected point.'
  44.   exit 1
  45. end
  46. setno=word(RESULT,8)
  47. pointno=word(RESULT,4)
  48. 'STOP'
  49.  
  50. 'SELECT SET' setno
  51. 'SELECT REPLACE'
  52. /* Collect values from set */
  53.  
  54. 'PEEK 1 YVALS'
  55. totpoints=WORDS(YVALS)
  56.  
  57. 'SELECT SET' setno
  58. 'SELECT POINT' totpoints
  59. 'SELECT REPLACE'
  60.  
  61. i=totpoints-1
  62. do while(i>=pointno)
  63.   'SELECT SET' setno
  64.   'SELECT POINT' i
  65.   'SELECT ADD'
  66.   i=i-1
  67. end
  68. 'DELETE'
  69.