Variable$: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
Line 1: | Line 1: | ||
The '''Variable$''' [[internal function]] returns the name of the variable that failed in the last I/O [[statement]]. Besides being invaluable for [[debugging]], Variable$ can be used as a topic to call [[Help$]]. Note: VARIABLE$ will not be set if the error results from the field specification (error numbers 850 through 890). Also, if the field is a calculation such as A+B, Variable$ will not be set. | The '''Variable$''' [[internal function]] returns the name of the variable that failed in the last I/O [[statement]]. Besides being invaluable for [[debugging]], Variable$ can be used as a topic to call [[Help$]]. Note: VARIABLE$ will not be set if the error results from the field specification (error numbers 850 through 890). Also, if the field is a calculation such as A+B, Variable$ will not be set. | ||
====Example==== | |||
00010 input a,b,c | |||
If at the command line the user types in | |||
4,5,x | |||
then BR will give an error [[726]], because "x" is not an acceptable value for the variable c. | |||
If after getting the error, you type in '''variable$''' at the command prompt, the result will be: | |||
c | |||
<noinclude> | <noinclude> | ||
[[Category:Internal Functions]] | [[Category:Internal Functions]] | ||
</noinclude> | </noinclude> |
Revision as of 09:29, 1 February 2012
The Variable$ internal function returns the name of the variable that failed in the last I/O statement. Besides being invaluable for debugging, Variable$ can be used as a topic to call Help$. Note: VARIABLE$ will not be set if the error results from the field specification (error numbers 850 through 890). Also, if the field is a calculation such as A+B, Variable$ will not be set.
Example
00010 input a,b,c
If at the command line the user types in
4,5,x
then BR will give an error 726, because "x" is not an acceptable value for the variable c.
If after getting the error, you type in variable$ at the command prompt, the result will be:
c