Question about GetSystemDirectory

Just starting out? Need help? Post your questions and find answers here.
Armoured
Enthusiast
Enthusiast
Posts: 365
Joined: Mon Jan 26, 2004 11:39 am
Location: ITALY
Contact:

Question about GetSystemDirectory

Post by Armoured »

Hi :)
the API function "GetSystemDirectory" use the values stored in the environment variables or not?



Thanks
roachofdeath
User
User
Posts: 78
Joined: Sun Apr 24, 2005 3:22 am

Post by roachofdeath »

Hm, they are the same for me.. maybe not for others though...

Code: Select all

buffer.s = ""
ebuffer.s = ""
GetSystemDirectory_(buffer.s,#MAX_PATH)
GetEnvironmentVariable_("Path",ebuffer.s,#MAX_PATH)
Debug buffer.s
Debug ebuffer.s
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Re: Question about GetSystemDirectory

Post by PB »

You could always change the environment variable and see if the API call
gives the same string? ;)
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

I ran this:

Code: Select all

spot = AllocateMemory(100)
GetSystemDirectory_(spot,100)
Debug PeekS(spot)
and it gave the same value as found in the environment variable. Then I changed the environment variable to read "sysstem32" instead of "system32" and ran it again. It still gave the original value. So, no. I would say it comes from something else. Oh, yeah I better change it back now. :lol:
BERESHEIT
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post by PB »

> It still gave the original value

Did you reboot after changing it? Maybe it needs that? Don't know.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

Did you reboot after changing it? Maybe it needs that? Don't know.
Come on. I'm not going to do all his work for him!
BERESHEIT
Post Reply