RSS Forums RSS
Please support our Pascal and Delphi advertiser: Programming Forums
Views: 985 | Replies: 3 | Solved
Join Date: Apr 2007
Location: Glasgow
Posts: 32
Reputation: adotl is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
adotl's Avatar
adotl adotl is offline Offline
Light Poster

Help Pascal : Cant see why program wont run, exits with error.

  #1  
Apr 24th, 2007
Im failing to see what Ive done wrong, the syntax is right but the program wont run for me when I enter in a the else statement works tho....

program Word (input, output);
uses crt;
   var
      number : integer;
      letter: string;
   begin
      {------------Introduction & Setup------------------}
      clrscr;
      {------VERY User-Friendly------}
      Repeat
         writeln('Whats the right letter? ');
         readln(number);
         str(number,letter);
         if (letter ='a') then
            writeln('Correct Answer ')
         else
            writeln(' a needs to be entered');
      Until (letter = 'a');
      {-------------------Printing Results------------------}
      writeln('The answer is ', letter);
      readln;
   end.

Any ideas? Im guessing its something stupid, I just cant seem to see it at the moment.
Last edited by adotl : Apr 24th, 2007 at 7:38 pm.
AddThis Social Bookmark Button
Reply With Quote  

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 8:43 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC