On 1 October 2011 04:15, James Paige <[email protected]> wrote:
> On Fri, Sep 30, 2011 at 03:37:59PM +1300, Ralph Versteegen wrote:
>> On 29 September 2011 18:12,  <[email protected]> wrote:
>> > james
>> > 2011-09-28 22:12:00 -0700 (Wed, 28 Sep 2011)
>> > 116
>> > Fix crash in sliceedit.bas. Several arrays were being staticly DIMed when 
>> > they should have been dynamically REDIMed
>> > ---
>> > U   wip/sliceedit.bas
>>
>> May I suggest a convention of writing a REDIM statement without the
>> 'as type' when resizing an existing array? I find the fact that REDIM
>> is both a variable definition and a statement an infuriating feature
>> of FB. However it seems that in some cases (global arrays), fbc can't
>> even tell the difference itself, so we couldn't be totally strict
>> about it.
>
> Okay. I'll avoid adding the type to that kind of REDIM.
>
> Oh! This reminds me! I noticed that some of our resizing arrays are
> accompanied by a pointer, like:
>
>  REDIM PRESERVE plotslices(LBOUND(plotslices) TO UBOUND(plotslices) *
> 1.5 + 32)
>  plotslicesp = @plotslices(1)
>
> I was wondering what the meaning of plotslicesp is. It didn't seem to
> have any obvious purpose.
>
> ---
> James

(gdb) p PLOTSLICES
$1 = <unknown type>
(gdb) p PLOTSLICESP
$2 = (SLICE **) 0x82903d8
(gdb) source misc/gdbscripts
(gdb) help parray
        parray ARRAYNAME TYPE [PRINTOPTION]
        Prints an entire dynamic FreeBASIC array, cast to
        the specified TYPE (you may use types like 'int').
        There are 4 formatting options. Optionally specify 0
        (default), 1, 2 or 3 as PRINTOPTION. Try 2 or 3
        (warning: slow) when dealing with a UDT array, use
        3 to pretty print structures. 0 or 1 take advantage
        of builtin array printing and repeat squashing,
        necessary for large integer arrays.
        Eg.
        DIM array(300, 3) as integer
        gdb> parray ARRAY int 1
(gdb) parray PLOTSLICES SLICE*
PLOTSLICES(1 TO 64):
(*)=  {0x83a20a0,
  0x83a12c8,
  0x83a1510,
  0x8393258,
  0x8393350,
  0x8393448,
  0x8393568,
  0x83976d0,
  0x83977c8,
  0x83978c0,
  0x83979b8,
  0x8397ab0,
  0x8397ba8,
  0x8397ca0,
  0x8397d98,
  0x839e5d8,
  0x839e6d0,
  0x839e7a8,
  0x839e880,
  0x839eb98,
  0x0 <repeats 44 times>}
(gdb) parray PLOTSLICES SLICE* 2
PLOTSLICES(1 TO 64):
(1)=(SLICE *) 0x83a20a0
(2)=(SLICE *) 0x83a12c8
(3)=(SLICE *) 0x83a1510
(4)=(SLICE *) 0x8393258
etc.
_______________________________________________
Ohrrpgce mailing list
[email protected]
http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org

Reply via email to