PAM Programming Manual

Link-Level Programming Examples
PAM Programming Manual142482
B-28
Procedures
{----------- Look for beginning user data size ( bytes ) ---------}
IF Get_Int ( Scan_Blanks ( ( ndx + 1 ) ),
ndx,
10,
begin_user_data_size_B,
0,
Max_User_Data_Size_B ) THEN
BEGIN
WriteLn ( Output, ’Begin User Data Size is bad.’ );
Abend_;
END;
{------------ Grab ending user data size ( bytes ) ---------------}
IF Get_Int ( Scan_Blanks ( ( ndx + 1 ) ),
ndx,
10,
end_user_data_size_B,
begin_user_data_size_B,
Max_User_Data_Size_B ) THEN
BEGIN
WriteLn ( Output, ’End User Data Size is bad.’ );
Abend_;
END;
{------------------- Grab NoWait depth ---------------------------}
IF Get_Int ( Scan_Blanks ( ( ndx + 1 ) ),
ndx,
10,
nowait_depth,
1,
Max_NoWait_Depth ) THEN
BEGIN
WriteLn ( Output, ’NoWait depth is bad.’ );
Abend_;
END;
{------------------ Pick up Foreign Address -----------------------
Convert a string of ASCII digits into a string of hex digits.
------------------------------------------------------------------}
ndx := Scan_Blanks ( ndx + 1 );
Hex_digit_ndx := 0;
WHILE ( ( hex_digit_ndx / 2 ) <
( ZLAM_Val_MAC_Addr_Size_B + 2 ) ) AND
( startup_msg[ ndx + hex_digit_ndx ] <> Ord (’ ’) ) AND
( startup_msg[ ndx + hex_digit_ndx ] <> Ord (’,’) ) DO
BEGIN
IF ( startup_msg[ ndx + hex_digit_ndx ] >= Ord (’0’) ) AND
( startup_msg[ ndx + hex_digit_ndx ] <= Ord (’9’) ) THEN
hex_value := ( startup_msg [ ndx + hex_digit_ndx ] -
Ord ( ’0’ ) )
ELSE IF
( startup_msg[ ndx + hex_digit_ndx ] >= Ord ( ’A’ ) ) AND
( startup_msg[ ndx + hex_digit_ndx ] <= Ord ( ’F’ ) ) THEN
hex_value := 10 + ( startup_msg[ ndx + hex_digit_ndx ] -
Ord ( ’A’ ) )
ELSE
BEGIN
WriteLn ( Output, ’Foreign Addr Digit is bad.’ );
AbEnd_;
END;