Re: Memory leak with dynamic variables in list boxes?

2018-08-02 Thread mferguson--- via 4D_Tech
Hi All,

The mystery opening the listbox demo database is solved. Apparently, the 
database I downloaded was set to open compiled by default, or my 4D 
installation must have a preference setting to that effect. The solution was to 
first open the 4D software, then navigate to the .db file, and then select the 
interpreted option from the dropdown menu in the lower right corner.

Thank you Miyako and everyone for all your patience and responses.

Michael



> On Aug 2, 2018, at 9:04 AM, John DeSoi via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Try bringing up the "User Interrupt" menu and select the Go to Design Mode 
> option. On the Mac it is control-option-click. Not sure about Windows.
> 
> John DeSoi, Ph.D.
> 
> 
>> On Aug 2, 2018, at 10:55 AM, mferguson--- via 4D_Tech <4d_tech@lists.4d.com> 
>> wrote:
>> 
>> Puzzling. That doesn’t work on my Windows machine. It’s not a licensing 
>> issue because I am developing in v16.  :(
> 
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Memory leak with dynamic variables in list boxes?

2018-08-02 Thread John DeSoi via 4D_Tech
Try bringing up the "User Interrupt" menu and select the Go to Design Mode 
option. On the Mac it is control-option-click. Not sure about Windows.

John DeSoi, Ph.D.
 

> On Aug 2, 2018, at 10:55 AM, mferguson--- via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Puzzling. That doesn’t work on my Windows machine. It’s not a licensing issue 
> because I am developing in v16.  :(

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Memory leak with dynamic variables in list boxes?

2018-08-02 Thread mferguson--- via 4D_Tech
Kirk,

Puzzling. That doesn’t work on my Windows machine. It’s not a licensing issue 
because I am developing in v16.  :(

Michael

> On Aug 2, 2018, at 8:25 AM, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Michael,
> No idea what that's about. Here's what I did when I downloaded and ran it.
> 
> 1) opens to the demo dialog
> 2) closed the dialog
> 
> 
> and I'm in design. If you hit the Mode/Design menu command first just close
> the dialog.
> 
> On Thu, Aug 2, 2018 at 7:52 AM mferguson--- via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> 
>> Uh, when I do that on my machine it gets into the pretend design
>> environment. All the menu items are grayed out.   : )
>> 
> Are you by any chance running it from a read-only volume? Or is the file
> locked? That sounds like a permissions error.
> 
> 
> -- 
> Kirk Brooks
> San Francisco, CA
> ===
> 
> *We go vote - they go home*
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Memory leak with dynamic variables in list boxes?

2018-08-02 Thread Kirk Brooks via 4D_Tech
Michael,
No idea what that's about. Here's what I did when I downloaded and ran it.

1) opens to the demo dialog
2) closed the dialog


and I'm in design. If you hit the Mode/Design menu command first just close
the dialog.

On Thu, Aug 2, 2018 at 7:52 AM mferguson--- via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Uh, when I do that on my machine it gets into the pretend design
> environment. All the menu items are grayed out.   : )
>
Are you by any chance running it from a read-only volume? Or is the file
locked? That sounds like a permissions error.


-- 
Kirk Brooks
San Francisco, CA
===

*We go vote - they go home*
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Memory leak with dynamic variables in list boxes?

2018-08-02 Thread mferguson--- via 4D_Tech
Hi Kirk,

Uh, when I do that on my machine it gets into the pretend design environment. 
All the menu items are grayed out.   : )

Michael


