- Sat May 07, 2016 5:19 am
#47037
Thanks, and for another lighting fast response.
Bearing in mind that an odd character change in future versions could mess up the quick and simple approach, how best to extract just the last number part for future comparisons?
I've tried with upper()s of instr() and mid() but was getting tangled, so best I ask the experts about this...
The thing is, the comparison check needs to be a one-liner that people can include at the top of their scripts to ensure the ESP_Basic version meets their script requirements of recently added functionality etc, which I suspect may become fairly essential over time for ensuring compatability and longevity of published projects and examples.
It might even allow scripts to automatically adjust for some small syntax changes rather than just erroring, like if the comma gets removed from timer syntax, the script could just do an if then alternative.
So here's the equivalent of what may need to be done...
let ver = (just the number bit of version())
if ver < 23 print "it aint gonna work"
or
if ver > 29 doThis else doThat
If there's an easy way to extract just the number part then great, otherwise might it be worth adding a modifier to the function so it can return just the number part if required?
eg: print version(#)