[Gambas-user] Problem with String[]

BB adamnt42 at gmail.com
Mon Nov 21 03:52:53 CET 2022


On 21/11/22 1:05 pm, Jussi Lahtinen wrote:
> Advice for the next time, two ways:
>
> 1. Start your program and pause it (or start it by step). Open the 
> debugging tab (right next to the console tab) and add expression(s) 
> for watch, example "EKT_orderby = null".
> Restart or continue running the program and now it stops right away 
> when the condition you gave is satisfied. If this doesn't work for 
> some reason, try #2 below.
>
> 2. When the error happens see the stack (many times just browsing the 
> stack is enough to see what happened) and place a breakpoint approx in 
> the middle of it.
> Run the program again repeating the thing that raises the error, and 
> see if the object is still null at this point, if so repeat 
> (considering the current line as the error). If not, place the next 
> breakpoint between that line and the occurrence of the actual error. 
> Repeat until you see the offending line.
>
> By using these methods, you should find this kind of problem in just a 
> few minutes, even from a very big project.
> I have a 50k lines project and finding forgotten "new" has never been 
> a problem. But sometimes you just don't see what is front of you. In 
> that case sleep might help...
>
>
> Jussi
>
> Good points, I'd like to add that when looking at the stack make sure 
> your eyes are sharp. I just spent 2 hours trying to find why an event 
> was fired twice and finally found that the stacktrace on the second 
> time (which seemed to be exactly the same as the first)  differed to 
> the first time by _one llne number_! It took me many tries to actually 
> see it. Amazing how the brain fools itself.

As you can see I even had to "rub out" the parts of the screenshots that 
were the same until I finally found it!

b


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20221121/3770bd19/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: banfljcmmifogoge.png
Type: image/png
Size: 36963 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20221121/3770bd19/attachment-0001.png>


More information about the User mailing list