TIP: Click on subject to list as thread! ANSI
echo: delphi
to: JEROEN VAN ROOIJ
from: BRYAN SMITH
date: 1997-06-27 17:09:00
subject: Problem with sets

On 16 Jun 97 Jeroen van Rooij said to Mike Jolls...
 Jv> Do it this way and it will work and it's much easyer to understand:
 Jv> const
 Jv>     Key       =  ['O'..'9', '*', '#' ];
 Jv> var
 Jv>     userinput : char;
 Jv> begin
 Jv>   Read(userinput);
 Jv>   if userinput in Key then
The problem with doing it that way - at least with Turbo Pascal 7 - is that
the code generated wastes time re-constructing that set of characters every
time you hit it. Slowly, too - it adds the characters to the set one-by-one.
If your test is inside a loop, that may not be a wise thing to do.
--- PPoint 2.00
---------------
* Origin: Kingston, Canada (1:249/109.11)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.