Navigation:  Reference > Commands >

Stuff Characters Into a Field

Print this Topic Previous pageReturn to chapter overviewNext page

 

This command will either overwrite a field or insert a field into another field.

 

MID fn/v Required - The receiving field.  Must be of type A.

 

START f/c/e Where to start adding the new characters.  The first character in the receiving_field is character 1.  If no value is given the value will default to 1.

 

NCHR f/c/e The number of characters to add.  If no value is given the program will use the internal size of the FLD value.

 

FLD f/c/e Required - The characters that will be put into the receiving field.  Any type of field may be used; however, the field is not automatically converted to type A.  It will be added in its natural form.

 

INSIf this option is specified the program will insert the characters, moving the current characters to the right starting with the character at the start location.  The characters at the end of the field, if any, will be deleted.  The default is to overwrite the characters at the current location.

 

 

EXAMPLE

Assume you have a field X that has the value of:

 

       X = 'ABCDEFGHIJK'

 

and is 11 characters long (it's full).  If you execute the following two commands (not sequentially) you will get:

 

       MID X START 4 NCHR 2 FLD '12' INS

 

       'ABC12DEFGHI'

 

       MID X START 4 NCHR 2 FLD '12' //This replaces

 

       'ABC12FGHIJK'

 

SEE ALSO

REPLACE()

 


Page url: http://www.cassoftware.com/tas/manual/stuffcharactersintoafield.htm