Solved

Case of...

Posted on 1998-02-20
1
170 Views
Last Modified: 2010-04-16
I wonder how you uses a case set when you open a textfile wiht assign
I want to read from a file from the disk and print it on the screen, the text after the case set is going to be printed on the screen

. here is a example of my problem:
Assign(f,r);
      Reset(f);
if not Eof(f) then begin
readln(f,s);
writeln(S);
end;
while not Eof(f) do begin
read(f);
end;
Close(f);


case q of

'A'..'a':writeln ('First vocal in the abc ');        {a}
'E'..'e':writeln ('  Second vocal in the abc ');          {e}
 
0
Comment
Question by:kalle66
1 Comment
 
LVL 6

Accepted Solution

by:
tecbuilder earned 50 total points
ID: 1217361
Case statements only work on ordinal values.  Therefore, you need to convert your character variable q to ord function.  For example:  

case ord(q) of
  65, 97: writeln('First vocal in the abc');
  69, 101: writeln('Second vocal in the abc');
end;

Note:  A = 65 and a = 97.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
detect keyboard input monitoring 3 391
Delphi TSQL Connection runtime creating 1 1,080
Inno Setup -> Add App Pin to Task Bar 1 598
Newbie Thread Programming 1 139
Scenario: Your operations manager has discovered an anomaly in your security system. The business will start to suffer within 15 minutes if it is a major IT incident. What should she do? We have 6 recommendations for managing major incidents (https:…
We need a new way to communicate time sensitive or critical info.   The best part of my role at xMatters is visiting our clients all over the world to learn about how they operate their businesses, share insights that xMatters has gleaned across…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now