Contents | Prev | Next

7.4.12 The delete procedure

Description

The delete procedure deletes components from a list or a string.

Parameter

  1. The first parameter is a reference to the list variable, or the string variable from which components are deleted.
  2. The second parameter is an expression of integral type, and specifies the position to start deleting components from.
  3. The third parameter is an expression of integral type, and specifies the number of components to delete. If this parameter is omitted then all the components from the start position to the end of the list or string are deleted.

Example

   delete(l, 1)    deletes all components in the list l
   delete(l, 2)    deletes all components from l except the first one
   delete(l, 1, 3) deletes the first three components from l
   delete(s, 1)    deletes all characters from the string s
   delete(s, 2)    deletes all characters from s except the first one
   delete(s, 1, 3) deletes the first three characters from s

Portability

Operating Systems: All
Standard Pascal: No

Contents | Prev | Next