That looks Ok, going to try it with the explicit code... 

Thanks for Advice!

Johannes

-----Ursprüngliche Nachricht-----
Von: Connie Chan [mailto:[EMAIL PROTECTED]]
Gesendet: Donnerstag, 1. August 2002 13:48
An: Theuerkorn Johannes
Betreff: Re: Perl Array Question


That's luck that you want a runtime array, but not a real time array.

What I suggested is just an example.

you can push anything to an array at runtime without limit on dimension.

my @A = @B = @C = ();
for(0..999) { push @A, $_; push @B, $_; push @C, $_ }
then you got @A = 0,1,2,3,4,....999; @B and @C also.

the for loop is some way you pick up data from your SQL,
the push is relay on the dimensions on how you read from your SQL.
So that's not static at all.

If you want to push an array to an array, then do sth like this :
push @A, \@B, then $A[1000][1] is 2.

Rgds,
Connie



----- Original Message -----
From: "Theuerkorn Johannes" <[EMAIL PROTECTED]>
To: "'Connie Chan'" <[EMAIL PROTECTED]>
Sent: Thursday, August 01, 2002 7:19 PM
Subject: AW: Perl Array Question


Hi Connie,

First of all thank you for your Help!

OK, that would work, but I have runtime variables which i get trough the select SQL 
Query, so I can´t create a static
Array for that...
Another Problem is that i get more than one select Statement from the $KEY_SNR[$i] and 
thats why I need more than one
Array automatically generatet, something like @alle_$i= "all what comes from the 
select Query[$i]...

So this is a little more difficult...

Joe

-----Ursprüngliche Nachricht-----
Von: Connie Chan [mailto:[EMAIL PROTECTED]]
Gesendet: Mittwoch, 31. Juli 2002 17:23
An: Theuerkorn Johannes
Betreff: Re: Perl Array Question


To create a AOA is simeple, see below :

@A = qw(1 2 3 4 5 6);
@B = qw(a b c d e f);

@AB = (\@A, \@B);

so $AB[0][0] is 1, $AB[1][1] is 'b'

but maybe you want to use hash of array, that
would better fit your case.

@colA = qw (1 2 3 4 5);
@colB = qw (a b c d e);

%table = (COL_A => \@colA, COL_B => \@colB);
so, $table{COL_A}[2] is 3.

Rgds,
Connie



----- Original Message -----
From: "Theuerkorn Johannes" <[EMAIL PROTECTED]>
To: "'Connie Chan'" <[EMAIL PROTECTED]>
Sent: Wednesday, July 31, 2002 6:55 PM
Subject: AW: Perl Array Question


Hi Connie,

jep, youre right, i missed the closing Curley in the while loop... :-(

But how can i construct the AOA in the while loop? Was already thinking i missed that, 
but wasnt able to find a way for
creating it...

Greets Joe
-----Ursprungliche Nachricht-----
Von: Connie Chan [mailto:[EMAIL PROTECTED]]
Gesendet: Mittwoch, 31. Juli 2002 12:09
An: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Betreff: Re:Perl Array Question

> while (my @RACT_LOG_data=$sth_RACT_LOG->fetchrow_array){
>
>  $count_RACT_LOG_data++;
>  push our @KEY_SNR_RACT_LOG[$i], $RACT_LOG_data[0];
>  push our @DRAWING_RE_RACT_LOG[$i], $RACT_LOG_data[1];
>  push our @RCODE_ID_RACT_LOG[$i], $RACT_LOG_data[2];
>}

You missed a } for the for loop or missed it for the while loop.



>Thats how I try to get data out of my Arrays...
> for (my $i=0;$i<=$count_SNR_LOG_DATA,$i++){
> for (my $u=0;$u<=$count_RACT_LOG_data;$u++){
>  print "$KEY_SNR_RACT_LOG[$i][$u]\n";
>  print "$DRAWING_RE_RACT_LOG[$i][$u]\n";
>  print "$RCODE_ID_RACT_LOG[$i][$u]\n";

This is a calling to an Array Of Array, but you aren't construct
an AOA during the while loop....

Rgds,
Connie



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to