<do some DBI stuff>
my @row; my $count = 0; my @AoH; my $id; my %status = ( 0 => 'Pending', 1 => 'Initiate Send', 2 => 'Will NOT be Sent', 3 => 'Sent' );
$f1->destroy() if Tk::Exists($f1);
$f1 = $p1_top_frame->Frame->pack(-side => 'top', -expand => 0, -fill => 'none');
while (@row = $sth->fetchrow_array()) { $count ++; $id = $row[0];
#save all data from database records in an array of hashes $AoH[$count]{id} = $row[0]; $AoH[$count]{ssn} = $row[1]; $AoH[$count]{name} = $row[2]; $AoH[$count]{begindate} = $row[3]; $AoH[$count]{enddate} = $row[4]; $AoH[$count]{permit} = $row[5]; $AoH[$count]{iris_begindate} = $row[6]; $AoH[$count]{transstatus} = $row[7];
### The following button sends the correct value for $id, but zero for $AoH[$count]{transstatus}
print "$row[7]\n";
my $b1 = $f1->Button(-text => 'Go',
-command => [\&update_record, $id,
$AoH[$count]{transstatus}])->grid(-column => 1,
-row => $count);
### Bind the variable to the array of hashes element so that changes to the radio
### buttons effectively change the value of the AoH element.
foreach (qw/0 1 2/) {
my $r1 = $f1->Radiobutton(-text => $_,
-value => $_,
-variable => \$AoH[$count]{transstatus})->grid(-column => ($_ + 2),
-row => $count);
}
my $t1 = $f1->ROText(-height => 1, -width => 9)->grid(-column => 5, -row => $count);
my $t2 = $f1->ROText(-height => 1, -width => 30)->grid(-column => 6, -row => $count);
my $t3 = $f1->ROText(-height => 1, -width => 10)->grid(-column => 7, -row => $count);
my $t4 = $f1->ROText(-height => 1, -width => 10)->grid(-column => 8, -row => $count);
my $t5 = $f1->ROText(-height => 1, -width => 10)->grid(-column => 9, -row => $count);
my $t6 = $f1->ROText(-height => 1, -width => 10)->grid(-column => 10, -row => $count);
$t1->insert('end', $row[1]); $t2->insert('end', $row[2]); $t3->insert('end', $row[3]); $t4->insert('end', $row[4]); $t5->insert('end', $row[5]); $t6->insert('end', $row[6]); }
-Mike
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>