next up previous index
Next: M421 Package for Up: CERNLIB Previous: M409 Concentrate and

M410 Manipulating BCD Strings in A1 Representation

Routine ID: M410
Author(s): J. ZollLibrary: KERNLIB
Submitter: C. LetertreSubmitted: 04.09.1972
Language: FORTRAN or AssemblerRevised: 15.09.1978

OBSOLETE

Please note that this routine has been obsoleted in CNL 219. Users are advised not to use it any longer and to replace it in older programs. No maintenance for it will take place and it will eventually disappear.
Suggested replacement: CHPACK (M432)

A1MANI manipulates and interprets BCD-strings in A1 representation.

Structure:

SUBROUTINE and FUNCTION subprograms
User Entry Names: ULEFT, URIGHT, USET, IUFNBL, IULOOK, IUFORW, IUBACK, IUEND
External References: IUCOMP (V304), UBUNCH (M409)
COMMON Block Names and Lengths: /SLATE/ 40

Usage:

Let the vector CH contain BCD characters in A1 format with blank padding. CH(J) is called the j-th character. A section of this vector is specified by (JL,JR) where CH(JL) is the first or left-most, and CH(JR) the last or right-most character.

The COMMON block /SLATE/ ND,NE,... holds certain search parameter, which are set by some of these routines. These parameters can also be accessed with NE=IUEND(ND) , but this is not a recommended procedure.

    CALL ULEFT(CH,JL,JR)
left-justifies the section (JL,JR).
ND
Number of non-blank characters in the field.
CH(NE)
First blank character after left-justifying, or NE=JR+1 if there are no blanks.
    CALL URIGHT(CH,JL,JR)
right-justifies the section (JL,JR).
ND
Number of non-blank characters in the field.
CH(NE)
Last blank character after right-justifying, or NE=JL-1 if there are no blanks.
    CALL USET(INT,CH,JL,JR)
writes the positive integer INT into the area (JL,JR) right-justified. If this integer is too large, the most significant characters are lost. Unused positions are not cleared to blank.
ND
Number of digits which have been set.
CH(NE)
Right-most unchanged character.
    J=IUFNBL(CH,JL,JR)
returns in J the address of the first non-blank character in the area (JL,JR), or JR+1 if none.
    INTEXT=IULOOK(N,CH,JL,JR)
takes the first N (at most) non-blank characters in the section (JL,JR) and returns them as the function value. N must not exceed the BCD-capacity of one computer word.

    I=IUFORW(CH,JL,JR)
reads the unsigned integer whose BCD-representation starts at CH(JL) and stops on the first non-numeric character or at CH(JR). Blanks are ignored.
ND
Number of digits read.
CH(NE)
First non-numeric, non-blank character in the field. NE=JR+1 if pure numeric or blank.
    I=IUBACK(CH,JL,JR)
reads the integer whose BCD-representation starts just after the last non-numeric character in the field and stops at CH(JR). Blanks are ignored.
ND
Number of digits read.
CH(NE)
Last non-numeric, non-blank character in the field. NE=JL-1 if pure numeric or blank.

M421



next up previous index
Next: M421 Package for Up: CERNLIB Previous: M409 Concentrate and


Janne Saarela
Mon Apr 3 15:06:23 METDST 1995