DeleteItem Method (DATASET)


10.8, PLBCMP GUI Only

 

The DeleteItem method finds and deletes a data item in a DATASET using a {key} or {index}. This method uses the following format:

 

[label]

{object}.DeleteItem

[GIVING {return}] [USING [ [*KEY=]{key}][:

 

 

 [*INDEX=]{index}][:

 

 

 [*FLAGS=]{flags}]]

 

Where:

label

Optional. A Program Execution Label.

object

Required. A DATASET object previously declared.

return

Optional. A Numeric Variable that returns a pass (zero) or fail (non-zero) value.

key

Optional. A Character String Variable or literal that contains a key string used to find a data item in the DATASET to be deleted. If both the {key} and {index} keywords are specified, the {key} is used to find the data item to be deleted.

index

Optional. A Numeric Variable, decimal number, or Numeric expression whose numeric value is used to find an item to be deleted.

flags

Optional. A Numeric Variable, decimal number, or Numeric expression that defines a bit mask value that is used to control DeleteItem method behaviorsFlags Affected: EOS, OVER, ZERO

Notes:

  1. The EOS flag is always cleared.

  2. The ZERO flag is set TRUE if the {return} value is zero when the method is completed successfully. If the method fails, the ZERO flag is cleared.

  3. The OVER flag is set if the {return} numeric variable is too small requiring the value to be truncated.

  4. The {flags} bit mask values found in plbmeth.inc are defined as follows:

  5.  

    Equate

    Value

    Description

    $DSF_DELITEM_KEYCASE_SENSITIVE

    0x00000001

    Key string is case sensitive.

     

  6. When this method generates an error, the {return} variable contains an error code value as follows:

  7.  

    Error Code

    Description

    1

    The data item could not be found!

 

 

See Also: Method Syntax, DATASET Methods



PL/B Language Reference