Re: getenv CORRECTION
Jim Brown wrote:
>
> This is still broke. It does not address a SINGLE issue that Derek raised.
> Importantly,
> getenv() never returns 0 on any platform.
>
> equal(getenv(name), "") is what you want to do. But then there are the other
> two issues Derek raised.
>
> Original message:
> <snip>
>
> if equal(getenv(name),0) and platform() = 3
> then return -1
> else return getenv(name) end if
Can something like this be done?
-- what I am trying to say here is:
-- if you Window's return of -1 can mean either that
-- the env variable has not been set, or it is empty,
-- then conform the innocuous ambiguous value to something
-- cross_platform compatible
-- whats good for the Goose is good for the Gander
if equal(getenv(name),-1) and platform() < 3
then return {} -- or " ", if necessary (essentially what George suggested)
else return getenv(name) end if
Ken Rhodes
Folding at Home: http://folding.stanford.edu/
100% MicroSoft Free
SuSE Linux 10.3
No AdWare, SpyWare, or Viruses!
Life is Good,
|
Not Categorized, Please Help
|
|