Re: Assign multidimensional array
I would not do this "as is", but in theory, it should be possible to append an array like this: ARRAY TEXT($a;2) ARRAY TEXT($b;2) $a{0}:="a" $a{1}:="b" $a{2}:="c" $b{0}:="A" $b{1}:="B" $b{2}:="C" $a:=1 $b:=1 VARIABLE TO BLOB($a;$ax) VARIABLE TO BLOB($b;$bx) CLEAR VARIABLE($a) CLEAR VARIABLE($b) $o:=5 $size_a:=BLOB to longint($ax;PC byte ordering;$o) $o:=9 $select_a:=BLOB to integer($ax;PC byte ordering;$o) $o:=5 $size_b:=BLOB to longint($bx;PC byte ordering;$o) $o:=9 $select_b:=BLOB to integer($bx;PC byte ordering;$o) COPY BLOB($bx;$ax;13;BLOB size($ax);BLOB size($bx)-13) $o:=5 $size:=$size_a+$size_b+1 //new size LONGINT TO BLOB($size;$ax;PC byte ordering;$o) BLOB TO VARIABLE($ax;$a) CLEAR VARIABLE($ax) CLEAR VARIABLE($xb) > 2017/12/05 6:15、Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> のメール: > But it sounds like you need to _append_ the elements. ** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: http://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **
Re: Assign multidimensional array
Ferdinando, Copy array works fine with 2D arrays if you want $B to be - a copy - of $A. But it sounds like you need to _append_ the elements. You can also use COPY ARRAY on specific arrays within the 2D array. Example: $A has 4 'arrays' with some number of elements in each array. I have $C that I want to copy to $A{2}: COPY ARRAY($C;$A{2}) This is equivalent to ARRAY TEXT($A{2}:Size of array($C)) ` assuming text arrays For($i;1; Size of array($C) ) $A{2}{$i}:=$C{$i} End for On Mon, Dec 4, 2017 at 9:35 AM, stardata.info via 4D_Tech < 4d_tech@lists.4d.com> wrote: > Hi, > > I need to append one array into another array with the same coloumns. > > Copy not think that work. > > I need to use 4D V12... > > Thanks > > /Ferdinando/ > > > Il 04/12/2017 18:13, 4d_tech-requ...@lists.4d.com ha scritto: > >> Message: 10 >> Date: Mon, 4 Dec 2017 17:29:29 +0100 >> From: Arnaud de Montard<arn...@init5.fr> >> To: 4D iNug Technical<4d_tech@lists.4d.com> >> Subject: Re: Assign multidimensional array >> Message-ID:<f020d931-e20f-4ecb-8855-6a5617235...@init5.fr> >> Content-Type: text/plain; charset=utf-8 >> >> >> >> Le 4 déc. 2017 à 15:59, Chip Scheide via 4D_Tech<4d_tech@lists.4d.com> >>> a écrit : >>> >>> Ferdinando, >>> not sure if Copy Array will copy multi-dimensional arrays - you could >>> try. >>> >> ARRAY TEXT($zz;2;3) >> $zz{0}{0}:="test" >> ARRAY TEXT($zzz;0;0) >> COPY ARRAY($zz;$zzz) >> ASSERT($zzz{0}{0}="test") //0 index value >> ASSERT(Size of array($zzz{2})=3) //lines >> ASSERT(Size of array($zzz)=2) //columns >> >> it works:-) >> -- Arnaud de Montard >> > > ** > 4D Internet Users Group (4D iNUG) > FAQ: http://lists.4d.com/faqnug.html > Archive: http://lists.4d.com/archives.html > Options: http://lists.4d.com/mailman/options/4d_tech > Unsub: mailto:4d_tech-unsubscr...@lists.4d.com > ** > -- Kirk Brooks San Francisco, CA === *The only thing necessary for the triumph of evil is for good men to do nothing.* *- Edmund Burke* ** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: http://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **
Re: Assign multidimensional array
Hi, I need to append one array into another array with the same coloumns. Copy not think that work. I need to use 4D V12... Thanks /Ferdinando/ Il 04/12/2017 18:13, 4d_tech-requ...@lists.4d.com ha scritto: Message: 10 Date: Mon, 4 Dec 2017 17:29:29 +0100 From: Arnaud de Montard<arn...@init5.fr> To: 4D iNug Technical<4d_tech@lists.4d.com> Subject: Re: Assign multidimensional array Message-ID:<f020d931-e20f-4ecb-8855-6a5617235...@init5.fr> Content-Type: text/plain; charset=utf-8 Le 4 déc. 2017 à 15:59, Chip Scheide via 4D_Tech<4d_tech@lists.4d.com> a écrit : Ferdinando, not sure if Copy Array will copy multi-dimensional arrays - you could try. ARRAY TEXT($zz;2;3) $zz{0}{0}:="test" ARRAY TEXT($zzz;0;0) COPY ARRAY($zz;$zzz) ASSERT($zzz{0}{0}="test") //0 index value ASSERT(Size of array($zzz{2})=3) //lines ASSERT(Size of array($zzz)=2) //columns it works:-) -- Arnaud de Montard ** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: http://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **
Re: Assign multidimensional array
> Le 4 déc. 2017 à 15:59, Chip Scheide via 4D_Tech <4d_tech@lists.4d.com> a > écrit : > > Ferdinando, > not sure if Copy Array will copy multi-dimensional arrays - you could > try. ARRAY TEXT($zz;2;3) $zz{0}{0}:="test" ARRAY TEXT($zzz;0;0) COPY ARRAY($zz;$zzz) ASSERT($zzz{0}{0}="test") //0 index value ASSERT(Size of array($zzz{2})=3) //lines ASSERT(Size of array($zzz)=2) //columns it works :-) -- Arnaud de Montard ** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: http://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **
Re: Assign multidimensional array
Ferdinando, not sure if Copy Array will copy multi-dimensional arrays - you could try. but as worst case: (assumes $B is already denied as having the same dimensions as $A) For($i;1;size of array($A)) copy array($A{$i};$B{$i} end for On Mon, 4 Dec 2017 10:51:30 +0100, Herr Alexander Heintz via 4D_Tech wrote: > What about COPY ARRAY ? > >> Am 04.12.2017 um 10:45 schrieb stardata.info via 4D_Tech >> <4d_tech@lists.4d.com>: >> >> Hi All, >> >> I need to copy a multidimensional array ($A) into another of the >> same dimension ($B). >> Is necessary do a cicle and assign every single position or is >> possible to do other? >> >> ARRAY TEXT($A;1;2) >> ARRAY TEXT($B;0;2) >> $A{1}{1}:="1" >> $A{1}{2}:="2" >> $P:=Size of array($B)+1 >> INSERT IN ARRAY($B;$P;1) >> $B{$P}{1}:=$A{$P}{1} >> $B{$P}{2}:=$A{$P}{2} >> >> >> Thanks >> Ferdinando >> >> ** >> 4D Internet Users Group (4D iNUG) >> FAQ: http://lists.4d.com/faqnug.html >> Archive: http://lists.4d.com/archives.html >> Options: http://lists.4d.com/mailman/options/4d_tech >> Unsub: mailto:4d_tech-unsubscr...@lists.4d.com >> ** > > ** > 4D Internet Users Group (4D iNUG) > FAQ: http://lists.4d.com/faqnug.html > Archive: http://lists.4d.com/archives.html > Options: http://lists.4d.com/mailman/options/4d_tech > Unsub: mailto:4d_tech-unsubscr...@lists.4d.com > ** --- Gas is for washing parts Alcohol is for drinkin' Nitromethane is for racing ** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: http://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **
Re: Assign multidimensional array
What about COPY ARRAY ? > Am 04.12.2017 um 10:45 schrieb stardata.info via 4D_Tech > <4d_tech@lists.4d.com>: > > Hi All, > > I need to copy a multidimensional array ($A) into another of the same > dimension ($B). > Is necessary do a cicle and assign every single position or is possible to do > other? > > ARRAY TEXT($A;1;2) > ARRAY TEXT($B;0;2) > $A{1}{1}:="1" > $A{1}{2}:="2" > $P:=Size of array($B)+1 > INSERT IN ARRAY($B;$P;1) > $B{$P}{1}:=$A{$P}{1} > $B{$P}{2}:=$A{$P}{2} > > > Thanks > Ferdinando > > ** > 4D Internet Users Group (4D iNUG) > FAQ: http://lists.4d.com/faqnug.html > Archive: http://lists.4d.com/archives.html > Options: http://lists.4d.com/mailman/options/4d_tech > Unsub: mailto:4d_tech-unsubscr...@lists.4d.com > ** ** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: http://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **
Assign multidimensional array
Hi All, I need to copy a multidimensional array ($A) into another of the same dimension ($B). Is necessary do a cicle and assign every single position or is possible to do other? ARRAY TEXT($A;1;2) ARRAY TEXT($B;0;2) $A{1}{1}:="1" $A{1}{2}:="2" $P:=Size of array($B)+1 INSERT IN ARRAY($B;$P;1) $B{$P}{1}:=$A{$P}{1} $B{$P}{2}:=$A{$P}{2} Thanks Ferdinando ** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: http://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **