Windows Version Numbers

Cubist at aol.com Cubist at aol.com
Wed Aug 13 07:42:01 EDT 2003


sez scott at tactilemedia.com
>I thought the following might prove helpful for folks doing version
>detection on Windows...

[much stuff deleted to conserve bandwidth]

>put word 2 of the systemVersion into V
>if word 1 of the systemVersion = "Windows" then
>  switch
>    case V>=4 and V<4.1
>      put "Windows 95" into tVersion
>      break
>    case V>=4.1 and V<4.9
>      put "Windows 98" into tVersion
>      break
[etc]
   It looks to me like you shouldn't ought to need that "and" in there, 
Scott. If I understand the CASE control structure properly, this should work just 
fine:

put word 2 of the systemVersion into V
if word 1 of the systemVersion = "Windows" then
  switch
    case V<4
      put "Windows 3.x" into tVersion
      break
    case V<4.1
      put "Windows 95" into tVersion
      break
    case V<4.9
      put "Windows 98" into tVersion
      break
    default
      put "Windows ME" into tVersion
  end switch
else
  switch
    case V<4
      put "Windows 98 or so" into tVersion
      break
    case V<5
      put "Windows NT" into tVersion
      break
    case V<5.1
      put "Windows 2000" into tVersion
      break
    default
      put "Windows XP" into tVersion
  end switch
end if

   Hope this helps...



More information about the use-livecode mailing list