Jump to content




[New Lua Function] os.getVersion (yes I know there is os.version)


  • You cannot reply to this topic
24 replies to this topic

#21 Eric

  • Members
  • 92 posts
  • LocationUK

Posted 23 February 2013 - 10:21 AM

Version identifiers are not decimals and should not be treated as such. Consider:
1.0
1.1
1.2
...
1.8
1.9
1.10
1.11
Those are in order of increasing version, but not numeric or lexographic order.

Keep it as a string, or switch to an array of integers.

#22 NeverCast

  • Members
  • 400 posts
  • LocationChristchurch, New Zealand

Posted 25 February 2013 - 02:20 PM

Might want to look in to why Str>Str works.
http://puu.sh/27V18

I know it's garbage, but I had to check.

#23 GopherAtl

  • Members
  • 888 posts

Posted 25 February 2013 - 04:44 PM

nevercast, uhm. if you're pointing out it compares the first part of the string, then I would think that was rather obvious. Unless they change the name of CraftOS or change their version numbering conventions, the direct string comparison should work at least until version 10.x or x.10, at which point the new version will register as < the earlier, required version, and anyone using this will be forced to update their programs.

#24 immibis

    Lua God

  • Members
  • 1,033 posts
  • LocationWellington, New Zealand

Posted 25 February 2013 - 04:44 PM

View PostNeverCast, on 25 February 2013 - 02:20 PM, said:

Might want to look in to why Str>Str works.
http://puu.sh/27V18

I know it's garbage, but I had to check.
"b" comes after "a".

#25 NeverCast

  • Members
  • 400 posts
  • LocationChristchurch, New Zealand

Posted 25 February 2013 - 05:48 PM

Yeah heard that it's the sum of the bytes of the string that are used for the compare.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users