06-11-2016, 12:24 PM
Macro treadmill_log_SetImageLog
The .len of the first item in arr should be '2', but I get '5'
"s" is an actual file and the filename is the date when the picture was taken.
The first item = "10" which is 2 characters in length (len), but why am I getting '5' as an output?
I have tried the same code in a different macro but in stead of the full path I put in "s", i put the only the date in it "10-6-2016" and then it works! (I get '2' in the output pane below)
str s="e:\__qm_testdirs\_treadmill_log_test\log\10-6-2016.JPG"
str fn.getfilename(s) ;; 10-6-2016
ARRAY(str) arr
tok fn arr -1 "-" ;; [0]=10 , [1]=6 , [2]=2016
out arr[0]
out arr[1]
out arr[2]
out arr[0].len ;; OUTPUT: 5 , in stead of 2
The .len of the first item in arr should be '2', but I get '5'
"s" is an actual file and the filename is the date when the picture was taken.
The first item = "10" which is 2 characters in length (len), but why am I getting '5' as an output?
I have tried the same code in a different macro but in stead of the full path I put in "s", i put the only the date in it "10-6-2016" and then it works! (I get '2' in the output pane below)