LU 6.2 API Application Programmer's Reference Guide (30294-90008)

Appendix B 177
Sample Programs
Pascal Program
{************************************************************
DisplayAcceptance
This procedure evaluates the Risk Code received from the
remote TP to determine whether to approve or deny credit,
and then it writes a message to the user's terminal.
************************************************************}
procedure DisplayAcceptance (RiskCode : shortint;
var Quit_SW : boolean);
begin
if ord(RiskCode) << ord(ACCEPT_CODE) then
writeln ('Credit Denied.')
else
writeln ('Credit Approved.');
QuitScreen (Quit_SW);
end;
$PAGE$
{************************************************************
DisplayErrorMessage
This procedure evaluates the errorcode returned by the
remote TP and writes an error message to the user's
terminal. The remote TP can return any of 3 error codes:
001 - The SS# is not in the database.
002 - The SS# is in the database, but the name does
not match the name sent by the HP 3000.
003 - Miscellaneous system errors.
Error codes 001 and 002 cause this procedure to call
QuitScreen. Error code 003 causes this procedure to
set Quit_SW to YES_SW.
************************************************************}
procedure DisplayErrorMessage (ErrorCode : shortint;
var Quit_SW : boolean);
begin
if ErrorCode = SYSTEM_ERROR_CD then
begin
writeln (errorcode:4);
Quit_SW := YES_SW;
end
else
begin
if ErrorCode = SOCSEC_ERROR_CD then
writeln ('SS# not on file - Credit Denied.')
else
writeln ('Invalid Name');
QuitScreen (Quit_SW);