basic.%getenv
Gets Unix environment variable.
Syntax
pointer=(char*)%getenv( name)
Description
searches the environment for a string of the form 'name=value' and returns a pointer to 'value' in the current environment if such a string is present, otherwise, a NULL is returned.
Example
* Get the Unix name of our terminal: eg TERM=wy50
pointer=(char*)%getenv( 'TERM' )
if pointer=0 then
crt 'Unix TERM is not defined'
end else
* We got a C pointer to the 'name'. Copy it into Pick
* BASIC variable
char pickterm[32]
%strcpy( pickterm, (char*)p )
pickterm=field(pickterm,char(0),1)
end
See Also
User Comments
What do you think?
Share your experience or ask a question by using the form below.
Login to leave your comments.
