Following earlier guidance, I've been using the script below and variants with a good deal of success. I'm now trying to take things a bit further and would appreciate a little help!
My first
--------
On one script, I've got this filtering with alphabetical sort occuring twice (each working on a different field). To stop the second version repeating the values from the first, I've used a temporary
$dlist = "";
What's the correct command to reset $dlist to have no value?
My second
---------
For one of my lists, I need the filtering to pick out two fields per record (one field is displayed, the other is an HREF destination). As before, I want to work on the first field -- filtering out repeats of the same word/phrase and sorting alphabetically. Then I want to display the filtered fields, each linking to the page stated in the corresponding record's destination field.
Also, I'd like to exclude two specific field values from being displayed here (I will display them above the main alphabetical list).
I've tried looking through various scripts and reading up on-line guides, but being a newbie I'm at a loss how to make a list from a pair of fields and then call on the pair (and also how to exclude certain values from the list -- or from printing the list). Could someone please help with this scripting?
TIA,
Andy
-----------
Current script extract:
@words = split(/\s*\~~\s*/,$tabledata[0]);
foreach $aword (sort(@words)) {
push @filtered, ucfirst($aword) if ($dlist !~ /(^|\|)${aword}\|/);
$dlist .= $aword . "|";
}
foreach (sort(@filtered)) {
print "<option>$_</option>\n";
}
[This message has been edited by Andy (edited November 27, 1999).]
My first
--------
On one script, I've got this filtering with alphabetical sort occuring twice (each working on a different field). To stop the second version repeating the values from the first, I've used a temporary
$dlist = "";
What's the correct command to reset $dlist to have no value?
My second
---------
For one of my lists, I need the filtering to pick out two fields per record (one field is displayed, the other is an HREF destination). As before, I want to work on the first field -- filtering out repeats of the same word/phrase and sorting alphabetically. Then I want to display the filtered fields, each linking to the page stated in the corresponding record's destination field.
Also, I'd like to exclude two specific field values from being displayed here (I will display them above the main alphabetical list).
I've tried looking through various scripts and reading up on-line guides, but being a newbie I'm at a loss how to make a list from a pair of fields and then call on the pair (and also how to exclude certain values from the list -- or from printing the list). Could someone please help with this scripting?
TIA,
Andy
-----------
Current script extract:
@words = split(/\s*\~~\s*/,$tabledata[0]);
foreach $aword (sort(@words)) {
push @filtered, ucfirst($aword) if ($dlist !~ /(^|\|)${aword}\|/);
$dlist .= $aword . "|";
}
foreach (sort(@filtered)) {
print "<option>$_</option>\n";
}
[This message has been edited by Andy (edited November 27, 1999).]