PDA

View Full Version : ReConfigurable Gui in Perl


s022jsb
08-11-2003, 07:08 PM
Hello all,
I am having a problem, and hope someone can help.

A gui i am writing needs to be totaly configurable based on a config file that can be edited. The gui has groups of radiobuttons on seperate frames, and the may be anynumber of frames, therefore there may be anynumber of radiobuttons. My question is, when i am setting up the radio buttons, i used the -variable to associate a variable to the group of radiobuttons, but if i don't know howmany there are going to be, is there anyway to dynamicaly add variables so that depending on howmany are needed the program will add them.

thanks
jason

ACJavascript
08-19-2003, 02:42 AM
You might be able to mabye Name each one the same except for numbers.

Exmaple: RADIO1, RADIO2, RADIO3

then in the script check them like this:

@files;
foreach(keys %FORM){
if($_ =~ /^RADIO/){
push(@files, $_);
}
}

so now @files holds all of the radios.