|
-
Feb 23rd, 2004, 11:32 AM
#1
Thread Starter
Hyperactive Member
Perl TK Problem!
I have a function to which I pass variables from textboxes (created using the TK Modules) to a subroutine (so I have textboxes name $one $two $three, sub Pie) then what i want is for the new subroutine to read the values from these text boxes, so i call sub{Pie($one,$two,$three)}. However, when i try to get the data back, im having problems. I say "my ( $one_array, $two_array, $three_array ) = @_;" Just as i have learned from tutorials! However, when i try to get the data back out, by writing (example, for the variable $one) my $one_val = $one_array->get(); - However, perl is having trouble with this, it gives me an error [Tk::Error: wrong # args: should be ".text get index1 ?index2?" - and i dont udnerstand what this means, can anybody help atall ?
the exact code goes...
the function which takes the variables first...
PHP Code:
sub createAccount {
my( $Username_arr,
$Name_arr,
$Password_arr,
$PassCheck_arr,
$Email_arr,
$Sylabus_arr,
$Instrument_arr,
$Theory_arr,
$Practical_arr
) = @_;
my $username = $Username_arr->get;
my $name = $Name_arr->get();
my $password = $Password_arr->get();
my $passconfirm = $PassCheck_arr->get();
my $email = $Email_arr->get();
my $syll = $Sylabus_arr->get();
my $inst = $Instrument_arr->get();
my $theory_g = $Theory_arr->get();
my $practical_g = $Practical_arr->get();
my $test = new MainWindow;
$test->title( $Username_arr );
$test->geometry("335x160");
}
return true;
and the code for the command button...
PHP Code:
my $CreateUser = $CreateAcct->Button(
-text => "Create Account",
-command => sub{createAccount($txtNewUName,$txtNewName,$txtNewPassword,$txtNewCPassword,$txtNewEmail,$ListNewSyll,$ListNewInst,$txtNewTheory,$txtNewPractical)}
)->pack;
thanks!
Power to 2000 Electronic Donkeys!
www.edonkey2000.com
I hate case sensitivity... all you get down the M1 is "are we there yet" and "ouch, watch the bumps".
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|