<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>'Error Trapping' Thread RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the thread 'Error Trapping' posted on the 'Pascal' forum at Programmer's Heaven.</description>
    <language>en</language>
    <copyright>Copyright 2013 Programmers Heaven</copyright>
    <pubDate>Wed, 19 Jun 2013 08:06:42 -0700</pubDate>
    <lastBuildDate>Wed, 19 Jun 2013 08:06:42 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>Error Trapping</title>
      <link>http://www.programmersheaven.com/mb/pasprog/211695/211695/error-trapping/</link>
      <description>Hi all,&lt;br /&gt;
&lt;br /&gt;
Can anyone help me with trapping error 106 at runtime with the readln command?&lt;br /&gt;
&lt;br /&gt;
Rgds,&lt;br /&gt;
crashed&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/211695/211695/error-trapping/</guid>
      <pubDate>Wed, 10 Sep 2003 07:10:46 -0700</pubDate>
      <category>Pascal</category>
    </item>
    <item>
      <title>Re: Error Trapping</title>
      <link>http://www.programmersheaven.com/mb/pasprog/211695/211754/re-error-trapping/#211754</link>
      <description>: Hi all,&lt;br /&gt;
: &lt;br /&gt;
: Can anyone help me with trapping error 106 at runtime with the readln command?&lt;br /&gt;
:&lt;br /&gt;
Hi crashed,&lt;br /&gt;
&lt;br /&gt;
excerpt from Turbo Pascal Help:&lt;br /&gt;
&lt;br /&gt;
"Read and ReadLn report this error if a numeric value read from a text file doesn't conform to the proper numeric format."&lt;br /&gt;
&lt;br /&gt;
Ergo, I suggest &lt;br /&gt;
a) using (for testing/trapping only) not a numeric, but a string variable for reading data (this always works) and&lt;br /&gt;
b) setting a breakpoint after reading from file this string. From the string's format You can know what's happening.&lt;br /&gt;
&lt;br /&gt;
Best regards,&lt;br /&gt;
&lt;br /&gt;
gyapesz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/211695/211754/re-error-trapping/#211754</guid>
      <pubDate>Wed, 10 Sep 2003 11:06:46 -0700</pubDate>
      <category>Pascal</category>
    </item>
    <item>
      <title>Re: Error Trapping</title>
      <link>http://www.programmersheaven.com/mb/pasprog/211695/211756/re-error-trapping/#211756</link>
      <description>Hi there!.&lt;br /&gt;
&lt;br /&gt;
Just try this:&lt;br /&gt;
&lt;br /&gt;
var&lt;br /&gt;
   x : integer;&lt;br /&gt;
&lt;br /&gt;
begin&lt;br /&gt;
   write('Type an integer: ');&lt;br /&gt;
   {$I-}&lt;br /&gt;
   readln(x);&lt;br /&gt;
   {$I+}&lt;br /&gt;
   if (IOResult = 0) then writeln('Ok, thanks!')&lt;br /&gt;
      else writeln('I have asked for an integer!!!');&lt;br /&gt;
end.&lt;br /&gt;
&lt;br /&gt;
{$I-} turns off runtime error while reading from a file or from the keyboard!. If there is something bad, function IOResult results different to 0.&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/211695/211756/re-error-trapping/#211756</guid>
      <pubDate>Wed, 10 Sep 2003 11:09:00 -0700</pubDate>
      <category>Pascal</category>
    </item>
    <item>
      <title>Re: Error Trapping</title>
      <link>http://www.programmersheaven.com/mb/pasprog/211695/211867/re-error-trapping/#211867</link>
      <description>: Hi there!.&lt;br /&gt;
: &lt;br /&gt;
: Just try this:&lt;br /&gt;
: &lt;br /&gt;
: var&lt;br /&gt;
:    x : integer;&lt;br /&gt;
: &lt;br /&gt;
: begin&lt;br /&gt;
:    write('Type an integer: ');&lt;br /&gt;
:    {$I-}&lt;br /&gt;
:    readln(x);&lt;br /&gt;
:    {$I+}&lt;br /&gt;
:    if (IOResult = 0) then writeln('Ok, thanks!')&lt;br /&gt;
:       else writeln('I have asked for an integer!!!');&lt;br /&gt;
: end.&lt;br /&gt;
: &lt;br /&gt;
: {$I-} turns off runtime error while reading from a file or from the keyboard!. If there is something bad, function IOResult results different to 0.&lt;br /&gt;
: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Do I need to USE any library??? &lt;br /&gt;
&lt;br /&gt;
Thanks for your help.&lt;br /&gt;
Crashed&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/211695/211867/re-error-trapping/#211867</guid>
      <pubDate>Thu, 11 Sep 2003 04:42:39 -0700</pubDate>
      <category>Pascal</category>
    </item>
    <item>
      <title>Re: Error Trapping</title>
      <link>http://www.programmersheaven.com/mb/pasprog/211695/211907/re-error-trapping/#211907</link>
      <description>: Do I need to USE any library??? &lt;br /&gt;
No!. It runs under TP7 without using any library. I think it's the same under FPC.&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/211695/211907/re-error-trapping/#211907</guid>
      <pubDate>Thu, 11 Sep 2003 06:58:23 -0700</pubDate>
      <category>Pascal</category>
    </item>
  </channel>
</rss>