It is currently Tue Jan 26, 2021 1:03 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 48 posts ]  Go to page Previous  1, 2, 3, 4  Next
Author Message
 Post subject:
PostPosted: Mon Mar 08, 2004 7:38 pm 
Offline
User
User

Joined: Sun Feb 15, 2004 8:04 pm
Posts: 92
Location: Manchester, UK
Sorry, I saw this and just had to improve it...!!

Code:
Procedure.l GetOSVersion()
  Vers.l = OSVersion()

  select vers
    case #PB_OS_Windows_NT3_51
      procedurereturn 1
    case #PB_OS_Windows_95
      procedurereturn 2
    case #PB_OS_Windows_NT_4
      procedurereturn 3
    case #PB_OS_Windows_98
      procedurereturn 4
    case #PB_OS_Windows_ME
      procedurereturn 5
    case #PB_OS_Windows_2000
      procedurereturn 6
    case #PB_OS_Windows_XP
      procedurereturn 7
    case #PB_OS_Windows_Future
      procedurereturn 8
  endselect 

  procedurereturn -1
EndProcedure


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Mar 08, 2004 10:37 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Fri Oct 10, 2003 12:42 am
Posts: 346
Location: Tampa,FL,USA
LoL, thanks for improving my code, I am still kinda new to programming and still don't know the most efficient way of doing things. I was just trying to make sence out of the OSVersion()

_________________
>>> http://treebolt.xentek.net/newsite


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Mar 09, 2004 1:16 am 
Offline
PureBasic Expert
PureBasic Expert

Joined: Fri Apr 25, 2003 5:24 pm
Posts: 7581
> I was just trying to make sence out of the OSVersion()

These two examples were made directly from the manual/help:

Code:
Select OSVersion()
  Case #PB_OS_Windows_NT3_51 : Debug "You are running NT 3.51"
  Case #PB_OS_Windows_95 : Debug "You are running 95"
  Case #PB_OS_Windows_NT_4 : Debug "You are running NT 4"
  Case #PB_OS_Windows_98 : Debug "You are running 98"
  Case #PB_OS_Windows_ME : Debug "You are running ME"
  Case #PB_OS_Windows_2000 : Debug "You are running 2000"
  Case #PB_OS_Windows_XP : Debug "You are running XP"
  Case #PB_OS_Windows_Future : Debug "You are running Unknown"
EndSelect


Code:
If OSVersion()=>#PB_OS_Windows_98
  Debug "You are running 98 or higher."
EndIf


Top
 Profile  
Reply with quote  
 Post subject: ..
PostPosted: Tue Mar 09, 2004 10:36 am 
Offline
Addict
Addict
User avatar

Joined: Thu Oct 16, 2003 8:30 pm
Posts: 1998
Location: North Florida
GPI wrote:
Quote:
@GPI
Why you had to say badwords just for that? :(


Some Standard "Words":
Code:
AFAIK : as far as i know
BTW: by the way
FAQ(S): Frequently asked question(s)
FUP(2): Floow up (to)
IM([NS]H)O: in my([not so] humble) opinion
LOL: laughing out loud
OT: off topic
Q&A: questions and answers
RTFL: rolling on the floor laughing
RT(F)M: read the (fucking) manual
THX: thanks
TIA: thanks in advance


Freak said, that you should see in the help-file about "osversion()" and then you ask for something, which stand in the help-file.


Hmm, and I've been using rofl all these years.. ;)
Code:
ROFL: rolling on the floor laughing


- john


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Mar 09, 2004 11:15 am 
Offline
Administrator
Administrator

Joined: Fri May 17, 2002 4:39 pm
Posts: 14181
Location: France
I don't see the point of the 'GetOSVersion()' wrapper. The PB constants are already sorted in this order and are much more explanatory than using 1, 2, 3, 4 or wathever :)


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Mar 09, 2004 11:15 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Fri Oct 10, 2003 12:42 am
Posts: 346
Location: Tampa,FL,USA
LMAO: Laugh my ass off

_________________
>>> http://treebolt.xentek.net/newsite


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Mar 09, 2004 3:00 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Mon Jun 02, 2003 1:06 pm
Posts: 713
Location: Norway
and to combine a couple, for the ultimate:
ROFLMAO - Rolling On the Floor Laughing My Ass Off

:lol: :wink:

_________________

AMD Athlon XP2400, 512 MB RAM, Hercules 3D Prophet 9600 256MB RAM, WinXP
PIII 800MHz, 320 MB RAM, Nvidia Riva Tnt 2 Mach 64 (32MB), WinXP + Linux
17" iMac, 1.8 GHz G5, 512 MB DDR-RAM, 80 GB HD, 64 MB Geforce FX 5200, SuperDrive, OSX


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Mar 09, 2004 7:12 pm 
Offline
Enthusiast
Enthusiast

Joined: Sat Apr 26, 2003 7:24 pm
Posts: 449
Location: Germany
*lol* can also mean: Lots of Laughs

_________________
The truth is never confined to a single number - especially scientific truth!


Top
 Profile  
Reply with quote  
 Post subject: ..
PostPosted: Wed Mar 10, 2004 12:51 am 
Offline
Addict
Addict
User avatar

Joined: Thu Oct 16, 2003 8:30 pm
Posts: 1998
Location: North Florida
Code:
OS = Val(Bin(OSVersion()))

Select OS
  Case 101
    Debug "Windows NT 3.51"
  Case 1010
    Debug "Windows 95"
  Case 10100
    Debug "Windows NT 4.0"
  Case 11110
    Debug "Windows 98"
  Case 101000
    Debug "Window ME"
  Case 110010
    Debug "Windows 2000"
  Case 111100
    Debug "Windows XP"
  Case 1100100
    Debug "Future Version of Windows"
  Default
    Debug "Hmmm?"
EndSelect


rofl

- np


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Mar 10, 2004 1:36 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Fri Oct 10, 2003 12:42 am
Posts: 346
Location: Tampa,FL,USA
Quote:
Default
Debug "Hmmm?"


ROFLMAO!!!!! ;)

