| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
var StdErr: Text; |
The `StdErr' variable is connected to the standard error file handle. To report errors, you should prefer `WriteLn (StdErr, 'everything wrong')' over `WriteLn ('everything wrong')'.
`StdErr' is a GNU Pascal extension.
program StdErrDemo;
var
Denominator: Integer;
begin
ReadLn (Denominator);
if Denominator = 0 then
WriteLn (StdErr, ParamStr (0), ': division by zero')
else
WriteLn ('1 / ', Denominator, ' = ', 1 / Denominator)
end.
|
section 9.262 StandardError, section 9.185 Output, section 9.122 Input.