> On Aug 2, 2018, at 7:34 AM, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Hey Michael,
> You don't need the source code. Just download the database zip.
> You have to close the demo dialog to get into design mode (because the
> dialog is opened with the On startup database method).
> 
> On Thu, Aug 2, 2018 at 6:25 AM mferguson--- via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> 
>> Hi Miyako,
>> 
>> The example looks promising, except the source code download only had a
>> text file in it.
>> 
>> Can’t get into the design mode.
>> 
>> Thanks
>> 
>> Michael
>>> On Aug 1, 2018, at 9:20 PM, Keisuke Miyako via 4D_Tech <
>> 4d_tech@lists.4d.com> wrote:
>>> 
>>> Hello,
>>> 
>>> this is 16R6 structure.
>>> 
>>> nothing special, just did what was suggested in the previous post.
>>> 
>>> 
>> https://github.com/4D-JP/4d-tips-office-document-information/releases/tag/iNUG-180802
>>> 
>>> 2018/08/02 11:32、mferguson--- via 4D_Tech <4d_tech@lists.4d.com> 4d_tech@lists.4d.com>>のメール:
>>> If anyone has a working example of assigning dynamic variables to a
>> footer so that SET FOOTER CALCULATION works, I’d really appreciate fairly
>> detailed outline or demo of it.
>>> 
>>> 
>>> 
>>> **
>>> 4D Internet Users Group (4D iNUG)
>>> Archive:  http://lists.4d.com/archives.html
>>> Options: https://lists.4d.com/mailman/options/4d_tech
>>> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
>>> **
>> 
>> **
>> 4D Internet Users Group (4D iNUG)
>> Archive:  http://lists.4d.com/archives.html
>> Options: https://lists.4d.com/mailman/options/4d_tech
>> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
>> **
> 
> 
> 
> -- 
> Kirk Brooks
> San Francisco, CA
> ===
> 
> *We go vote - they go home*
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Memory leak with dynamic variables in list boxes?

2018-08-02 Thread Kirk Brooks via 4D_Tech
Hey Michael,
You don't need the source code. Just download the database zip.
You have to close the demo dialog to get into design mode (because the
dialog is opened with the On startup database method).

On Thu, Aug 2, 2018 at 6:25 AM mferguson--- via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Hi Miyako,
>
> The example looks promising, except the source code download only had a
> text file in it.
>
> Can’t get into the design mode.
>
> Thanks
>
> Michael
> > On Aug 1, 2018, at 9:20 PM, Keisuke Miyako via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> >
> > Hello,
> >
> > this is 16R6 structure.
> >
> > nothing special, just did what was suggested in the previous post.
> >
> >
> https://github.com/4D-JP/4d-tips-office-document-information/releases/tag/iNUG-180802
> >
> > 2018/08/02 11:32、mferguson--- via 4D_Tech <4d_tech@lists.4d.com 4d_tech@lists.4d.com>>のメール:
> > If anyone has a working example of assigning dynamic variables to a
> footer so that SET FOOTER CALCULATION works, I’d really appreciate fairly
> detailed outline or demo of it.
> >
> >
> >
> > **
> > 4D Internet Users Group (4D iNUG)
> > Archive:  http://lists.4d.com/archives.html
> > Options: https://lists.4d.com/mailman/options/4d_tech
> > Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> > **
>
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **



-- 
Kirk Brooks
San Francisco, CA
===

*We go vote - they go home*
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Memory leak with dynamic variables in list boxes?

2018-08-02 Thread mferguson--- via 4D_Tech
Hi Miyako,

The example looks promising, except the source code download only had a text 
file in it.

Can’t get into the design mode.

Thanks

Michael
> On Aug 1, 2018, at 9:20 PM, Keisuke Miyako via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Hello,
> 
> this is 16R6 structure.
> 
> nothing special, just did what was suggested in the previous post.
> 
> https://github.com/4D-JP/4d-tips-office-document-information/releases/tag/iNUG-180802
> 
> 2018/08/02 11:32、mferguson--- via 4D_Tech 
> <4d_tech@lists.4d.com>のメール:
> If anyone has a working example of assigning dynamic variables to a footer so 
> that SET FOOTER CALCULATION works, I’d really appreciate fairly detailed 
> outline or demo of it.
> 
> 
> 
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Memory leak with dynamic variables in list boxes?

2018-08-01 Thread Keisuke Miyako via 4D_Tech
Hello,

this is 16R6 structure.

nothing special, just did what was suggested in the previous post.

https://github.com/4D-JP/4d-tips-office-document-information/releases/tag/iNUG-180802

