TIP: Click on subject to list as thread! ANSI
echo: delphi
to: GARY WEINFURTHER
from: STEVE BATSON
date: 1997-03-11 14:02:00
subject: Works in D1 but not D2

GW> The first line will always evaluate to true.  And you are executing 
GW> the same statement in either of your cases.
GW> Try the following:
GW>  CharByte := CharByte xor Ord(Key[Ctr]);
GW>  if not (CharByte in [0, 32]) then
GW>      FBuffer[x] := CharByte;
GW>  if Ctr > KeyLen then
GW>      Ctr := 0;
GW> I assume you have this in a loop.  If so, it will slow down the 
GW> process tremendously to call Application.ProcessMessages on every 
GW> iteration.  Looping through a string is a very fast process and you 
GW> don't need to worry about giving time back to Windows during this 
GW> period.
Yeah, it is in a loop.  I also relized after someone responded that I hadn't 
incremented my counter. And I probably should take out th 
Application.ProcessMessages. I usually leave that in loops when I am 
debugging, especially 16 bit stuff so I can get control faster if I need it 
while the app is running. Still have much tuning to do. I feel kinda 
embarrased about this one, I should have spotted the problems.  Oh well... 
Steve
--- FreeMail 1.07b
(1:203/21)
---------------
* Origin: The Visual Programmer's Workshop - N.H., Ca (916)338-3230 *

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™.