| save |
|
grammar |
| |
A
save
statement guarantees that the value and access permissions associated with
a variable defined outside the current block will be restored when
the block ends.
Its usage description can be summarized as follows:
Statement:
save Lvalue ;
save Lvalue = Expression ;
When a block is about to end, the Yoix interpreter executes the code
associated with the last finally statement that it encountered in the block
and then it restores saved variables in the opposite order that they were saved.
Even though
finally
can restore variables,
save
is more efficient and is the only way to reset access permissions.
| |
| Example: |
The program
import yoix.stdio.*;
int dummy = 12;
{
save dummy;
const dummy = 200;
finally {
printf("dummy=%d\n", dummy);
}
}
printf("original dummy=%d\n", dummy);
dummy++;
printf("updated dummy=%d\n", dummy);
prints
dummy=200
original dummy=12
updated dummy=13
on standard output.
| | |
| See Also: |
finally,
reference
|
|
Yoix is a registered trademark of AT&T Inc.
|