DeleteArray
DeleteArray ArrayName()
 
Parameters:

    ArrayName() = The name of your pointer array
Returns: NONE
 

      DeleteArray deletes (clears) a pointer arrays redirection pointer. It does NOT delete (undim) the data to which it pointed to, just the pointer.




FACTS:


      * DeleteArray Does not UnDim the memory, just clears this Arrays pointer.



Mini Tutorial :

      This example shows how DeleteArray only deletes a pointer arrays, pointer to another array, and not the array data that it pointer to.

  
; Dimension an array called Table()
  Dim Table(100)
  
; Delcare a Pointer Array called PointerArray()
  MakeArray PointerArray()
  
; Set PointerArray() to point at the Table()'s data
  SetArray PointerArray(),GetArray(table())
  
; Check if the pointer array is valid
  If GetArrayStatus(PointerArray())=false
     Print "PointerArray() does not exist"
  Else
     
   ; If so,  then Display the size of the array the
   ; pointer array points to..  Since it's pointing
   ; at the Table() array, Then it's current size
   ; will be that.
     Print GetArrayElements(PointerArray(),1)
  EndIf
  
  
; Clear PointerArray()'s Array Index Pointer
  DeleteArray PointerArray()
  
  
; Check if PointerArray() is still valid
  If GetArrayStatus(PointerArray())=false
   ; Since PointerArray() was deleted, it
   ; will display this message.
     Print "PointerArray() does not exist"
  Else
     Print GetArrayElements(PointerArray(),1)
  EndIf
  
; Display the TABLE() size, to show the actual
; array wasn't deleted, just PointerArray()'s
; pointer to that array.
  
  Print GetArrayElements(Table(),1)
  
  Sync
  WaitKey
  



This example would output something like the following.

  
  100
  PointerArray() does Not exist
  100
  


 
Related Info: GetArray | MakeArray | SetArray :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com