Forum > Debugger

Pointer range in watches



I'm unclear as to what the behavior should be when setting the bounds between the "+" and "-" in the watch properties.

Please refer to the screenshot. 

I started watching the first 21st elements of an array by setting the "Expression" to:
--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---ProgramData.PD_PE_DATA.PED_RUNTIME_FUNCTIONS.RT_FUNCTIONS_TABLE[0..20] then I wanted to see more elements and simply changed the upper bound to "30" in the properties window but, that seems to be ignored.

My question is: should the new value be ignored because it is outside the bounds of the original boundaries or should the new value in the properties window have replaced the upper bound in the expression ?

It would be nice if it automatically replaced the upper bound in the expression. That would save having to set it manually.

PS: Lazarus v3.99 (trunk) downloaded today (5/27/2024)

It seems it isn't currently documented...

The embedded toolbar by default works inside the range of the returned watch (in your case 0..20).

That is, so that the last page ends at the end of the array. If your 21 entries were paginated on pages with 10 elements, then the last page would only show 1 element. Sparing you the random data after your array. (for the toolbar, this is not distinguishable from a real array, and even if it was it would not know if you had chosen the maximum value for the index)

However, if the start point is forcefully set outside the bounds, then it will give up enforcing those bounds.
So in your case, if you set the start or -1 or 21 then the paging will show more values.
The arrows will not set those values. You have to type them directly into the edit fields.

Since the default for pagination size can be bigger than the array (e.g. an array with 5 elements, but pagination starts at 10 per page), the page size is not used to determine if bounds should be ignored.

Now I understand.  In one case, it's boundary control in the other it's pagination, which is a different thing.

Thank you Martin. :)


[0] Message Index

Go to full version