home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 7
/
FreshFishVol7.bin
/
bbs
/
misc
/
multiplot-xln-s1.01.lha
/
Multiplot
/
Rexx
/
2SetsJoin.mpt
< prev
next >
Wrap
Text File
|
1994-04-17
|
2KB
|
111 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 two (and no more) Data Sets are selected */
'PEEK 3 NOVALS'
if(rc =0) then do
'SAY Please select only 2 Data Sets.'
exit 1
end
'PEEK 2 NOVALS'
if(rc~=0) then do
'SAY Please select 2 Data Sets first.'
exit 1
end
'PEEK 1 NOVALS'
if(rc~=0) then do
'SAY Please select 2 Data Sets first.'
exit 1
end
/* Find out point numbers in each Data Set */
'LAUNCH'
'QUE'
set1=word(RESULT,words(RESULT))
'STOP'
if(rc ~=0) then do
'SAY ERROR: Failed to query Data Set.'
exit 1
end
'QUE'
set2=word(RESULT,words(RESULT))
'STOP'
if(rc ~=0) then do
'SAY ERROR: Failed to query Data Set.'
exit 1
end
/* Collect values from first set */
'PEEK 2 YVALS'
tempy=YVALS
'PEEK 2 XVALS'
tempx=XVALS
'PEEK 2 EVALS'
tempe=EVALS
'PEEK 2 EDWN'
tempedwn=EDWN
'PEEK 2 XEVALS'
tempxe=XEVALS
'PEEK 2 XEDWN'
tempxedwn=XEDWN
/* Collect values from second set */
'PEEK 1 YVALS'
'PEEK 1 XVALS'
'PEEK 1 EVALS'
'PEEK 1 EDWN'
'PEEK 1 XEVALS'
'PEEK 1 XEDWN'
/* Make space for all values in first set */
NOVALS=WORDS(tempy)+WORDS(YVALS)
'POKE 1 NOVALS'
/* Join values from both Data Sets */
YVALS=INSERT(YVALS,tempy)
XVALS=INSERT(XVALS,tempx)
EVALS=INSERT(EVALS,tempe)
EDWN =INSERT(EDWN,tempedwn)
XEVALS=INSERT(XEVALS,tempxe)
XEDWN=INSERT(XEDWN,tempxedwn)
/* Replace values in first set */
'POKE 1 XVALS'
'POKE 1 YVALS'
'POKE 1 EVALS'
'POKE 1 EDWN'
'POKE 1 XEVALS'
'POKE 1 XEDWN'
/* Delete second set */
'SELECT SET' set2
'SELECT REPLACE'
'DELETE'
/* Plot */
'FULLPLOT'