assign ( : : Input : Result )

Assign a new value to a control variable.

assign assigns a new value to a variable. In HDevelop an assignment is treated like an operator. To use an assignment you have to select the operator assign(Input,Result). This operator has the following semantics: It evaluates Input (right side of assignment) and stores it in Result (left side of assignment). However, in the program text the assignment is represented by the usual syntax of the assignment operator: :=. The following example outlines the difference between an assignment in C syntax and its transformed version in HDevelop:

The assignment in C syntax

u = sin(x) + cos(y);
is defined in HDevelop using the assignment operator as
assign(sin(x) + cos(y), u)
which is displayed in the program window as:
u := sin(x) + cos(y)


Parameters

Input (input_control)
real(-array) -> real / integer / string
New value.
Default value: 1

Result (output_control)
real(-array) -> real / integer / string
Variable that has to be changed.


Example
Tuple1 := [1,0,3,4,5,6,7,8,9]
Val := sin(1.2) + cos(1.2)
Tuple1[1] := 2
Tuple2 := []
for i := 0 to 10 by 1
  Tuple2[i] := i
endfor

Result

assign returns 2 (H_MSG_TRUE) if the evaluation of the expression yields no error.


Parallelization Information

assign is reentrant, local, and processed without parallelization.


Alternatives

insert


Module

Basic operators



Copyright © 1996-2005 MVTec Software GmbH