assign

Prev Next

Function Names

assign

Description

This function assigns a value to a variable which is specified in the 1st function parameter containing a code piece or string containing the assignment destination.

Call as: procedure

Restrictions

Indirect parameter passing is disabled

Parameter count

2

Parameters

No.TypeDescription
1
code
variable
:string
destination variable

2
input
all types Value to assign

The specified value provided in this parameter will be assigned in the target variable.

Examples

  v[] = "b[]";

  assign(  c[]  , 456 );
  assign( :v[]  , 123 );
  assign( :"d[]", 789 );
  // Note the required colon.  Otherwise v[] is the variable to assign to.

  echo("Variable b[] = ", b[] );
  echo("Variable c[] = ", c[] );
  echo("Variable d[] = ", d[] );

Output

Variable b[] = 123
Variable c[] = 456
Variable d[] = 789
Try it yourself: Open LIB_Function_assign.b4p in B4P_Examples.zip. Decompress before use.

See also

statements [function]
expression [function]