>Have you been in the military? First of all, your function does not work with real military time. Military time is NOT expressed as 13:30.... its expressed as 1330 hours. 2400 hours is midnight only and 0001 is 1 minute after midnight. Plugging these values into your function does not return the correct value. If you want it to be capable of handling the ':', you need to do some reworking.
In the sample Jay showed there was : between values. If we use 1330 or 2400 without : then just two first statements have to be modified and : should be added.
How 0101 is handled? Do we always have 0s?
E.g.
lparameters tcTime
if ':' $ m.tcTime
else
lnHours = int(val(left(m.tcTime,2))
lcMins = right(m.tcTime,2)
endif
Actually, looks like it would require a bit more changes. So, from the quick glance the handling of 24:00 format and 2400 format (real military time) should be different.
Since my function was the longest anyway, I leave the exercise to write a new version that can handle both formats to the reader.
Thanks.
If it's not broken, fix it until it is.
My Blog