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.

    NOTE: In order to clear memory referenced by a Pointer, it must be dereferenced first. Otherwise, Clear will try to clear the bytes at the pointer variable's memory location.

    Example

    'create an array with 100 elements
    Dim array(0 To 99) As Integer

    'clear the contents of the array to 0, starting with the first element
    Clear array(1), , 100 * SizeOf(Integer)


    'allocate 20 bytes of memory
    Dim As Byte Ptr p = Allocate(20)

    'set each of the first ten bytes to 0
    Clear *p, 0, 10

    'set each of the next ten bytes to 42
    Clear p[10], 42, 10

    'check the values of the allocated bytes
    For i As Integer = 0 To 19
        Print i, p[i]
    Next

    'deallocate memory
    Deallocate p


    Differences from QB

    • The behavior and usage is 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

    Знаете ли Вы, что, как не тужатся релятивисты, CMB (космическое микроволновое излучение) - прямое доказательство существования эфира, системы абсолютного отсчета в космосе, и, следовательно, опровержение Пуанкаре-эйнштейновского релятивизма, утверждающего, что все ИСО равноправны, а эфира нет. Это фоновое излучение пространства имеет свою абсолютную систему отсчета, а значит никакого релятивизма быть не может. Подробнее читайте в FAQ по эфирной физике.

    НОВОСТИ ФОРУМА

    Форум Рыцари теории эфира


    Рыцари теории эфира
     10.11.2021 - 12:37: ПЕРСОНАЛИИ - Personalias -> WHO IS WHO - КТО ЕСТЬ КТО - Карим_Хайдаров.
    10.11.2021 - 12:36: СОВЕСТЬ - Conscience -> РАСЧЕЛОВЕЧИВАНИЕ ЧЕЛОВЕКА. КОМУ ЭТО НАДО? - Карим_Хайдаров.
    10.11.2021 - 12:36: ВОСПИТАНИЕ, ПРОСВЕЩЕНИЕ, ОБРАЗОВАНИЕ - Upbringing, Inlightening, Education -> Просвещение от д.м.н. Александра Алексеевича Редько - Карим_Хайдаров.
    10.11.2021 - 12:35: ЭКОЛОГИЯ - Ecology -> Биологическая безопасность населения - Карим_Хайдаров.
    10.11.2021 - 12:34: ВОЙНА, ПОЛИТИКА И НАУКА - War, Politics and Science -> Проблема государственного терроризма - Карим_Хайдаров.
    10.11.2021 - 12:34: ВОЙНА, ПОЛИТИКА И НАУКА - War, Politics and Science -> ПРАВОСУДИЯ.НЕТ - Карим_Хайдаров.
    10.11.2021 - 12:34: ВОСПИТАНИЕ, ПРОСВЕЩЕНИЕ, ОБРАЗОВАНИЕ - Upbringing, Inlightening, Education -> Просвещение от Вадима Глогера, США - Карим_Хайдаров.
    10.11.2021 - 09:18: НОВЫЕ ТЕХНОЛОГИИ - New Technologies -> Волновая генетика Петра Гаряева, 5G-контроль и управление - Карим_Хайдаров.
    10.11.2021 - 09:18: ЭКОЛОГИЯ - Ecology -> ЭКОЛОГИЯ ДЛЯ ВСЕХ - Карим_Хайдаров.
    10.11.2021 - 09:16: ЭКОЛОГИЯ - Ecology -> ПРОБЛЕМЫ МЕДИЦИНЫ - Карим_Хайдаров.
    10.11.2021 - 09:15: ВОСПИТАНИЕ, ПРОСВЕЩЕНИЕ, ОБРАЗОВАНИЕ - Upbringing, Inlightening, Education -> Просвещение от Екатерины Коваленко - Карим_Хайдаров.
    10.11.2021 - 09:13: ВОСПИТАНИЕ, ПРОСВЕЩЕНИЕ, ОБРАЗОВАНИЕ - Upbringing, Inlightening, Education -> Просвещение от Вильгельма Варкентина - Карим_Хайдаров.
    Bourabai Research - Технологии XXI века Bourabai Research Institution