Is there an equivalent function in Object Pascal to the vb IIF()
function?
Thanks
Shloma
> Hi
>
> Is there an equivalent function in Object Pascal to the vb IIF()
> function?
Forget my previous message. The name is IfThen, and they are in Math and
StrUtils.
--
Rudy Velthuis (TeamB)
"If we knew what it was we were doing, it would not be called research,
would it?" -- Albert Einstein
> Hi
>
> Is there an equivalent function in Object Pascal to the vb IIF()
> function?
There are a few overloaded functions called IfElse in either SysUtils or
Math that do AFAIK the same.
Andrew
it's a funtion you supply 3 parameters,
parameter 2 and 3 and the result type are the same type
(boolean,integer,string,...), parameter 1 is boolean.
if parameter 1 is true, the funtion returns parameter 2, else it returns
parameter 3
--
Bas Gooijen
"Andrew Skinner" <ski...@summerfld.demon.co.uk> wrote in message
news:3D3E6464...@summerfld.demon.co.uk...
boolC := boolA XOR boolB;
then boolC would evaluate to true if boolA is true or if boolB is true, but
not if both of them are true. And, naturally, it will evaluate to false if
both boolA and boolB are false.
--
Lucas
Delphi Developer Support
Borland
"Andrew Skinner" <ski...@summerfld.demon.co.uk> wrote in message
news:3D3E6464...@summerfld.demon.co.uk...
indeed, in code it is like this:
boolA XOR boolB ==> (boolA OR boolB) and not (boolA and boolB )
(a or b but not a and b)
--
Bas Gooijen
Andrew
Actually XOR in math is how most people use OR in real life. For example,
go to a restaurant and order a steak. The waitress will ask you whether you
want a baked potato OR steamed vegetables OR some other side dish. Its
implied that you can only make one choice, not all of the above. In math,
all of the above is valid with OR, however this is not generally the case
with everyday "OR" and mathematical XOR.
--
Michael Simons
Software Programmer
Steven J. Baum P.C.
msi...@mbaum.com