How to determine OS, which version, and which ver of windoz?

I realized that this article includes way out of date information for the Mac (heck, 6 months old is way out of date at the moment). For the API way of getting the version number on OS X please see this posting here https://forum.xojo.com/16320-recognize-version-of-os-x/p2#p134864