ERASE: Difference between revisions

From QB64 Phoenix Edition Wiki
Jump to navigation Jump to search
(Created page with "The ERASE statement is used to clear all data from an array. $STATIC array dimensions are not affected. {{PageSyntax}} : ERASE ''arrayName'' [, ''arrayName2''...] {{PageDescription}} * All string array elements become null strings ("") and all numerical array elements become 0. * Multiple arrays can be erased using commas between the array names. * Dynamic arrays must be REDIMensioned if they are referenced after erased. * Dimensi...")
 
No edit summary
 
(One intermediate revision by the same user not shown)
Line 9: Line 9:
* All string array elements become null strings ("") and all numerical array elements become 0.
* All string array elements become null strings ("") and all numerical array elements become 0.
* Multiple arrays can be erased using commas between the array names.
* Multiple arrays can be erased using commas between the array names.
* [[$DYNAMIC|Dynamic]] arrays must be [[REDIM]]ensioned if they are referenced after erased.  
* [[$DYNAMIC|Dynamic]] arrays must be [[REDIM]]ensioned if they are referenced after erased.
* Dimension subprocedure arrays as [[STATIC]] to use [[ERASE]] and not have to REDIM.
* Dimension subprocedure arrays as [[STATIC]] to use [[ERASE]] and not have to REDIM.
* You do not have to include array brackets in an [[ERASE]] call.
* You do not have to include array brackets in an [[ERASE]] call.
Line 15: Line 15:


{{PageSeeAlso}}
{{PageSeeAlso}}
* [https://qb64phoenix.com/forum/showthread.php?tid=1243 Featured in our "Keyword of the Day" series]
* [[DIM]], [[REDIM]]
* [[DIM]], [[REDIM]]
* [[CLEAR]]
* [[CLEAR]]

Latest revision as of 22:32, 25 May 2024

The ERASE statement is used to clear all data from an array. $STATIC array dimensions are not affected.


Syntax

ERASE arrayName [, arrayName2...]


Description

  • All string array elements become null strings ("") and all numerical array elements become 0.
  • Multiple arrays can be erased using commas between the array names.
  • Dynamic arrays must be REDIMensioned if they are referenced after erased.
  • Dimension subprocedure arrays as STATIC to use ERASE and not have to REDIM.
  • You do not have to include array brackets in an ERASE call.


See also



Navigation:
Main Page with Articles and Tutorials
Keyword Reference - Alphabetical
Keyword Reference - By usage
Report a broken link