Reserved variables

Varivables which will be Automatically defined.

Rice have variables that will be automatically defined by the system. These are called reserved variables.


__count

__index

__key

__value

__error

Note that the names of reserved variables start with double underscores.

__count

__count is a reserved variable which will be defined automatically when the loop control reaches to the while, fromto, keepon, and each statement.

__count is a variable of int. It is initialized with the number of loops that starts from zero.

__count does not cause the overflow like a normal int. If __count has exceeded the maximum value of the int, it will be automatically back to zero.

__index

__index is a reserved variable which will be defined automatically when the loop control reaches to the while, fromto, keepon, and each statement.

__index is a variable of int.

In the fromto statement, it is initialized with the current loop index value.

In the while, keepon, and each statement, it is initialized with the number of loops that starts from zero.

__key

__key is a reserved variable which will be defined automatically when the loop control reaches to the each statement.

__key is a variable of string. It is initialized with a key of the element of the dictionary. If the collection is not a dictionary, __key is an empty string.

__value

__value is a reserved variable which will be defined automatically when the loop control reaches to the each statement.

__value is initialized with a element of the collection. Class of __value depends on class of the element.

__error

__error is a reserved variable which will be defined automatically when the control reaches to the catch clause of the try statement.

__error is a variable of error class.

Copyright © Rice All rights reserved.