//_Header //******************************************************************* // NOVA Central Controls --- Lawrence Livermore Laboratory //******************************************************************* // //_Module_Name: TOPTEXTIO _File: [SMDEV.FEP.MOR]TOPTEXTIO.PRX // //_Description: // Some upper level calls on top of TEXTIO //_Call: //_Identifier: { none } //******************************************************************* //_Author: F. Holloway _Creation_Date: 18-MAR-1983 //_Revisions: // 1.000 18-MAR-1983 FWH Initial Key-in. //******************************************************************* //_End module TOPTEXTIO export MOVE_STRING export INTEGER_ASCII export GET_PADDED_STRING_UPPER use TEXTIO procedure MOVE_STRING param Source_String : in ref packed array [1..?N] of char Buffer : out ref packed array [1..?M] of char Next_Index : inout ref 16 bit integer Width : optional in val integer initially 100 endparam declare (N_Chars : integer) N_Chars := N if Width < N do N_Chars := Width endif for I := 1 to N_Chars do if Next_Index <= M do Buffer [Next_Index] := Source_String [I] Next_Index *= +1 endif endfor endprocedure procedure INTEGER_ASCII param NUMBER : IN VAL INTEGER BUFFER : INOUT REF PACKED ARRAY [ 1..?M ] OF CHAR Next_Index : inout 16 bit integer WIDTH : IN VAL INTEGER RADIX : OPTIONAL IN VAL INTEGER INITIALLY 10 show_radix : optional in val boolean initially false include_sign : optional in val boolean initially false endparam declare Temp_Buffer : packed array [1..16] of char enddeclare FORMAT_INTEGER (Number, Temp_Buffer, Width, Radix, Show_Radix, Include_Sign) MOVE_STRING (Temp_Buffer, Buffer, Next_Index, Width) endprocedure procedure GET_PADDED_STRING_UPPER param f: inout ref file s: inout ref packed array [1..?N] of char num : optional out ref integer /// initially 0 eat_line : optional in val boolean initially true endparam GET_PADDED_STRING (f, s, num, eat_line) for C := 1 to N do select S [C] from case $a..$z: declare (Log is 8 bit logical) force log (S[C]) *= AND (NOT 8#40) endselect endfor endprocedure endmodule