There are 2 loops, the first one iterates thru a list of names [red]@names[/red] and starts to build the first line of code while identifying a unique variable $UNIQUE_PD_ID$x as well as the name of the pull-down menu SELECT NAME ="M$x".
The second loop looks for a match of a stored pull-down selection $STORED_NAME , and finishes build the pull-down menu.
I want to end up with an array IE:@pulldown_menu_names=("$UNIQUE_PD_ID1","$UNIQUE_PD_ID2","$UNIQUE_PD_ID3","$UNIQUE_PD_ID4","$UNIQUE_PD_ID5","$UNIQUE_PD_ID6"
;
Thanks for your help
Cal
------------------- Start code --------------
[red]@names[/red] =("Gina","Lou","Shari","Louis","Lee","June"
;
$STORED_NAME = "June";
for ($x=1; $x <= [red]$names[/red] ; $x++)
{
my $UNIQUE_PD_ID$x = qq|<SELECT NAME ="M$x">|;
for ($x=1; $x <= [red]$names[/red] ; $x++)
{if ([red]$names[/red] [$x] =~ /$STORED_NAME/){
$UNIQUE_PD_ID$x .= "<OPTION SELECTED>[red]$names[/red] [$x]</OPTION>";
next;}
$UNIQUE_PD_ID$x .= "<OPTION>[red]$names[/red] [$x]</OPTION>";}
$UNIQUE_PD_ID$x .= "</SELECT>";
}
Thanks,
Cal In the begining
Let us first assume that there was nothing to begin with.
The second loop looks for a match of a stored pull-down selection $STORED_NAME , and finishes build the pull-down menu.
I want to end up with an array IE:@pulldown_menu_names=("$UNIQUE_PD_ID1","$UNIQUE_PD_ID2","$UNIQUE_PD_ID3","$UNIQUE_PD_ID4","$UNIQUE_PD_ID5","$UNIQUE_PD_ID6"
Thanks for your help
Cal
------------------- Start code --------------
[red]@names[/red] =("Gina","Lou","Shari","Louis","Lee","June"
$STORED_NAME = "June";
for ($x=1; $x <= [red]$names[/red] ; $x++)
{
my $UNIQUE_PD_ID$x = qq|<SELECT NAME ="M$x">|;
for ($x=1; $x <= [red]$names[/red] ; $x++)
{if ([red]$names[/red] [$x] =~ /$STORED_NAME/){
$UNIQUE_PD_ID$x .= "<OPTION SELECTED>[red]$names[/red] [$x]</OPTION>";
next;}
$UNIQUE_PD_ID$x .= "<OPTION>[red]$names[/red] [$x]</OPTION>";}
$UNIQUE_PD_ID$x .= "</SELECT>";
}
Thanks,
Cal In the begining
Let us first assume that there was nothing to begin with.