How can I detect what OS version is running from?

Just starting out? Need help? Post your questions and find answers here.
dagcrack
Addict
Addict
Posts: 1868
Joined: Sun Mar 07, 2004 8:47 am
Location: Argentina
Contact:

How can I detect what OS version is running from?

Post by dagcrack »

I need to detect if the OS that my appl is running from is WINXP or olders.. etc.. This is because some of the features will be different in code but same in function for the user, you know what I mean? some older OS' has problems with some code that works at newer OS'.. and vice versa..
how to detect?
freak
PureBasic Team
PureBasic Team
Posts: 5929
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

Have a look at the OSVersion() command in the help file.

Timo
quidquid Latine dictum sit altum videtur
dagcrack
Addict
Addict
Posts: 1868
Joined: Sun Mar 07, 2004 8:47 am
Location: Argentina
Contact:

Post by dagcrack »

Ahhh thx

I tryed:
Debug OSVersion()


And it showed: 60

???? I don't get it..


_
Running on winxp pro.
GPI
PureBasic Expert
PureBasic Expert
Posts: 1394
Joined: Fri Apr 25, 2003 6:41 pm

Post by GPI »

RTFM!












(Because i think, you dont understand: Read the fucking manual)
merendo
Enthusiast
Enthusiast
Posts: 449
Joined: Sat Apr 26, 2003 7:24 pm
Location: Germany
Contact:

Post by merendo »

*lol*, hehe!

Looks like you are a noob, dagcrack. Seriously, reading the manual helps. You can also take a look at some tutorials available at http://www.reelmediaproductions.com/pb.

Greetz!
The truth is never confined to a single number - especially scientific truth!
dagcrack
Addict
Addict
Posts: 1868
Joined: Sun Mar 07, 2004 8:47 am
Location: Argentina
Contact:

Post by dagcrack »

I didnt had time for reading it... and dont call me noob cause you'll know how noob I am jeez. :evil:
thefool
Always Here
Always Here
Posts: 5881
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

newbie is better. I also ask some pretty stupid questions myself :)
Welocme.
DriakTravo
Enthusiast
Enthusiast
Posts: 346
Joined: Fri Oct 10, 2003 12:42 am
Location: Tampa,FL,USA
Contact:

Post by DriakTravo »

Let us embrace the newbs and teach them. After all, we were all newbs at one point. :)
thefool
Always Here
Always Here
Posts: 5881
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

can i ask a pretty stupid question?

When debug osversion() says 60, is it just the number of the constant or
what it returns? I know how to use it via the "IF" or via "Select case" or something else.
merendo
Enthusiast
Enthusiast
Posts: 449
Joined: Sat Apr 26, 2003 7:24 pm
Location: Germany
Contact:

Post by merendo »

Code: Select all

Debug #PB_OS_Windows_XP
Debug OSVersion()
If your Os is not WinXP, change it to the according constant.

@degrack: Sorry for noob, of course i meant newbie or 'unexperienced user'. You're right, noob is the wrong word.
The truth is never confined to a single number - especially scientific truth!
DriakTravo
Enthusiast
Enthusiast
Posts: 346
Joined: Fri Oct 10, 2003 12:42 am
Location: Tampa,FL,USA
Contact:

Post by DriakTravo »

Here, mabe this will help:

Code: Select all

Procedure.l GetOSVersion()
  ;If this procedure retruns 1, then the os is - Windows NT3 51
  ;If this procedure retruns 2, then the os is - Windows 95
  ;If this procedure retruns 3, then the os is - Windows NT 4
  ;If this procedure retruns 4, then the os is - Windows 98
  ;If this procedure retruns 5, then the os is - Windows ME
  ;If this procedure retruns 6, then the os is - Windows 2000
  ;If this procedure retruns 7, then the os is - Windows XP
  ;If this procedure retruns 8, then the os is - Windows Future
  If OSVersion() = #PB_OS_Windows_NT3_51
    ProcedureReturn 1
  ElseIf OSVersion() = #PB_OS_Windows_95
    ProcedureReturn 2
  ElseIf OSVersion() = #PB_OS_Windows_NT_4
    ProcedureReturn 3
  ElseIf OSVersion() = #PB_OS_Windows_98
    ProcedureReturn 4
  ElseIf OSVersion() = #PB_OS_Windows_ME
    ProcedureReturn 5
  ElseIf OSVersion() = #PB_OS_Windows_2000
    ProcedureReturn 6
  ElseIf OSVersion() = #PB_OS_Windows_XP
    ProcedureReturn 7
  ElseIf OSVersion() = #PB_OS_Windows_Future
    ProcedureReturn 8
  EndIf
EndProcedure
thefool
Always Here
Always Here
Posts: 5881
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

thanks
dagcrack
Addict
Addict
Posts: 1868
Joined: Sun Mar 07, 2004 8:47 am
Location: Argentina
Contact:

Post by dagcrack »

@ merendo
I'm not DEGCRACK, at least try to write my nick as it is :D as I did (emh... Ctrl C Ctrl V :P)

I am just new at this forum.
About PB I started a month ago I call my self a beginner at it.

Dont think that you're the best one... cause you'll end knowing you're no one. (hey I heard that phrase somewhere..)

Don't talk for the others please. :x

@GPI
Why you had to say badwords just for that? :(



Hey well I liked this forum, my name is Gus I'm 17. I have some knowladge of VB B+ B3D and now learning PB. And... I will never call my self an ace guy... and plus.. I will never say "you're a noob!!" cause that's the sad part... shows how lame you are sometimes... well anyway I gotta go, I'm busy at work so we talk later.. BTW.. I did read that part of the manual already :lol: :!:

Hey is there any thread where you guys shows your desktops (real ones.. desks.. your job environment ? ) cause its a funny idea to know how you work.
Dare2
Moderator
Moderator
Posts: 3321
Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land

Post by Dare2 »

Howdy dagcrack,

Seems you got a rather warm-ish welcome from some. :)

Welcome aboard.
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

Post by Kale »

I didnt had time for reading it
C'mon man you've got to help yourself too! otherwise how will you learn?
--Kale

Image
Post Reply