I can't get my getenv function to return a value. It always returns a nil.
I had a simple PASCAL program emailed to me to experiment with. I am
wondering if I am not compiling and linking correctly or not pointing to the
correct RL.
The program is as follows and no matter what I put in the getenv function,
it will always return a nil.
What is the correct procedure to compile and link the following program to
work correctly?
Any ideas would be appreciated.
Thanks a bunch....
program getenv (input, output);
TYPE
char_array = packed array [1..80] of char;
char_star = ^char_array;
VAR
env_name : char_star;
FUNCTION getenv ( envname : char_array ):char_star;
EXTERNAL;
BEGIN
env_name := getenv ( 'SERVER_NAME' );
IF env_name = NIL THEN
writeln('getenv() call failed to get anything...')
ELSE
writeln('ENV_NAME = ', env_name^);
END.