FutureBasic Logo

<<    Index    >> FutureBasic

index$ D   statement



Syntax
index$ d (element [,indexID])

Description
This statement deletes an element from one of the special index$ string arrays (see the index$ statement and the clear <index> statement for information about how index$ arrays are created). The indexID parameter specifies which of the index$ arrays (0 through 9) to delete an element from ; if this parameter is omitted, index$ array 0 is used. The element parameter specifies which element to delete.

The index$ d statement does not merely assign a null string to the indicated element. Instead, it moves all of the subsequent array elements in memory, in order to fill the "gap" left by the deleted element. As shown in the diagram, this also affect the element numbers by which the moved strings are identified.

This statement is the complement of index$ i, which inserts an element into the array.

Example
This illustrates the difference between deleting an element using index$ d, and "clearing" an element by assigning a null string to it.

index$
element #contents
4Sandy
5Joshua
6Carrie
element #contents
4Sandy
5Carrie
Before After


index$(5) = ""
element #contents
4Sandy
5Joshua
6Carrie
element #contents
4Sandy
5
6Carrie
Before After

See also
CFIndexSort; clear <index>; index$ I; index$ function; index$ statement; indexf; mem