Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Getting Registry keys

Author
Message
Newbi2basic
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 1st Mar 2003 03:38
processor_speed$ as DWORD
processor_speed$ = GET REGISTRY("HARDWARE\DESCRIPTION\System\CentralProcessor\0","~MHz")
processor_name$ = GET REGISTRY$("HARDWARE\DESCRIPTION\System\CentralProcessor\0","ProcessorNameString")
Id$ = GET REGISTRY$("HARDWARE\DESCRIPTION\System\CentralProcessor\0","Identifier")
VendorIdentifier$ = GET REGISTRY$("HARDWARE\DESCRIPTION\System\CentralProcessor\0","VendorIdentifier")


Print "Processor Speed = "+STR$(processor_speed)
Print "Processor Name = "+processor_name$
Print "Identifier = "+Id$
Print "VendorIdentifier= "+VendorIdentifier$
wait key


I need some help with my code for someodd reason i can view all Get Registry$() commands but not that Get Registry() one... Am i doing something wrong.. it should show your Processor speed btu it dont

please help
Why get drunk when you get the same effect from drinking Irn-Bru?? (after about 2 bottles)
MrTAToad
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 1st Mar 2003 03:53
No idea. Could be a bug...

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
Newbi2basic
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 1st Mar 2003 13:16
Must be

Why get drunk when you get the same effect from drinking Irn-Bru?? (after about 2 bottles)
TheCyborg
22
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Denmark
Posted: 1st Mar 2003 16:28
Well. I don't have a key in my registry called "~MHz" or anything similar.

TheCyborg Development.
http://TheCyborg.Amok.dk
The Ultimate Source To DarkBASIC Programming.
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 1st Mar 2003 17:23
You must be running Windows 95 then. This registry entry doesn't exist on that OS.
D Man
22
Years of Service
User Offline
Joined: 3rd Oct 2002
Location: Germany
Posted: 1st Mar 2003 18:07
At least there is one mistake in your code(but it won't work if you fix it).
You store the information from the registry in a variable called "processor_speed$", but then you print a variable
called "processor_speed"(which is usually 0).

"If you can't make it good
make it look good."
Bill Gates
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 1st Mar 2003 18:13
Actually, that's one of the odd things about DBPro. Because he's specifically defined 'processor_speed$' as a DWORD, it is a DWORD despite the $ at the end of the name.

This code compiles and runs, correctly displaying 12345.
MrTAToad
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 1st Mar 2003 19:44
Yes, I thought it was the $ at the end that was causing the problem, but unfortunately it wasn't (and I've got XP).

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!

Login to post a reply

Server time is: 2025-05-18 16:14:40
Your offset time is: 2025-05-18 16:14:40