•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Pascal and Delphi section within the Software Development category of DaniWeb, a massive community of 391,700 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,172 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Pascal and Delphi advertiser:
Views: 872 | Replies: 3 | Solved
![]() |
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....
Any ideas? Im guessing its something stupid, I just cant seem to see it at the moment.
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 6:38 pm.
This is the solution I came up with a few minutes ago....
program Word (input, output);
uses crt;
var
letter: string;
begin
{------------Introduction & Setup------------------}
clrscr;
{------VERY User-Friendly------}
Repeat
writeln('Whats the right letter? ');
readln(letter);
if (letter = 'a') OR (letter = 'b') then
writeln('Correct Answer ')
else
writeln(' a needs to be entered');
Until (letter =UPCASE('a')) OR (letter = 'b');
{-------------------Printing Results------------------}
writeln('The answer is ', letter);
readln;
end.![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb Pascal and Delphi Marketplace
Similar Threads
- build but wont run... hmmm please help. (C++)
- my program is compiled.but on run that i have message "Exception in thread "main" jav (Java)
- Dell wont run (Troubleshooting Dead Machines)
- Script wont run on different computer (Python)
- My c++ cgi-bin program wont allow access to files (C++)
- Program security (When Launched) (C)
Other Threads in the Pascal and Delphi Forum
- Previous Thread: Pascal : Variable for both integer & string?
- Next Thread: help me plssss


Linear Mode