pTAL Reference Manual (H06.03+)
RETURN, RETURNSCC, and C/C++ on TNS/E
HP pTAL Reference Manual—523746-005
D-3
Example D-2. C Procedure Extracting Only the Traditional Function Value from a
64-Bit Value (Works Only on TNS/R Systems)
pTAL procedure with two return values:
int proc p (i, j, k) returnscc;
int(16) i;
int(32) .ext j;
int(64) k;
begin
...
return i, j < k; ! Traditional function value is the value of i.
! Expression j < k sets condition code.
end;
C/C++ prototype for accessing pTAL procedure:
_tal _alias ("P") long some_name1 (short i, int* j, long long k);
Example D-3. Migrating a pTAL Procedure With Two Return Values to TNS/E
(Works on TNS/R and TNS/E Systems)
pTAL shell procedure that returns values in the way that C/C++ does:
int proc p_shell (result, i, j, k);
int(32) . result;
int(16) i;
int(32) .ext j;
int(64) k;
begin
int cc;
result := p (i, j, k);
if < then
cc := -1D
else
if > then
cc := 1D
else
cc := 0D;
return cc;
end;
Declaration of pTAL procedure P in Example D-1 on page D-2 :
int proc p (i, j, k) returnscc;
int(16) i;
int(32) .ext j;
int(64) k;
begin
...
return i, j < k; ! Traditional function value is the value of i.
! Expression j < k sets condition code.
end;
C/C++ prototype for accessing pTAL shell procedure:
_tal _alias ("P_SHELL") short xyz
(int* result, short i, int* j, long long k);










