Re: can an array be added to a Form's object list i.e. Form.Array?

2018-10-02 Thread Kirk Brooks via 4D_Tech
Keith, I agree with you about using Form in lieu of process vars. As a rule I like to keep 'the data' separate from 'all the other stuff' to make it easier to debug the data and to be able to encapsulate the various methods used to create those other things. thinking about I could see a rule of

Re: can an array be added to a Form's object list i.e. Form.Array?

2018-10-02 Thread Keith Culotta via 4D_Tech
I'm new enough with collections and entities not to have a good sense of what techniques are most efficient. I have been thinking of Form as a communication vehicle to be loaded and unloaded, and a way to avoid process variables. Arrays would need to be packed and unpacked, but Example 11 on

Re: can an array be added to a Form's object list i.e. Form.Array?

2018-10-02 Thread Kirk Brooks via 4D_Tech
Keith, Sure, if having the choice list in the data object is relevant. Depends on how the form is set up I think. Typically I would pass a data object to a form or subform to be populated with data or allow the user to edit it. I make the form for a particular kind of operation. Right now I'm

Re: can an array be added to a Form's object list i.e. Form.Array?

2018-10-02 Thread Keith Culotta via 4D_Tech
or for each value of ChoicesArray: OB SET(Form;"ChoicesArray"+string($i); ChoicesArray{$i}) ? Keith > On Oct 2, 2018, at 3:10 PM, Keith Culotta via 4D_Tech <4d_tech@lists.4d.com> > wrote: > > You can save ChoicesArray to the Form object with OB SET > ARRAY(Form;"myarr";ChoicesArray). >

Re: can an array be added to a Form's object list i.e. Form.Array?

2018-10-02 Thread Kirk Brooks via 4D_Tech
Chris, As you found arrays are not supported for use with Form. Objects like a combo box are aren't that hard to do but until they support a collection as the data source you have to manage them in classic 4D fashion. Which means you can shuffle an array around using OB SET/GET ARRAY and some

Re: can an array be added to a Form's object list i.e. Form.Array?

2018-10-02 Thread Keith Culotta via 4D_Tech
You can save ChoicesArray to the Form object with OB SET ARRAY(Form;"myarr";ChoicesArray). http://doc.4d.com/4Dv17/4D/17/OB-SET-ARRAY.301-3730702.en.html Also 'JSON Stringify array' will produce a string that can be reconstituted with JSON PARSE ARRAY. FORM.myarr:=$stringifiedArray

can an array be added to a Form's object list i.e. Form.Array?

2018-10-02 Thread Chris Belanger via 4D_Tech
I am trying to make a ComboBox object that is local to the Form. Hence I need the Array to be a Form. object ARRAY TEXT(Form.ChoicesArray;0) does not work; Trying to get the data into a COLLECTION and then use COLLECTION TO ARRAY (which should define the array easily) does not work: