home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 7
/
FreshFishVol7.bin
/
new
/
misc
/
sci
/
multiplot
/
rexx
/
setsplit.mpt
< prev
Wrap
Text File
|
1994-04-17
|
2KB
|
126 lines
/* This script joins two data sets */
port= 'MULTIPLOT.01'
RESULT=''
RC=0
/* Check Multiplot is running */
options results
if(~show('p',port)) then do
say "Please start Multiplot first"
exit 1
end
address value port
/* Check a PLOT WINDOW is active */
'QUERY'
if(rc ~=0) then do
say "QUERY command failed!"
exit 1
end
if(compare('PLOWIN',RESULT)<6) then do
'SAY Please select a PLOT WINDOW first.'
exit 1
end
/* Check one (and no more) Data Set is selected */
'PEEK 2 NOVALS'
if(rc =0) then do
'SAY Please select only 1 data set.'
exit 1
end
'PEEK 1 NOVALS'
if(rc~=0) then do
'SAY Please select a data set first.'
exit 1
end
/* Find out point numbers in each Data Set */
'LAUNCH'
'QUE'
if(rc ~=0) then do
'SAY ERROR: Failed to query Data Set.'
exit 1
end
setno1=word(RESULT,8)
pointno=word(RESULT,4)
'STOP'
'SETADD'
'QUERY'
if(rc ~=0) then do
say "QUERY command failed!"
exit 1
end
setno2=word(RESULT,4)
if(compare('CUSTPLOT',RESULT)<8) then do
'SAY SetAdd command failed.'
exit 1
end
'POINT 10 PLUS'
'PLOT BOTH'
'COLOUR 1'
'CONTINUE'
'STOP'
'SELECT SET' setno1
'SELECT REPLACE'
'SELECT SET' setno2
'SELECT ADD'
'PEEK 1 YVALS'
NOVALS=WORDS(YVALS)-pointno+1
'POKE 2 NOVALS'
YVALS=SUBWORD(YVALS,pointno,NOVALS)
'POKE 2 YVALS'
/* Collect values from set */
'PEEK 1 XVALS'
XVALS=SUBWORD(XVALS,pointno,NOVALS)
'POKE 2 XVALS'
'PEEK 1 EVALS'
tempe=EVALS
EVALS=SUBWORD(EVALS,pointno,NOVALS)
'POKE 2 EVALS'
'PEEK 1 EDWN'
tempedwn=EDWN
EDWN=SUBWORD(EDWN,pointno,NOVALS)
'POKE 2 EDWN'
'PEEK 1 XEVALS'
tempxe=XEVALS
XEVALS=SUBWORD(XEVALS,pointno,NOVALS)
'POKE 2 XEVALS'
'PEEK 1 XEDWN'
tempxedwn=XEDWN
XEDWN=SUBWORD(XEDWN,pointno,NOVALS)
'POKE 2 XEDWN'
'SELECT SET' setno1
'SELECT REPLACE'
'PEEK 1 YVALS'
totpoints=WORDS(YVALS)
'SELECT SET' setno1
'SELECT POINT' totpoints
'SELECT REPLACE'
i=totpoints-1
do while(i>=pointno)
'SELECT SET' setno1
'SELECT POINT' i
'SELECT ADD'
i=i-1
end
'DELETE'