2018/08/02 11:32、mferguson--- via 4D_Tech 
<4d_tech@lists.4d.com>のメール:
If anyone has a working example of assigning dynamic variables to a footer so 
that SET FOOTER CALCULATION works, I’d really appreciate fairly detailed 
outline or demo of it.



**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Memory leak with dynamic variables in list boxes?

2018-08-01 Thread mferguson--- via 4D_Tech
Hi,

I have tried and I am unable to get Miyako’s suggestion to work in compiled, 
even after modeling after his description and the example he linked to.

If anyone has a working example of assigning dynamic variables to a footer so 
that SET FOOTER CALCULATION works, I’d really appreciate fairly detailed 
outline or demo of it.  Note that there are two senses in which assigning 
dynamic variables can be taken: dynamically declaring a variable, and 
dynamically assigning an already declared compiler variable.  I was hoping not 
to have to pre-declare footer variables, but I don’t see how this is done.

Michael Ferguson


> On Jul 26, 2018, at 11:47 PM, Keisuke Miyako via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> the workaround is to have an extra dynamic variable on the form,
> type it with VARIABLE TO VARIABLE,
> then use it with LISTBOX INSERT COLUMN
> 
> http://forums.4d.com/Post/FR/18014516/1/18014517#18014517
> 
> granted, you would need as many dynamic variable as the columns you insert.
> it's probably easier to use an array instead.
> 
> you could go really tricky and use OBJECT DUPLICATE.
> but I think an array is more simple.
> 
> 2018/07/27 14:14、Flury Olivier via 4D_Tech 
> <4d_tech@lists.4d.com>のメール:
> 
> Works interpreted, but not compiled.
> 
>   https://flury-software.ch/
> 
> 
> 
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Memory leak with dynamic variables in list boxes?

2018-07-27 Thread Keith Culotta via 4D_Tech
Would something like this help...

ARRAY REAL(aFoot;0)  // Use this array to give each column a unique REAL footer 
var

 in the loop 
Append To Array(aFoot;0)
LISTBOX INSERT 
COLUMN(*;$lbName;$i;"C"+$iStr;$nilPtr;"H"+$iStr;$nilPtr;"Foot"+$iStr;aFoot{Size 
of array(aFoot)}) 
 in the loop 

Keith - CDI

> On Jul 27, 2018, at 10:35 AM, mferguson--- via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Hi,
> 
> Thank you for all your responses. I just need to get past this final road 
> block.
> 
> I have gotten dynamic variables to work on headers and footers with the 
> exception of the LISTBOX SET FOOTER CALCULATION.
> 
> Miyako pointed out that the default type for footers is text, and to change 
> it I have to use VARIABLE TO VARIABLE.
> 
> The documentation, in connection with retyping dynamic variables, describes 
> this as 
> if(form event=on load)
> 
> c_text($Init)
> $Ptr_Object:=OBJECT GET POINTER(Object named;”Comments”)
> $init:=””
> VARIABLE TO VARIABLE($Ptr_Object->; init)
> 
> end if
> 
> The documentation also says the dynamic variable can be subsequently be 
> referred to in the manner
> 
> $p:=object get pointer(object named;”start”)
> $p:=?12:00:00?
> 
> I am using an EMPTY current selection listbox on load, footers enabled, with 
> columns being assigned in a loop for the number of columns, using INSERT 
> LISTBOX COLUMN. The example above seems to presume that the column is already 
> assigned in the listbox, but modeling after the above within the loop:
> if(column = the one I want a footer total for)
> c_longint($Init)
> $Ptr_Object:=OBJECT GET POINTER(Object named;”Invoice Amount”)
> $init:=””
> VARIABLE TO VARIABLE($Ptr_Object->; init)
> 
> end if
> 
> This is in client server mode.
> 
> Please verify that the object should be the column name used in INSERT 
> LISTBOX COLUMN, or alternatively, the footer column name.
> 
> I have tried this with getting a pointer to the footer column name used in 
> INSERT LISTBOX COLUMN, and using the dynamically assigned footer name 
> retrieved with GET LISTBOX ARRAYS.
> 
> I get error 54.
> 
> Once I get by this problem I should be able to use
> 
> LISTBOX SET FOOTER CALCULATION(*;XXX;listbox footer sum)
> 
> where XXX is either the footer object name submitted with INSERT LISTBOX 
> COLUMN, or the dynamic footer name retrieved with GET LISTBOX ARRAYS. I don’t 
> know which.
> 
> Thanks,
> 
> Michael
> 
> 
> 
>> On Jul 26, 2018, at 4:30 PM, Keisuke Miyako via 4D_Tech 
>> <4d_tech@lists.4d.com> wrote:
>> 
>> dynamic variables create for footers are typed as text by default.
>> 
>> you need to change it to numeric by replacing it using VARIABLE TO VARIABLE.
>> 
>> 2018/07/27 7:34、mferguson--- via 4D_Tech 
>> <4d_tech@lists.4d.com>のメール:
>> Seems like it should be simple, but I’m missing something.
>> 
>> 
>> 
>> **
>> 4D Internet Users Group (4D iNUG)
>> Archive:  http://lists.4d.com/archives.html
>> Options: https://lists.4d.com/mailman/options/4d_tech
>> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
>> **
> 
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Memory leak with dynamic variables in list boxes?

