objects are references, so you can't use the same object over and over again,
as if they point to different things.
bad code:
ARRAY OBJECT($oo;0)
C_OBJECT($o)
For ($i;1;3)
OB SET($o;"value";$i)
APPEND TO ARRAY($oo;$o)
End for
good code #1:
ARRAY OBJECT($oo;0)
C_OBJECT($o)
For ($i;1;3)
OB
never mind -
of course the below fails to fill the array.
as I was replying to Peter's post I realized...
the loop inserts a new element at position 1
BUT
OB Set is acting on element $i
DUH!
Chip
On Thu, 3 Oct 2019 23:36:32 +0200, Peter Bozek wrote:
>>
>> in a loop
>> For ($i;1;$Column_Count)
On Thu, Oct 3, 2019 at 10:55 PM Chip Scheide via 4D_Tech <
4d_tech@lists.4d.com> wrote:
> ok..
> why does this not work???
>
> in a loop
> For ($i;1;$Column_Count)
> INSERT IN ARRAY($Columns;1)
> OB SET($Columns{$i};)
> end for
>
How it could? Line
INSERT IN ARRAY($Columns;1)
tries to
Chip,
At a guess, because after INSERT IN ARRAY, $Columns{$i} is Null rather than {}.
Try
$Columns{$i}:=New object
before the OB SET; or replace it with
$Columns{$i}:= New object ()
Jeremy
> On 3 Oct 2019, at 21:55, Chip Scheide via 4D_Tech <4d_tech@lists.4d.com>
> wrote:
Chip,
On Thu, Oct 3, 2019 at 1:55 PM Chip Scheide via 4D_Tech <
4d_tech@lists.4d.com> wrote:
> ok..
> why does this not work???
>
> in a loop
> For ($i;1;$Column_Count)
> INSERT IN ARRAY($Columns;1)
> OB SET($Columns{$i};)
>
You said you wanted to append an array so you would use:
OB SET
ok..
why does this not work???
in a loop
For ($i;1;$Column_Count)
INSERT IN ARRAY($Columns;1)
OB SET($Columns{$i};)
end for
the first iteration is fine, and the $Columns{1} is assigned the
correct properties and values.
However, the second loop results in $Columns{2} containing the
I was not doing this.
I see... said the blind man as he picked up his hammer and saw...
:)
I was trying
array object($Array;0)
append to array($Array;)
which did not work...
Chip
On Thu, 3 Oct 2019 22:43:35 +0200, Peter Bozek wrote:
> On Thu, Oct 3, 2019 at 10:26 PM Chip Scheide via 4D_Tech <
On Thu, Oct 3, 2019 at 10:26 PM Chip Scheide via 4D_Tech <
4d_tech@lists.4d.com> wrote:
> is it possible to use append array with an object array?
>
>
I forgot - append to array works fine as well:
ARRAY OBJECT($ao;0)
C_OBJECT($o)
OB SET($o;"property";$value)
APPEND TO ARRAY($ao;OB COPY($o))
OB
On Thu, Oct 3, 2019 at 10:26 PM Chip Scheide via 4D_Tech <
4d_tech@lists.4d.com> wrote:
> is it possible to use append array with an object array?
>
>
Sure, I started to use it in v15 and code seems to be working in v17
without problem
> I was playing, and I do not see a way to get this to
it loos like an alternative to Append to Array is:
array object($Array;0)
insert in array($array;1)
ob set($array{1}; )
Chip
On Thu, 3 Oct 2019 13:28:24 -0700, Kirk Brooks via 4D_Tech wrote:
> Chip,
>
> On Thu, Oct 3, 2019 at 1:26 PM Chip Scheide via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
Chip,
On Thu, Oct 3, 2019 at 1:26 PM Chip Scheide via 4D_Tech <
4d_tech@lists.4d.com> wrote:
> is it possible to use append array with an object array?
>
No. But you can with collections.
To accomplish what you are describing you would need to create an object,
set the array to the object and
is it possible to use append array with an object array?
I was playing, and I do not see a way to get this to work.
Thanks
Chip
---
Gas is for washing parts
Alcohol is for drinkin'
Nitromethane is for racing
**
4D
12 matches
Mail list logo