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

2.3.1.4 Assign Variable from Console ($G)

This command lets you assign a variable from console. It is typically used to let the user enter experiment parameters at run time, such as entering a variable (using the keyboard) in the middle of a running testlist.

An integer value is read from the keyboard; the specified variable is set to the value read. This command will skip leading whitespace, and will set the variable to zero if the input could not be converted to a valid number.

The C standard library function fgets() is used to read from the keyboard; in most cases, this will allow the user to use the backspace key to correct an error.

Name:
Assign Variable from Console
Class:
Control
Code:
$G
Syntax:
$Gv1
v1 is a variable reference
System:
Cogsys reads a string from the keyboard, converts it to an integer, and stores the result in the Cogsys variable v1.
Requires:
Although this command will work in any mode, for the user to see the characters being typed, Cogsys must be in a text mode.

Test Files:
`AVKB_T01.IN'
tests basic operation

Examples:

input
$GV12
subject
enters 234 at keyboard
cogsys
assigns 234 to the value of V12



This document was generated by Usman Muzaffar on June, 28 2000 using texi2html