While not RWFP0012DM.RWFP0009RxQuery.eof do
begin
IF VarIsEmpty(RWFP0012DM.RWFP0009RxQueryQDOLER.AsString) then
begin
RWFP0012DM.RWFP0009RxQuery.Next;
Continue;
end;
// OTHER INSTRUCTIONS
// ....
end;
Can someone explain that?
Thanks in advance.
Rubens Lara
r...@ajato.com.br
Brazil
Ouch! Where did those names come from?
> Can someone explain that?
I did a similar loop in D5, and it worked as expected.
If there isnt a Next in the "other instructions", it'll end up as an endless
loop
Probably better to do:
While not RWFP0012DM.RWFP0009RxQuery.eof do
begin
IF not VarIsEmpty(RWFP0012DM.RWFP0009RxQueryQDOLER.AsString) then
begin
// OTHER INSTRUCTIONS
end;
RWFP0012DM.RWFP0009RxQuery.Next;
end;
--
Dave Nottage
Ed Dressel
> I am using the following code in my application. Using DELPHI 5.0 DEBUG and
> evalueting the IF expression at the third line it returned TRUE. The
> extrange behavior is that program execution jumped to the lines beyond //
> OTHER INSTRUCTIONS comment line. It should have executed the instructions on
> lines 5 and 6.
>
> While not RWFP0012DM.RWFP0009RxQuery.eof do
> begin
Thanks for your time.
You are right about "IF" construction. The "IF not" way you have wrote is
better.
But, the problem is that he program behaves like if the "IF" does not exist.
It allways jumps inside the "IF begin - end;" construction despite of the
logical "VarIsEmpty" expression result is TRUE or FALSE.
I have changed it the way you have suggested and it does not work properly
yet. See the following code:
while not RWFP0012DM.RWFP0009RxQuery.Eof do
begin
if not VarIsEmpty(RWFP0012DM.RWFP0009RxQueryQDOLER.AsString) then
begin
// OTHER INSTRUCTIONS
end;
end;
RWFP0012DM.RWFP0009RxQuery.next;
The "OTHER INSTRUCTIONS" inside the "IF begin - end;" construction is
allways executed despite of the logical "VarIsEmpty" expression result is
TRUE or FALSE.
It's hard to believe ! Can someone explain that?
Thanks again,
Rubens Lara
r...@ajato.com.br
Brazil
> I did a similar loop in D5, and it worked as expected.
>
> If there isnt a Next in the "other instructions", it'll end up as an
endless
> loop
>
> Probably better to do:
>
> While not RWFP0012DM.RWFP0009RxQuery.eof do
> begin
Also, I noticed you are using VarIsEmpty on a string... I would suspect
that to cause strange results, but then I am no expert on variants. I would
suggest changing .AsString to .Value and see what that does.
Brandon Lilly
--
Remove "no_spam" from address to email directly
"Rubens Lara" <rub...@rl-sistemas.com.br> wrote in message
news:8khs6j$u...@bornews.borland.com...
It seems like the action is correct. The CONTINUE statement caused the next
iteration of the WHILE to execute, so it should skip all the statements to
the end of the WHILE loop. Optimization of the WHILE loop may make it look
like it's skipping to the last statement in the WHILE loop. If the test in
the IF statement is true, the // OTHER INSTRUCTIONS should not be executed.
Mark
It seems the DEBUG gave me wrong information.
The solution was:
IF Len(RWFP0012DM.RWFP0009RxQueryQDOLER.Value) > 0 then
....
Regards,
Rubens Lara
"Brandon Lilly" <nospam...@medevolve.com> escreveu na mensagem
news:396c77e9@dnews...
> I have had trouble occasionally with the debugger displaying the wrong
> values. Is it possible that the field value is NULL and not unassigned?
We
> usually have to check for both (VarIsEmpty & VarIsNull)
>
> Also, I noticed you are using VarIsEmpty on a string... I would suspect
> that to cause strange results, but then I am no expert on variants. I
would
> suggest changing .AsString to .Value and see what that does.
>
>
> Brandon Lilly
> --
> Remove "no_spam" from address to email directly
>
>
> "Rubens Lara" <rub...@rl-sistemas.com.br> wrote in message
> > > While not RWFP0012DM.RWFP0009RxQuery.eof do
> > > begin
While not RWFP0012DM.RWFP0009RxQuery.eof do
begin
IF Not (RWFP0012DM.RWFP0009RxQueryQDOLER.IsNull) then
begin
// OTHER INSTRUCTIONS
// ....
end;
RWFP0012DM.RWFP0009RxQuery.Next;
end;
HTH,
Ping
Rubens Lara <rub...@rl-sistemas.com.br> wrote in message
news:8kih2h$8p...@bornews.borland.com...
It really worked fine the way you have proposed.
"Ping Kam" <pk...@quikcard.com> escreveu na mensagem
news:8kj200$do...@bornews.borland.com...