_________________
>>> http://treebolt.xentek.net/newsite


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Mar 10, 2004 6:02 am 
Offline
User
User

Joined: Mon Mar 08, 2004 7:17 am
Posts: 23
Code:
Select OSVersion()
  Case #PB_OS_Windows_NT3_51 : Debug "lmfao"
  Case #PB_OS_Windows_95     : Debug "rofl"
  Case #PB_OS_Windows_NT_4   : Debug "lol"
  Case #PB_OS_Windows_98     : Debug "stfu"
  Case #PB_OS_Windows_ME     : Debug "smd"
  Case #PB_OS_Windows_2000   : Debug "nm"
  Case #PB_OS_Windows_XP     : Debug "gj"
  Case #PB_OS_Windows_Future : Debug "wtf?"
EndSelect


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Mar 10, 2004 6:20 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sat Aug 02, 2003 11:22 pm
Posts: 759
Location: OR, USA
is it me or is this topic is way off

_________________
~Dreglor


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Mar 10, 2004 10:20 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Mon Jun 02, 2003 1:06 pm
Posts: 713
Location: Norway
Dreglor wrote:
is it me or is this topic is way off


It's probably just you... :lol:

_________________

AMD Athlon XP2400, 512 MB RAM, Hercules 3D Prophet 9600 256MB RAM, WinXP
PIII 800MHz, 320 MB RAM, Nvidia Riva Tnt 2 Mach 64 (32MB), WinXP + Linux
17" iMac, 1.8 GHz G5, 512 MB DDR-RAM, 80 GB HD, 64 MB Geforce FX 5200, SuperDrive, OSX


Top
 Profile  
Reply with quote  
 Post subject: ..
PostPosted: Wed Mar 10, 2004 3:59 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Oct 16, 2003 8:30 pm
Posts: 1998
Location: North Florida
Dreglor wrote:
is it me or is this topic is way off


Code:
Declare.l IsTopicWayOff()

Enumeration
  #_No
  #_Yes
EndEnumeration

If IsTopicWayOff() = #_Yes
  Debug "Maybe just a little..."
Else
  Debug "Nah.. "
EndIf

End



Procedure.l IsTopicWayOff()
  hmm = Random(1)
  If hmm = 0
    ProcedureReturn #_No
  Else
    ProcedureReturn #_Yes
  EndIf
EndProcedure


- np

omg


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Mar 11, 2004 1:04 am 
Offline
Addict
Addict
User avatar

Joined: Sun Mar 07, 2004 8:47 am
Posts: 1861
Location: Argentina
Oooo! 8O I think that... we got the point about the command 8)
Hey guys I just wanted to know why it gave 60.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 48 posts ]  Go to page Previous  1, 2, 3, 4  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 45 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye