1
! @(#)avesub.prg 19.1 (ES0-DMD) 02/25/03 14:08:44
2
! +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4
! MIDAS procedure avesub.prg for AVERAGE/AVERAGE, /KAPPA, /MEDIAN
7
! use via AVERAGE/method in_specs out_specs [out_option] [draw] [method_parms]
9
! in_specs = CURSOR or inframe,intable
10
! out_specs = + just display data
11
! = :label label of column for intable
12
! = table,:label if CURSOR input used
13
! = descr descriptor name (of inframe)
14
! out_option = A, append flag for descriptor
15
! = C, center_columns flag for table
16
! draw = Y or N for drawing cursor rectangle (only with CURSOR option)
17
! method_parms = no. of iterations for kappa-sigma clipping
19
! +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
21
define/param p1 CURSOR C "Enter inframe,table or CURSOR: "
22
define/param p2 + C "Enter output specs: "
23
define/param p3 + C "Enter output options: "
25
! check, if it's cursor or table input
26
inputi = m$parse(p1,"sub")
27
if inputi .gt. 1 then !inframe,intable
28
write/keyw in_a {sub01}
29
write/keyw in_b {sub02}
31
in_b(1:2) = "+ " !means cursor input
32
define/param p4 Y C "Enter draw flag - Y(es) or N(o): "
35
action(1:1) = mid$cmnd(11:11) !save qualifier
36
if action(1:1) .eq. "K" then
37
define/param p5 1 N "Enter iteration no. for kappa-sigma clipping"
38
write/keyw inputi {p5}
39
elseif action(1:1) .eq. "M" then
40
inputi(2) = 20000 !size of internal buffer (only for Median)
43
write/keyw inputc {p2} !fill output_specs
44
write/keyw inputc/c/51/1 {p3}