Clear
 
Clears or initializes some memory

Syntax

Declare Sub Clear cdecl ( ByRef dst As Any, ByVal value As Integer = 0, ByVal bytes As Integer )

Usage

Clear( dst, value, bytes )

Parameters

dst
starting address of some memory
value
the value to set all bytes equal to
bytes
number of bytes to clear

Description

Clear sets one or more bytes in memory to a certain value (the default value is zero (0) if not specified). The starting address is taken from a reference to a variable or array element.

Example

Dim array(1 To 100) As Integer
Clear array(1), 0, Len(array(1)) * UBound(array)


Differences from QB

  • New to FreeBASIC
  • The keyword CLEAR was used in QB to erase all variables, close all files, and optionally change the stack size. This use is not supported in FreeBASIC.

See also