Next: Fractal Image Output, Previous: Trivial Common Samples, Up: Samples [Index]
real x; x = 3 / 0;
Run as:
aime FILE
to get:
src/aime: FILE: 3: division by zero
file f; f_open(f, "directory/!@#$%^&*(),707", OPEN_READONLY, 0);
Run as:
aime FILE
to get:
src/aime: FILE: 3: cannot open `directory/!@#$%^&*(),707': No such file or directory
list l;
integer i;
# add some number to the empty _l_ list
lb_p_real(l, cos(0));
# append some more numbers
lb_p_real(l, asin(1));
lb_p_real(l, 0);
# print the first four numbers, with maximum 4 digits
i = 0;
while (i < 4) {
o_real(4, l[i]);
o_byte('\n');
i += 1;
}
Run as:
aime FILE
to get:
1 1.5707 0
on standard output and:
src/aime: FILE: 12: out of valid range (-3 .. 2) index (3)
on standard error.