2018-07-27 Thread mferguson--- via 4D_Tech
Hi,

Thank you for all your responses. I just need to get past this final road block.

I have gotten dynamic variables to work on headers and footers with the 
exception of the LISTBOX SET FOOTER CALCULATION.

Miyako pointed out that the default type for footers is text, and to change it 
I have to use VARIABLE TO VARIABLE.

The documentation, in connection with retyping dynamic variables, describes 
this as 
if(form event=on load)

c_text($Init)
$Ptr_Object:=OBJECT GET POINTER(Object named;”Comments”)
$init:=””
VARIABLE TO VARIABLE($Ptr_Object->; init)

end if

The documentation also says the dynamic variable can be subsequently be 
referred to in the manner

$p:=object get pointer(object named;”start”)
$p:=?12:00:00?

I am using an EMPTY current selection listbox on load, footers enabled, with 
columns being assigned in a loop for the number of columns, using INSERT 
LISTBOX COLUMN. The example above seems to presume that the column is already 
assigned in the listbox, but modeling after the above within the loop:
if(column = the one I want a footer total for)
c_longint($Init)
$Ptr_Object:=OBJECT GET POINTER(Object named;”Invoice Amount”)
$init:=””
VARIABLE TO VARIABLE($Ptr_Object->; init)

end if

This is in client server mode.

Please verify that the object should be the column name used in INSERT LISTBOX 
COLUMN, or alternatively, the footer column name.

I have tried this with getting a pointer to the footer column name used in 
INSERT LISTBOX COLUMN, and using the dynamically assigned footer name retrieved 
with GET LISTBOX ARRAYS.

I get error 54.

Once I get by this problem I should be able to use

LISTBOX SET FOOTER CALCULATION(*;XXX;listbox footer sum)

where XXX is either the footer object name submitted with INSERT LISTBOX 
COLUMN, or the dynamic footer name retrieved with GET LISTBOX ARRAYS. I don’t 
know which.

Thanks,

Michael



> On Jul 26, 2018, at 4:30 PM, Keisuke Miyako via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> dynamic variables create for footers are typed as text by default.
> 
> you need to change it to numeric by replacing it using VARIABLE TO VARIABLE.
> 
> 2018/07/27 7:34、mferguson--- via 4D_Tech 
> <4d_tech@lists.4d.com>のメール:
> Seems like it should be simple, but I’m missing something.
> 
> 
> 
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Memory leak with dynamic variables in list boxes?

2018-07-27 Thread Keisuke Miyako via 4D_Tech
the workaround is to have an extra dynamic variable on the form,
type it with VARIABLE TO VARIABLE,
then use it with LISTBOX INSERT COLUMN

http://forums.4d.com/Post/FR/18014516/1/18014517#18014517

granted, you would need as many dynamic variable as the columns you insert.
it's probably easier to use an array instead.

you could go really tricky and use OBJECT DUPLICATE.
but I think an array is more simple.

2018/07/27 14:14、Flury Olivier via 4D_Tech 
<4d_tech@lists.4d.com>のメール:

Works interpreted, but not compiled.

  https://flury-software.ch/



**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Memory leak with dynamic variables in list boxes?

2018-07-26 Thread Keisuke Miyako via 4D_Tech
correction:

since it is a form local variable,

you should be able to retype it simply by calling C_REAL ($footerPtr->)

2018/07/27 8:30、Keisuke Miyako via 4D_Tech 
<4d_tech@lists.4d.com>のメール:
dynamic variables create for footers are typed as text by default.
you need to change it to numeric by replacing it using VARIABLE TO VARIABLE.



**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Memory leak with dynamic variables in list boxes?

2018-07-26 Thread Keisuke Miyako via 4D_Tech
dynamic variables create for footers are typed as text by default.

you need to change it to numeric by replacing it using VARIABLE TO VARIABLE.

2018/07/27 7:34、mferguson--- via 4D_Tech 
<4d_tech@lists.4d.com>のメール:
Seems like it should be simple, but I’m missing something.



**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Memory leak with dynamic variables in list boxes?

2018-07-26 Thread mferguson--- via 4D_Tech
Hi,

I converted it to use dynamic variables for the listbox columns insert, passing 
in nil pointers for the header and footer variables. It works great for regular 
columns but I can’t get it to work for footers.

Specifically:

LISTBOX SET FOOTER CALCULATION(*;Object name;listbox footer sum)

where the object name is either the column name or footer name, gives me 
incompatible type.

And
LISTBOX SET FOOTER CALCULATION(variable_Ptr->;listbox footer sum)

where variable_Ptr-> is a pointer to the the column name, column variable 
pointer, or footer

variable_Ptr:=OBJECT Get pointer(Object named;name returned by dynamic variable 
assignment obtained via listbox get arrays) 
gives incompatible type even though column is real
or
$ColumnPtr:=OBJECT Get pointer(Object named;column name)
etc.

Footers are turned on in the listbox properties.

I can’t get any combination to work.

Seems like it should be simple, but I’m missing something.

I’d appreciate an example from anyone who has this working.

Michael





> On Jul 26, 2018, at 7:48 AM, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Michael,
> 
> On Thu, Jul 26, 2018 at 6:32 AM mferguson--- via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> 
>> We have a memory leak in our v15.6 Windows database and have narrowed it
>> down to a listbox where the columns are dynamically added using LISTBOX
>> INSERT COLUMN.
>> The header and footer variables are nil pointers, in accordance with the
>> documentation.
>> And to reference these variables for the assignment of properties, per the
>> documentation:
>> 
>> $FtrVar_P:=OBJECT Get pointer(Object named;FTR_Names_aT{$Ndx})
>> $HdrVar_P:=OBJECT Get pointer(Object named;HDR_Names_aT{$Ndx})
>> 
>> However, the get object pointer above returns nil pointers, so we can’t
>> assign properties.
>> 
> ​I was just writing about using Listbox get arrays for this purpose when I
> saw Olivier's post. I suggest this approach as well. ​
> 
> 
>> So, we set up our own variable manager that declares and reuses header and
>> footer variables for the listbox, using execute formula.  The variable
>> manager has been tested and the number of variables for the form does not
>> grow. However, the apparent search speed preceding the display gets slower
>> and slower. The queries themselves are fast, but the re-display seems to be
>> the culprit eating up memory.
>> 
> 
> Using EXECUTE ... is probably not the best solution for what you are
> attempting to do. ​4D is pretty good at managing these variables. It sounds
> like you're working with 4D interpreted. There are a lot of tricks you can
> get away with using Execute in an interpreted db that fail if you plan on
> compiling it later.
> 
> A few weeks ago another developer was having speed issues with listboxes as
> well. In that case he was rebuilding the listboxes every time there was a
> change and found the LISTBOX INSERT ARRAY command was slow. When I build
> listboxes dynamically I handle the chores of configuring the listbox (that
> is, inserting the columns, headers and footers) and populating them
> independently. Changes in the data may require a REDRAW command but usually
> not re-configuring the whole listbox. The point is once he changed his
> approach he found the speed issue disappeared and overall management was
> easier.
> 
> -- 
> Kirk Brooks
> San Francisco, CA
> ===
> 
> *We go vote - they go home*
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Memory leak with dynamic variables in list boxes?

