rj
2012-12-11 19:32:35
In my script the user name pick the monster they want to kill by editing
And based off what they enter this procedure directs it to other procedure
How would i shorten this up using cases? I read the thread but I don't understand how it would apply here.
MONSTER_KILL = ('ghost'); And based off what they enter this procedure directs it to other procedure
procedure Chooseproc;
begin
if MONSTER_KILL = ('ghost') then
begin
ClickGhost;
end;
if MONSTER_KILL = ('skeleton') then
begin
Clickskeleton;
end;
if MONSTER_KILL = ('bat') then
begin
ClickBat;
end;
if MONSTER_KILL = ('druid') then
begin
ClickDruid;
end;
if MONSTER_KILL = ('warewolf') then
begin
Clickwarewolf;
end;
if MONSTER_KILL = ('dwarf') then
begin
Clickskeleton;
end;
end;How would i shorten this up using cases? I read the thread but I don't understand how it would apply here.