How do you set conditional breaks based on field values in VS
I remember hearing at conference that you could set a break in VS on the basis of a field contraiinng a given value
eg, break when invoice number = 123456
This would beat adding
if (invNo == 123456)
nop
and then setting a break on the NOP line
Can anyone tell me how to do this >
I am using synergy 10.3.3d, with VS 2017
I set the break point and then right click on the red dot on the context menu choose conditions. I then get an option to add the condition in.
Here is how I tested it.
Create Program
main static record WorkVars i, int endrecord proc for i from 1 thru 100 begin nop end endmain
Click on line 11 (the nop) to set a breakpoint
Right Click on the breakpoint set conditional expression
i == 5 like so:
Execute Program
Doesn't work. Seems like a bug to me? If its an idea I'll vote for it.
I also tried it with a REPEAT loop without a NOP, thinking maybe the compiler removes the NOP line from the IL, but it never executes the Is true conditional. I tried a Hit Count>Is a multiple of >5 conditional and the program locks up. I'll send both issues to Support and see what they say. I'll add a note here with what they tell me. I'll inform them of Rachel's findings that this works in VS2015.
FYI, tested with VS2017 15.5.1, DBL 10.3.3d with 113017hotfixes.
I had the following code
begin
Console.WriteLine(pol_ord_no)
end
Ace if I try your code it does break correctly.
I'm using VS2015 Update 3
Synergy 10.3.3.1-2018 (Synergy.net)
The reason the right-click method is working for Rachel (initially) and not for Ace and Kish is that Rachel is using Synergy .NET, and Ace and Kish appear to be using traditional Synergy, and this functionality is different in those environments. For Synergy .NET, Rachel's method should work. For traditional Synergy, you need to run the following in the immediate window while debugging:
!WATCH invNo == 123456 (alternatively !WATCH .eq. 123456)
This will cause the debugger to break when this condition is met just like in the traditional Synergy debugger.
Hopefully that clears the confusion.
Check out the docs on traditional debugger command here for more detail: http://docs.synergyde.com/index.htm#tools/2_Debugger.htm
You are correct, my test was to a traditional DBL in VS. I was actually going to test with Synergy.Net project after seeing Rachel's post, but am glad you responded first. IMO, this is not a bug, traditional has a different way of setting conditional breaks as per your post. I will NOT be opening a ticket with Support, but others are welcome to if they disagree.
I don't think we'll bother with a ticket but an idea I think would be in order as most Visual Studio Devs that's the interface they're going to expect.
I created an idea https://synergexresourcecenter.force.com/apex/SiteIdea?id=0870d000000Xi3bAAC
Note that the !WATCH work around is closer to setting a Data Breakpoint (https://msdn.microsoft.com/en-us/library/5557y8b4.aspx#Setting%20a%20Data%20Breakpoint%20(native%20C++%20only)) and is NOT the same as a conditional breakpoint.
I haven;t managed to get it working yet.
The latest is when I try to check if a D6 field is equal to a certain value cllog==2445
I get an error
Evaluation of method SynergyDE.DEcimalDesc.cnvrt*( calls into native method Synergex.SynergyDE.SynRtl.WideChartoMultiByte()
Evaluation of native methods in this context is not supported
Issue with Synergy .NET has a tracker:
https://resourcecenter.synergex.com/helpdesk/tracker-view.aspx?id=035914