SRL Archive - OSR Help

Simple Code shortening


logical

2011-12-14 12:31:01

Not too drastic but how do i shorten this?

I'm not sure if i can use 'with … do … ' here.

case Strings[0] of      // the DTM's are for the spell...
'Sapphire' : begin
Ench:= DTMFromString('m6wAAAHic42ZgYGhlYmDoAOJuIG4A4mYobgfiLqh4B1TMkxEVuwGxExQ7A7EvEPtDMafrRwae7F8MBvLMYPz792+G78+5GEpiDYDYEMw/tECAIduHhYEV6A5iMSMJGAkAADhqGJ4=');
case Strings[1] of
'Ring' : Str2 := '';
'Necklace' : Str2 := '';
'Bracelet' : Str2 := '';
'Amulet' : Str2 := '';
end;
end;
'Emerald' : begin
Ench:= DTMFromString('');
case Strings[1] of
'Ring' : Str2 := '';
'Necklace' : Str2 := '';
'Bracelet' : Str2 := '';
'Amulet' : Str2 := '';
end;
end;
'Ruby' : begin
Ench:= DTMFromString('');
case Strings[1] of
'Ring' : Str2 := '';
'Necklace' : Str2 := '';
'Bracelet' : Str2 := '';
'Amulet' : Str2 := '';
end;
end;
'Diamond' : begin
Ench:= DTMFromString('');
case Strings[1] of
'Ring' : Str2 := '';
'Necklace' : Str2 := '';
'Bracelet' : Str2 := '';
'Amulet' : Str2 := '';
end;
end;
'Dragonstone': begin
Ench:= DTMFromString('');
case Strings[1] of
'Ring' : Str2 := '';
'Necklace' : Str2 := '';
'Bracelet' : Str2 := '';
'Amulet' : Str2 := '';
end;
end;
end;

ty :)

Dgby714

2011-12-14 13:10:16

That is about as short as it's going to get, Tho I'd suggest lowercasing.

logical

2011-12-14 13:12:40

no one? >.<

bump

I changed the script a little.
If there is no way to shorten it tell me plz.

Edit: o..didn't see your post Dgby…did you see it after the edit?
thanks for responding though :)