2018-07-26 Thread Keisuke Miyako via 4D_Tech
that just sound like a recipe for headaches, never a good idea to use EXECUTE 
FORMULA to create process variables.

you should be able to confirm with a simple form and listbox
that nil pointer does indeed create a new form local variable
and that it can reliably be referenced using its object name.

could it be possible that 4D is assigning an altered object name to keep 
uniqueness?

2018/07/26 22:32、mferguson--- via 4D_Tech 
<4d_tech@lists.4d.com>のメール:
So, we set up our own variable manager that declares and reuses header and 
footer variables for the listbox, using execute formula.


**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Memory leak with dynamic variables in list boxes?

2018-07-26 Thread Jeremy French via 4D_Tech
Hi Michael,

As pointed out by Oliver and Kirk, use LISTBOX GET ARRAYS to confirm the object 
names you think are present in the list box are in fact assigned as the object 
name to a header or footer. If not, you will get a nil pointer.

So, see if the value for "FTR_Names_aT{$Ndx}" is present in the footer object 
names returned by LISTBOX GET ARRAYS.

Similarly, verify that the value for "HDR_Names_aT{$Ndx}" is in fact the same 
as one of the header object names returned by LISTBOX GET ARRAYS.

- Jeremy French



> On Jul 26, 2018, at 9:32 AM, mferguson--- via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> $FtrVar_P:=OBJECT Get pointer(Object named;FTR_Names_aT{$Ndx})
> $HdrVar_P:=OBJECT Get pointer(Object named;HDR_Names_aT{$Ndx})
> 
> ... returns nil pointers

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Memory leak with dynamic variables in list boxes?

2018-07-26 Thread Kirk Brooks via 4D_Tech
Michael,

On Thu, Jul 26, 2018 at 6:32 AM mferguson--- via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> We have a memory leak in our v15.6 Windows database and have narrowed it
> down to a listbox where the columns are dynamically added using LISTBOX
> INSERT COLUMN.
> The header and footer variables are nil pointers, in accordance with the
> documentation.
> And to reference these variables for the assignment of properties, per the
> documentation:
>
> $FtrVar_P:=OBJECT Get pointer(Object named;FTR_Names_aT{$Ndx})
> $HdrVar_P:=OBJECT Get pointer(Object named;HDR_Names_aT{$Ndx})
>
> However, the get object pointer above returns nil pointers, so we can’t
> assign properties.
>
​I was just writing about using Listbox get arrays for this purpose when I
saw Olivier's post. I suggest this approach as well. ​


> So, we set up our own variable manager that declares and reuses header and
> footer variables for the listbox, using execute formula.  The variable
> manager has been tested and the number of variables for the form does not
> grow. However, the apparent search speed preceding the display gets slower
> and slower. The queries themselves are fast, but the re-display seems to be
> the culprit eating up memory.
>

Using EXECUTE ... is probably not the best solution for what you are
attempting to do. ​4D is pretty good at managing these variables. It sounds
like you're working with 4D interpreted. There are a lot of tricks you can
get away with using Execute in an interpreted db that fail if you plan on
compiling it later.

A few weeks ago another developer was having speed issues with listboxes as
well. In that case he was rebuilding the listboxes every time there was a
change and found the LISTBOX INSERT ARRAY command was slow. When I build
listboxes dynamically I handle the chores of configuring the listbox (that
is, inserting the columns, headers and footers) and populating them
independently. Changes in the data may require a REDRAW command but usually
not re-configuring the whole listbox. The point is once he changed his
approach he found the speed issue disappeared and overall management was
easier.

-- 
Kirk Brooks
San Francisco, CA
===

*We go vote - they go home*
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**