Cam,
Okay I am getting this to almost work. However I get an error on this line in the
code you gave:
&SortListItem(/%data,/%sortonly);
### the code ###
sub ListView_ColumnClick
my $col = shift;
print "You click on column number $col\n";
my %sortonly = &NewList($col,%data); ## %data is a global variable
&SortListItem(/%data,/%sortonly);
}
If I take out the '/' before the %data and the %sortonly then in the SortListItem
subroutine the variable $check is NULL
and so $check always goes to the sort number part of the routine. What obvious thing
am I doing wrong?
### the code ###
sub SortListItem {
my ($data,$sortonly,$section) = @_;
my $check;
my %data = %$data;
my %sortonly = %$sortonly;
$check .= "$_" foreach (values %sortonly); ## Merge all values into 1 string
if ($check =~ /[a-z]|[A-Z]/g) { ##--> Compare Num or by Char depending in
%sortonly values
print "Text Compare!\n";
foreach (sort { $sortonly{$a} cmp $sortonly{$b} } keys %sortonly) {
## Code in here needs to clear the current View
## and then add items all over again. Just like
## you did when you first created it
## Use the keys that are stored in $_, but get the values
## from the original hash(in this case %data)
}
} else {
print "Number Compare\n";
foreach (sort { $sortonly{$b} <=> $sortonly{$a} } keys %sortonly) {
## Code in here needs to clear the current View
## and then add items all over again. Just like
## you did when you first created it.
## Use the keys that are stored in $_, but get the values
## from the original hash(in this case %data)
}
}
}
Jonathan
--------------------------------------------------------------
Jonathan Southwick [EMAIL PROTECTED]
Technical and Network Services
Allegheny College
Meadville, PA 16335 814-332-2755