Board index » delphi » Logical operators in IF statement

Logical operators in IF statement

"Kashif Ali Raja" <kashif_...@hotmail.com> schrieb im Newsbeitrag news:3e1c1380$2@newsgroups.borland.com...

Quote
> Is there any "AND" or "OR" operator I can use in Interbase Store Procedures
> to compare two logical statements. For example:

> if  <statement 1> AND <statement 2> then
> begin
> <do something>
> end

> When I do something like that and compile the above statement I get an error
> saying "AND" is not recognized. Any ideas??? Thanks in advance.

> Note: I can turn the above if statement into two nested statements and can
> achieve the desired results but I want to do all in one statement.

Try to use parentheses:

if  ((<statement 1>) AND (<statement 2>)) then
begin
  <do something>
end

HTH,
Thomas Steinmaurer
IB LogManager 2.1 - The Logging/Auditing Tool for InterBase and Firebird
http://www.iblogmanager.com

 

Re:Logical operators in IF statement


Is there any "AND" or "OR" operator I can use in Interbase Store Procedures
to compare two logical statements. For example:

if  <statement 1> AND <statement 2> then
begin
<do something>
end

When I do something like that and compile the above statement I get an error
saying "AND" is not recognized. Any ideas??? Thanks in advance.

Note: I can turn the above if statement into two nested statements and can
achieve the desired results but I want to do all in one statement.

Other Threads