bud_wis_er_420
2013-04-30 01:01:07
Ok in one of my scripts I need to free some bitmaps. Problem is, the name of the bitmaps change according to the user settings. I have a sting array with the names of the bitmaps. But how do I use strings to do this?
Here is an example of my code, but obviously it don't work cause ItemsNeed is a TStringArray and won't convert to a Integer. But How WOULD I do this?
Here is an example of my code, but obviously it don't work cause ItemsNeed is a TStringArray and won't convert to a Integer. But How WOULD I do this?
ItemsNeed: TStringArray;
procedure FreeAll;
var
i: Integer;
begin
for i := 0 to High(ItemsNeed) do
begin
writeln(ItemsNeed[i]);
if (DTMExists(StrToInt(ItemsNeed[i]))) then
FreeDTM(StrToInt(ItemsNeed[i]));
if (BitmapExists(StrToInt(ItemsNeed[i]))) then
FreeBitmap(StrToInt(ItemsNeed[i]));
end;
end;