VIN( ) / VIS( ) |
Obtain Value of Variable |
1. |
VIN(string$[,ERR=stmtref]) | |
2. |
VIN(composite$,var_1$[[,subscr]]=expr[, ... n]) | |
3. |
VIS(string$[,ERR=stmtref]) | |
4. |
VIS(composite$,var_1$[[,subscr]]=expr[, ... n]) | |
5. |
REC=VIS(string$[,ERR=stmtref]) |
Where:
composite$ |
String variable that has been defined as a composite string. |
string |
String expression containing the name of a variable to be used. |
stmtref |
Program line number or statement label to which to transfer control. |
[,subscr] |
Optional subscript(s) of a variable in the composite string. String expression. You can include from one to three optional numeric expressions in square brackets, comma-separated, as subscripts for the variable. |
var_1$ to |
String expression containing the name of a variable in the composite string. |
Contents (value) of variable(s), numeric or string.
The VIN( ) function returns the numeric value (contents) of a variable where the name of the numeric variable is stored in a string variable.
The VIS( ) function returns the string value (contents) of a string variable whose name is stored in a string variable.
Get Numeric Value
VIN(string$[,ERR=stmtref])
The VIN( ) function returns the numeric contents of a numeric variable whose variable name is stored in string$.
Get Numeric from Composite
VIN(composite$,var_1$[[,subscr]]=expr[, ... n])
The VIN( ) function returns the value contained in each numeric variable you name (where the variable is part of a composite string). You can choose to specify up to three subscripts for the variable.
Get String Value
VIS(string$[,ERR=stmtref])
The VIS( ) function returns the contents of a string variable whose variable name is stored in string$.
Get String Value from Composite
VIS(composite$,var_1$[[,subscr]]=expr[, ... n])
The VIS( ) function returns the value contained in each string variable you name (where the variable is part of a composite string). You can choose to specify up to three subscripts for the variable.
VIS( ) as Record Prefix
REC=VIS(string$[,ERR=stmtref])
Use this format to assign a REC= prefix value dynamically during READ, WRITE, OPEN and other directives. When REC=VIS( ) is used, PxPlus evaluates the string value in VIS( ) and uses it as the name of the record prefix.
0010 print 'CS'
0020 print "Name$,StreetNum,Street$,City$"
0030 Name$="Mike",StreetNum=8920,Street$="Woodbine Ave.",City$="Markham"
0040 input "Select field type (N=Numeric,S=String)",T$
0050 if T$="" then stop
0060 if ucs(T$)<>"S" and ucs(T$)<>"N" then goto 0030
0070 input "What field?",F$
0080 if F$="" then stop
0090 if ucs(T$)="S" then print F$,"=",vis(F$) else print F$,"=",vin(F$)
0100 goto 0030