M
mastermagrath
Hi all,
Can onyone advise me on the following. I have a script that uses 2 gif
images if they are present on the users machine. If they are not then i
want to effectively remove the code that would use them on execution of
the script, here is a snippet of the script:
The first part tests for the existence, if they do exist then all is
well.....
if ((-e ".\\gif1.gif") && (-e ".\\gif2.gif")) {
my $photo1 = $f1-> Photo('imggif', -file => ".\\gif1.gif");
my $photo2 = $f1-> Photo('imggif2', -file => ".\\gif2.gif");
my $progressEntry = $f1-> Label('-image' => 'imggif')->pack(-side =>
'right');
}
However if they don't exist then the following code later in the script
causes a problem:
if ($flash == 0) {
$progressEntry->configure('-image' => 'imggif2');
$flash = 1;}
else {
$progressEntry->configure('-image' => 'imggif');
$flash = 0;}
}
else {$progressEntry->configure('-image' => 'imggif');}
So how do i effectively remove this second batch of code from being
compiled if the file test returns false?
Thanks in advance
Can onyone advise me on the following. I have a script that uses 2 gif
images if they are present on the users machine. If they are not then i
want to effectively remove the code that would use them on execution of
the script, here is a snippet of the script:
The first part tests for the existence, if they do exist then all is
well.....
if ((-e ".\\gif1.gif") && (-e ".\\gif2.gif")) {
my $photo1 = $f1-> Photo('imggif', -file => ".\\gif1.gif");
my $photo2 = $f1-> Photo('imggif2', -file => ".\\gif2.gif");
my $progressEntry = $f1-> Label('-image' => 'imggif')->pack(-side =>
'right');
}
However if they don't exist then the following code later in the script
causes a problem:
if ($flash == 0) {
$progressEntry->configure('-image' => 'imggif2');
$flash = 1;}
else {
$progressEntry->configure('-image' => 'imggif');
$flash = 0;}
}
else {$progressEntry->configure('-image' => 'imggif');}
So how do i effectively remove this second batch of code from being
compiled if the file test returns false?
Thanks in advance