Subject: | |
From: | |
Reply To: | |
Date: | Wed, 31 May 2000 13:35:07 -0400 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
Well, I tried your test program, without linking to the special RL
(which Bill Cadier said worked for him), and it works for me also:
/l all
1 program getenv (input, output);
2
3 TYPE
4
5 char_array = packed array [1..80] of char;
6 char_star = ^char_array;
7
8 VAR
9
10 env_name : char_star;
11 envtoget : char_array;
12
13 FUNCTION getenv ( envname : char_array ):char_star;
14 EXTERNAL;
15
16 BEGIN
17
18 envtoget := 'SERVER_NAME';
19 envtoget[12] := CHR(0);
20
21 env_name := getenv (envtoget);
22 IF env_name = NIL THEN
23 writeln('getenv() call failed to get anything...')
24 ELSE
25 writeln('ENV_NAME = ', env_name^);
26
27 END.
/
set lang pasc
'Language' is now PASC
/kq testenv
27 lines saved
/setvar server_name,'SYS1'
/pasxllk testenv,testprogg
PAGE 1 HP PASCAL/iX HP31502A.05.02 COPYRIGHT HEWLETT-PACKARD CO.
1986
WED, MAY 31, 2000, 1:15 PM
0 1.000 0 program getenv (input, output);
0 2.000 0
0 3.000 0 TYPE
0 4.000 0
0 5.000 0 char_array = packed array [1..80] of char;
1 6.000 0 char_star = ^char_array;
2 7.000 0
2 8.000 0 VAR
2 9.000 0
2 10.000 0 env_name : char_star;
3 11.000 0 envtoget : char_array;
4 12.000 0
0 13.000 0 FUNCTION getenv ( envname : char_array
):char_star;
0 14.000 0 EXTERNAL;
0 15.000 0
4 16.000 1 BEGIN
4 17.000 1
4 18.000 1 envtoget := 'SERVER_NAME';
5 19.000 1 envtoget[12] := CHR(0);
6 20.000 1
6 21.000 1 env_name := getenv (envtoget);
7 22.000 1 IF env_name = NIL THEN
8 23.000 1 writeln('getenv() call failed to get
anything...')
9 24.000 1 ELSE
9 25.000 1 writeln('ENV_NAME = ', env_name^);
10 26.000 1
10 27.000 1 END.
NUMBER OF ERRORS = 0 NUMBER OF WARNINGS = 0
PROCESSOR TIME 0: 0: 0 ELAPSED TIME 0: 0: 3
NUMBER OF LINES = 27 LINES/MINUTE = 5664.3
NUMBER OF NOTES = 0
End Run
END OF COMPILE
HP Link Editor/iX (HP30315A.06.10) Copyright Hewlett-Packard Co 1986
LinkEd> link from=$oldpass;to=testprog
END OF LINK
/run testprog
ENV_NAME =
SYS1
End Run
/ e
END OF PROGRAM
Sys1:listf testprog,2
ACCOUNT= SYN GROUP= FLEXUSER
FILENAME CODE ------------LOGICAL RECORD----------- ----SPACE----
SIZE TYP EOF LIMIT R/B SECTORS #X MX
TESTPROG NMPRG 128W FB 119 119 1 128 1 *
Sys1:shell
CWD is "/SYN/FLEXUSER".
########################################################################
MPE/iX Shell and Utilities (A.50.02)
COPYRIGHT (c) Hewlett-Packard Company 1992, All Rights Reserved.
########################################################################
shell/iX> set
@="SH.HPBIN.SYS"
CIERROR="395"
CURRFKEYSET="1"
ENV="/SYN/FLEXUSER/.environ"
ERRNO="27"
...<deleted lines for brevity>...
SECURITYANSWER="0"
SERVER_NAME="SYS1"
TERM="hp2392a"
TZ="EST5EDT"
YPRINTER="0"
_="]"
_SH_CWD1="/SYN/FLEXUSER"
shell/iX>
./TESTPROG
ENV_NAME =
SYS1
shell/iX>
As you can see, I created a standard program file in an MPE group, and
it works in the CI as well as shell. This was done on a 6.0 system.
However, there was recently a discussion about the problems using Pascal
input and output in a CGI program. The paper on Jazz mentions that only
the READ and PRINT intrinsics should be used. I would suggest rereading
the paper I mentioned earlier and trying the techniques in the sample
Pascal program.
|
|
|