Steve Batson mentioned this to All:
SB> If (CharByte0) or (CharByte32) then
SB> begin
SB> CharByte:=CharByte xor Ord(Key[Ctr]);
SB> FBuffer[x]:=CharByte;
SB> end;
SB> If (CharByte=0) or (CharByte=32) then
SB> CharByte:=CharByte xor Ord(Key[Ctr]);
SB> If Ctr>KeyLen then
SB> Ctr:=0;
SB> Application.ProcessMessages;
The first line will always evaluate to true. And you are executing the same
statement in either of your cases.
Try the following:
CharByte := CharByte xor Ord(Key[Ctr]);
if not (CharByte in [0, 32]) then
FBuffer[x] := CharByte;
if Ctr > KeyLen then
Ctr := 0;
I assume you have this in a loop. If so, it will slow down the process
tremendously to call Application.ProcessMessages on every iteration. Looping
through a string is a very fast process and you don't need to worry about
giving time back to Windows during this period.
...Gary
--- GoldED 2.41
---------------
* Origin: The Flying Circus BBS, Farmington Hills, MI, USA. (1:2410/905)
|