Variable Attributes

Prev Next

Introduction

In B4P, every variable stored contains following information which help to describe the data stored and the variable form:

Attribute Description
Variable Name A string of choice. Exception: Array members have no names as they are just numbered
Value Stored value (Base Variable)
Data Type Variables can assume any Basic Data Types and subtypes such as string, numeral, etc.
Variable Form Distinguishes whether the variable is a simple variable, an array or a structure, or a simple variable containing zero members
Members Contains all member variables (in arrays and structures). Every member is treated like an individual variable, too.
Member count Number of existing members (0 for simple variables)
Protection Setting Applies rules on accessing and/or modifying these variables, e.g. read-only, prevent deleting, etc. See function protect()
Locked Variables may be temporarily locked during the time while an assignment on that variable is executed or a reference is pointing on this variable. Locked variables cannot be deleted.