SDELETE


PLBCMP Only

 

The SDELETE instruction provides the ability to delete all or part of the Logical String from a character string variable. This may be extremely useful on variables that contain one or more field(s) that need removal. The instruction uses the following format:

 

 

[label]

SDELETE

{dest}[{sep}{count}]

 

Where:

label

Optional. A Program Execution Label.

dest

Required. A previously defined Character String Variable in which characters are deleted.

sep

Required. A comma or one of the following prepositions: BY, TO, OF, FROM, USING, WITH, IN, or INTO.

count

Required. A previously defined Numeric Variable, Expression, or decimal constant indicating the number of characters to delete.

Flags Affected: EOS, OVER, ZERO

Note the following:

  1. SDELETE attempts to delete {count} number of bytes between the Form Pointer and the Length Pointer in {dest}. If {count} is not given, the entire Logical String is deleted. Once deleted, the bytes beyond the Length Pointer are shifted left to the Form Pointer. The bytes after the last byte that was shifted and the Physical Length are blank filled and Length Pointer is decremented by the number of bytes deleted.

  2. If {count} is not specified, the logical string length is used.

  3. If {count} is a FORM variable, only the integer portion (preceding the decimal) is used. If this portion of {count} is equal to zero, the EQUAL Condition Flag is cleared.

  4. If {count} is greater than the size of the Logical String, only the Logical String contents are deleted and the EOS Condition Flag is set.

  5. If {dest} is a Null String, the OVER Condition Flag is set.

  6. The SDELETE instruction is obsolete and the SPLICE instruction should be used instead.

 

 

See Also: Example Code, SINSERT, Character String Instructions

 



PL/B Language Reference SCAN SEARCH