Hi,
The following if checks for variable between -10 and 10.
if ( $variable > -10 and $variable < 10 ) {
# do something
}
The example you gave looks like it always executes though, so maybe I'm
missing something.
--Paul
> -----Original Message-----
> From: Mark Martin [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, October 18, 2001 10:31 AM
> To: [EMAIL PROTECTED]
> Subject: "BETWEEN" Comparison Operator
>
>
> Hi,
> very simple question here I think. Trying to get an IF to
> test whether a
> numeric variable is in a certain range & if it is then
> execute an action :
>
> if ($variable <-10) {
>
> $sth1->execute($variable) or die "Can't
> execute SQL statement:
> $DBI::errstr\n";
>
> }elsif ($variable >10) {
>
> $sth1->execute($variable) or die "Can't
> execute SQL statement:
> $DBI::errstr\n";
>
> }else {
>
> $sth1->execute($variable) or die "Can't
> execute SQL statement:
> $DBI::errstr\n";
>
> }
>
> I can only seem to do this with 2 conditional statements(IF &
> ELSIF) and
> the action repeated. What I want is a "Between" operator for
> the range -10
> to 10.
>
> Any ideas,
> Mark
> _____________________________________________
>
> Mark Martin
> Computer Centre
> National University of Ireland Maynooth
>
> Tel: (01)708 4716/3830
> Fax: (01)628 6249
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]