[fpc-pascal] using exceptions

Marco van de Voort marcov at stack.nl
Mon Dec 19 21:04:46 CET 2011


In our previous episode, ik said:
> But we use exceptions even on places such as StrToInt, when the string is
> not an integer number, but we can expect to either have a number or
> something else. So why use an exception there ?

Because much used routines like strtoint are often used without proper
checking. So strtoint throws exceptions, and people that want to handle
errors properly use trystrtoint.
 
> What do you think on this subject ? How would you choose when or where to
> use exceptions and why there ?

Roughly the same as you. Few exceptions, and usually when in to abort fairly
deeply nested code. 



More information about the fpc-pascal mailing list