Master BAW
2012-07-06 11:12:32
Hey,
I read in a tutorial that the try..except statement only is usefull for files handling, but I have thought of something that makes it very usefull
for example you can have an array but sometimes a value should exsist but doesnt for some reason…
you then can do this:
I found this usefull and have never read this somewhere before so I share it ;)
I read in a tutorial that the try..except statement only is usefull for files handling, but I have thought of something that makes it very usefull
for example you can have an array but sometimes a value should exsist but doesnt for some reason…
you then can do this:
program new;
var
x: array of integer;
begin
setLength(x,4);
x[0] := 4;
x[1] := 5;
x[2] := 1;
x[3] := 6;
Try
writeln(x[6]);
except
writeln('6 doesnt exsist');
end;
end.I found this usefull and have never read this somewhere before so I share it ;)