Solved

Case of...

Posted on 1998-02-20
1
188 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Sometimes clients can lose connectivity with the Lotus Notes Domino Server, but there's not always an obvious answer as to why it happens.   Read this article to follow one of the first experiences I had with Lotus Notes on a client's machine, my…
Resolving an irritating Remote Desktop connection that stops your saved credentials from being used.
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…

705 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