FUNCTION extract,in_struct ; ; This function accepts a simple structure, i.e., one whose elements are ; scalars, and returns the elements in an array of the same type and the ; appropriate length. ; len=N_TAGS(in_struct) typ=SIZE(in_struct.(0)) typ=typ(1) CASE typ OF 1: out=BYTARR(len) 2: out=INTARR(len) 3: out=LONARR(len) 4: out=FLTARR(len) 5: out=DBLARR(len) 6: out=COMPLEXARR(len) ELSE: MESSAGE,"unrecognized type of structure elements" ENDCASE FOR i=0,len-1 DO out(i)=in_struct.(i) RETURN,out END