HP3000-L Archives

May 2000, Week 5

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
"Born, Ken" <[log in to unmask]>
Reply To:
Born, Ken
Date:
Wed, 31 May 2000 10:15:32 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (36 lines)
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.

ATOM RSS1 RSS2