12-19-2016, 04:44 PM
Macro Macro5
;8:00 10m
;10:00 15m
out
str s.getclip ;; get time from clipboard
s.findreplace("m") ;; remove letter 'm'
ARRAY(str) a ;; array to hold tokenized items
int ntok=tok(s a) ;; tokenize string
;for int'i 0 a.len ;; double check
,;out a[i]
int min1=val(a[2]) ;; get 1st min value
int min2=val(a[5]) ;; get 2nd min value
out _s.format("1st minute = %d[]2nd minute = %d", min1 min2)
;If you want to use the "10/15" result for your calculation, then do this
double dMin1 = min1*1.0
double dMin2 = min2*1.0
double result = dMin1/dMin2
str output.format("result = %.2f" result)
out output