I have 4 mana types lava,water,dark,and Nature. I want to do a query on each one , one at a time. Currently i have
procedure TFGame.GetStartingCards;
var
ManaType :string ;
begin
Manatype := 'Nothing';
while ManaType <> 'Nature' do
begin
if ManaType = 'Dark' then
ManaType := 'Nature';
if ManaType = 'Water' then
ManaType := 'Dark';
if Manatype = 'Lava' then
Manatype := 'Water';
if Manatype = 'Nothing' then
ManaType := 'Lava' ;
with adoquery1 do
begin
close;
sql.Clear;
sql.Add('SELECT * ');
sql.Add('FROM Cards');
sql.Add('WHERE Color='''+ManaType+'''');
open;
end;
//return the result of everything for giving mana type..
end;
but seems to be a better way, like putting each mana type into an array and using the array to feed the query. But could not get it to work. So question is Would this have any flaws if i decided to keep it like this?