Link to home
Start Free TrialLog in
Avatar of AbhiJeet
AbhiJeet

asked on

delphi 3

I have two implement below logic,

case function of
1 : Showmessage ('1');
2: Showmessage('2');
3: showmessage('3');

function in above statement shall return 1 or 2 or 3 querying a table on below conditions:

The table has two columns eg A and B, which contain either 0 or 1 values.
First condition shall be querying the table where column B has all 0 values. For this condition the function shall return 1.
Second condition:  Column B has all 1 values and column A has 0 values. For this condition the function shall return 2.
Third condition: Column B has all 1 values and Column A has 1 values, for this condition the function shall returen 3.

Need help with code snippet !
ASKER CERTIFIED SOLUTION
Avatar of jimyX
jimyX

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
this is an abstract sample of a problem
as jimyX pointed out, the else condition is missing
or the equation of your abstract problem is not complete
Avatar of AbhiJeet
AbhiJeet

ASKER

any other nice and simple work around?
It involves DB and records, no other work around.
The only way to do that is to read the records from the database so that's the best that it could be.

Probably you can explain, what did you expect the solution to look like.
from a quote: "nulls are evil"
from the text of your question: either 0 or 1 values

what do you understand as 0 values
> the column has all values as zero (or 0)
> the column has all nulls (or 0 values)

your question contains ambiguities and because of that it's unclear what you want
> you'll have to explain in more detail what you want