Adjusts the beginning position of a sequence within a string

        <cCharacter>]) --> cString


     <cSearchFor>  Designates the character string for which the function
     searches, or the character string that provides the reference point for

     <cString>  Designates the character string within which the
     adjustment occurs.

     <nTargetPosition>  Designates from which position within the
     character string the search expression is adjusted.

     <nCounter>  Designates which occurrence of the <Searchexpression> is
     taken into account.  The default value is for the last occurrence.

     <nIgnore>  Designates the number of characters at the beginning of
     the search string that are removed.  The default value is none.

     <nCharacter|cCharacter>  Designates a character, as necessary, to
     carry out the adjustment.  It can be an individual character or an ASCII
     value between 0 and 255.  The default value is a space CHR(32).


     ATADJUST() returns the modified character string.


     The function first looks for the <cSearchFor> parameter within the
     character string.  From this point, the rest of the <cString> is moved
     (adjusted) by either inserting or removing blanks until the
     <nTargetPosition> is reached.  In lieu of blanks, <nCharacter>|
     <cCharacter> can be used as a fill character.

     Additionally you can specify that the nth occurrence of <cSearchFor> be
     used and whether or not a specific number of characters at the beginning
     of the search string is eliminated.


     .  Using CSETATMUPA() can influence how the search is performed.
        Using SETATLIKE() permits the use of wild cards within the search


     .  Align comments at column 60.  The search is for the first
        occurrence of "//".  Since there is usually at least one space before
        each "//", search for " //":

        ? ATADJUST(" //", Line, 60, 1)

     .  Move the extensions for the following list of file names to
        position 10 and eliminate the ".":


        CHARREM(".", ATADJUST(".", File, 10))

        WINDOW      DBF

        PLZ         DBF
        BACK        DBF
        HELP        DBF
        LOG         DBF

     .  Use ATADJUST() with CSETATMUPA().  There is always a problem
        determining whether "AA" occurs twice or three times in "AAA".
        Depending on CSETATMUPA(), the function searches behind the last
        character, or starts from the last character of a located sequence:

        ? ATADJUST("AA", "123AAABBB", 7, 2)       // Sequence not found

        ? ATADJUST("AA", "123AAABBB", 7, 2)       // "123A  AABBB"


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.