home *** CD-ROM | disk | FTP | other *** search
/ Archive Magazine 1996 / ARCHIVE_96.iso / discs / gerald / 6_10 / CustomChck / c_o next >
Text File  |  1993-05-05  |  3KB  |  99 lines

  1. %OP%VS4.13 (28-Apr-92), Andrew Murray, R4001 0002 6668 8337 
  2. %OP%DEf
  3. %OP%TNN
  4. %OP%PL0
  5. %OP%HM0
  6. %OP%FM0
  7. %OP%BM0
  8. %OP%LM10
  9. %OP%PT1
  10. %OP%PDDotMatrix
  11. %OP%WC590,1072,464,768,0,5,0,0
  12. %OP%NDo_switch,1
  13. %CO:A,12,89%   Example of use of monitor functions
  14.  
  15. %V%%L%function("example","dat:date","num:number","ref:reference",%LF%"txt:text","any","shortarray:array","longarray:array")
  16. %V%%L%o("example",join(s(@dat),s(@num),s(@ref),s(@txt),%LF%s(@any),s(@shortarray),a(@longarray)))
  17. %V%%L%result(if(@num>4,"OK",%LF%example(@dat+@num,%LF%set_value(@ref,@num)+1,@ref,%LF%join(@txt,char(code("a")+@num)),%LF%oindex(@longarray,1,mod(@num,3)+1),%LF%{@txt,@dat},{@dat;@num;@txt})))
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.    Display function and parameters
  28.  
  29. %V%%L%function("o","f:text","s:text")
  30.  
  31.  
  32.    Use dialogue box
  33.  
  34. %V%%L%result(if(o_switch,o_set(alert(join(@f,"(",o_clip(@s),")"),"Supress","OK")-1),))
  35.  
  36.  
  37.    Use document [o]
  38.  
  39. result(if(o_switch,o_slot([o]all,o_set(o_switch+1),%LF%join(@f,"(",o_clip(@s),")")),))
  40.  
  41.  
  42.    Format parameter to string, identifying its type by one character
  43.  
  44. %V%%L%function("s","v")
  45. %V%%L%result(if(o_switch,o_s(@v,left(type(@v),1)),))
  46.  
  47.  
  48.    Identify array by its first element
  49.  
  50. %V%%L%function("a","v:array")
  51. %V%%L%result(if(o_switch,join("{",o_clip(s(index(@v,1,1))),"}, "),))
  52.  
  53.  
  54.    Display index: array, col, row and (if valid), slot content
  55.  
  56. %V%%L%function("oindex","from:array","c:number","r:number")
  57. %V%%L%o("oindex",join(a(@from),s(@c),s(@r),s(o_i(@from,@c,@r))))
  58. %V%%L%result(index(@from,@c,@r))
  59.  
  60.  
  61.    Set switch/count
  62.  
  63. %V%%L%function("o_set","v:number")
  64. %V%%L%result(set_name("o_switch",@v))
  65.  
  66.  
  67.    Build line of text 
  68.  
  69. %V%%L%function("o_s","v","t:text")
  70. %V%%L%result(join(@t,":",if(@t="t",@v,if(@t="n",string(@v,2),%LF%if(@t="d",o_datestring(@v),"??"))),", "))
  71.  
  72.  
  73.    Extract value, return null if index is invalid
  74.  
  75. %V%%L%function("o_i","from:array","c:number","r:number")
  76. %V%%L%result(if(@r>rows(@from)|@c>cols(@from)|@c=0|@r=0,"",index(@from,@c,@r)))
  77.  
  78.  
  79.    Set value in slot
  80.  
  81. %V%%L%function("o_out","r:reference","v")
  82. %V%%L%result(set_value(@r,@v))
  83.  
  84.  
  85. %V%%L%function("o_slot","to:array","os:number","s:text")
  86. %V%%L%result(o_out(index(@to,1,mod(@os-2,rows(@to))+1),join(string(@os-1,0),"  ",@s)))
  87.  
  88.  
  89.    Remove last two characters
  90.  
  91. %V%%L%function("o_clip","s:text")
  92. %V%%L%result(left(@s,length(@s)-2))
  93.  
  94.  
  95.    Create display string from date
  96.  
  97. %V%%L%function("o_datestring","v:date")
  98. %V%%L%result(join(string(day(@v),0),%LF%choose(month(@v)," Jan "," Feb "," Mar "," Apr "," May ",%LF%" Jun "," Jul "," Aug "," Sep "," Oct "," Nov "," Dec "),%LF%string(year(@v),0)))
  99. %CO:B,12,0%%CO:C,12,0%%CO:D,12,0%%CO:E,12,0%%CO:F,12,0%%CO:G,12,0%%CO:H,12,0%%CO:I,12,0%%CO:J,12,0%%CO:K,12,0%%CO:L,12,0%%CO:M,12,0%%CO:N,12,0%%CO:O,12,0%%CO:P,12,0%%CO:Q,12,0%%CO:R,12,0%%CO:S,12,0%%CO:T,12,0%%CO:U,12,0%%CO:V,12,0%%CO:W,12,0%%CO:X,12,0%%CO:Y,12,0%%CO:Z,12,0%