[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.3.1.3 Assign Variable ($A)

The Assign Variable command directly assigns an integer value to a Cogsys variable.

Name:
Assign Variable
Class:
Control
Code:
$A
Syntax:
$AVv1=value
v1 is a variable reference
value is a number
System:
Cogsys assigns value to the variable specified by v1.

Test Files:
ASNV_T01.IN: Tests basic operation

 
@CPress any key to assign the value 10 to
the Cogsys variable V12 (\$AV12=10)#R
$AV12=10
@1010 Variable V12 now has value $SV12

@1210 Press any key to assign the value of A12 to
@1310 the Cogsys variable V15 (\$AV15=V12)#R
$AV15=V12

@1510 Variable V15 now has value $SV15

@1710 Press any key to exit.#R

ASNV_B01.IN: Measures overhead in 100 assignments

 
@CPress any key to assign the value 10 to
the Cogsys variable V12 100 times#R
#Y[2,0]
$AV12=10$AV12=10$AV12=10$AV12=10$AV12=10$AV12=10$AV12=10
$AV12=10$AV12=10$AV12=10$AV12=10$AV12=10$AV12=10$AV12=10
$AV12=10$AV12=10$AV12=10$AV12=10$AV12=10$AV12=10$AV12=10
$AV12=10$AV12=10$AV12=10$AV12=10$AV12=10$AV12=10$AV12=10
$AV12=10$AV12=10$AV12=10$AV12=10$AV12=10$AV12=10$AV12=10
$AV12=10$AV12=10$AV12=10$AV12=10$AV12=10$AV12=10$AV12=10
$AV12=10$AV12=10$AV12=10$AV12=10$AV12=10$AV12=10$AV12=10
$AV12=10
#Y[2,1]
@1010 100 assignments took $SV5 milliseconds
@1210 Hit any key to exit#R

Examples:

input
$AV12=10
cogsys
variable V12 is set to 10

input
$AV12=V15
cogsys
variable V12 is set to the value of variable V15



This document was generated on November, 24 2008 using texi2html