Simple Variables

Prev Next

Simple Variables

Simple variables contain only one value and posesses no further member variables in form of structures or arrays. Syntax:

Base Variable Name [ ]
- String value or expression
as variable name

  a[] = Hello;
  (a[])[] = Hi; // Parentheses required on left hand side,
                // otherwise seen as "right hand" expression and not "left hand" expression
  (a[] + ' World')[] = Ahoi;
  echo("a[]     = ", a[] );
  echo("a[][]   = ", a[][] ); // Here it's OK
  echo("Hello[] = ", Hello[] );
  echo("Hello World[] = ", Hello World[], new line );

  '1'[] = One; // Even these variable names are valid !
  ' '[] = Space;
  ''[] = Blank;
  'a[]'[] = aaaah;
  echo('1'[], " ", ' '[], " ", ''[], " ", 'a[]'[], new line );

  me too[] = Hmm;
  me  too[] = Me;   // Plain text ignores redundant spaces, same as 'me too'
  'me  too'[] = Mee too;
  echo( me too[], ", ", me  too[], ", ", 'me  too'[] );
a[]     = Hello
a[][]   = Hi
Hello[] = Hi
Hello World[] = Ahoi

One Space Blank aaaah

Me, Me, Mee too
Try it yourself: Open LAN_Features_simple_variables.b4p in B4P_Examples.zip. Decompress before use.