Welcome! Log In Create A New Profile

Advanced

Mystery behavior

Posted by gga 
gga
Mystery behavior
August 13, 2023 04:01PM
I have the following code in one of my programs (which is based on one of Glen Rathke's examples).
IF EDT_Reference ~= "" THEN
sTRFilter += "REFERENCE LIKE " +sTmpQuote +"%" +EDT_Reference +"%" + sTmpQuote +sAnd
END
When I run the program in the debugger with EDT_Reference = DEPOSIT and sTRFilter = "", it skips over the line beginning with sTRFilter += ...
but leaves sTRFilter equal to REFERENCE LIKE %%
The strange thing is that if I plug the code beginning with "REFERENCE LIKE"... as an expression into the debugger I get the result that I expected.
The program has been recompiled,repaired,etc but the behavior persists.
I also have the same code in several other of my programs which work just fine.
Anyone have a suggestion on what I might try to fix this?
Thanks,
Garry
Argus
Re: Mystery behavior
August 13, 2023 08:18PM
You -MAY-have a double replacement...

Check in your project property if the option to replace %VariableName% by the content of VariableName automatically at runtime is activated

If yes, and you also have a variable/Field called DEPOSIT (and it happens to be empty at the time this line is run, then you have your code building a string and the compiler replacing DEPOSIT
gga
Re: Mystery behavior
August 13, 2023 08:55PM
Hi Argus,
Thanks for the attempt but I have no field called DEPOSIT and it doesn't matter what I put in EDT_Reference, I get the same result.
Actually another instance of setting sTRFilter has started exhibiting the same behavior and I have been using this WD22 program for years!
Isn't it strange that the value for sTrFilter shows properly in the debugger Expression Pane but is incorrect when I hover over it in the code?
Maybe I should just reboot my machine.
Re: Mystery behavior
August 14, 2023 11:11AM
Hi Garry,

>> Isn't it strange that the value for sTrFilter shows properly in the debugger Expression Pane but is incorrect when I hover over it in the code?

I have seen this a lot lately.
Usually, after a restart, things fix - but what really bothers me with the WX27 IDE, is that sometimes (unexpectedly), I lose "code changes".
Old code reappears, automagically, especially after doing a lot of searches and replaces

Regards
Steven Sitas
gga
Re: Mystery behavior
August 15, 2023 02:55PM
I changed a '~=' to a '>= "" ' and everything works now!
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: