Assignments

Prev Next

Overview

Assignments are one of the key building blocks in B4P and most other programming languages where a value is written (i.e. assigned) to a destination variable or a table entry. Only the actual target variable will be updated, regardless if that variable contains further array and/or structure members. All assignments consist of 3 elements:

LHS Expressions specify destination locations in variables and tables, while RHS Expressions return specified, retrieved, or calculated values.
Assignments

Examples

  echo(Some simple assignments);
  a[]     = 1;
  a[text] = Hello World;
  a[bool] = true;
  a[today] = date(today);
  a[calc]  = 3 + 12*5;
  see(a[]);
Some simple assignments
a[]                     1  "1"                     (numeral,full access)
bool                    true                       (boolean,full access)
calc                    63                         (plain numeral,full access)
text                    Hello World                (softquoted string,full access)
today                   2024-07-14                 (plain date,full access)

Try it yourself: Open LAN_Features_assignments.b4p in B4P_Examples.zip. Decompress before use.

See also

Expressions
Transactions