Log in

View Full Version : Hello Fellow Scripters! (ClearDtm Array)



m3gaman3g3nd
01-12-2012, 10:41 PM
hi i was wondering on a few strategies on clearing an array of Dtm.

like so for example


var
DTMArray: Array [0..2] of Integer;
begin
DTMArray[0]:=DTMFromString('se5jhd')
DTMArray[1]:=DTMFromString('s9trjhd')
DTMArray[2]:=DTMFromString('set1jhd')

freedtm(DTMArray[0..2]);//yeilds error obviously

end


but how would i go about this?

Mark
01-12-2012, 10:45 PM
edit: lol must be tired missread title :(

thought of dif ways to load/call

// 0 1 2
DTMArray2:=['se5jhd','s9trjhd','set1jhd'];

DTM:=DTMFromString(DTMArray2[i]);// this will load a DTM from the string specified by i
i:=0;//declare the value of i to the DTM you are using 0-2
if FindDTD(DTM,x,y,MSX1,MSY1,MSX2,MSY2)then
begin
Mouse(x,y,5,5,Mouse_Left);
end;
FreeDTM(DTM); // and free it after
end

m3gaman3g3nd
01-12-2012, 11:15 PM
yes.
this is sort of an advanced question...


''the process automatically searches for the first dtm in the array first then secon third etc. when using FindDTMs it will find mulitples of the first line of array so theres no point in using findDTMs when using an array''

Mark
01-12-2012, 11:24 PM
for i:= 0 to 9999 do //9999 to the number of DTM you have starting with 0
FreeDTM(DTMArray[i])

does this work

senrath
01-12-2012, 11:53 PM
It would be better to do:
for i := 0 to High(DTMArray) do
FreeDTM(DTMArray[i]);

Mark
01-12-2012, 11:55 PM
It would be better to do:
for i := 0 to High(DTMArray) do
FreeDTM(DTMArray[i]);

i always forget about High

m3gaman3g3nd
01-13-2012, 02:17 AM
Hi guys, using that same example... Is there a function that would return what number of the array found?

like if it searches and finds 'dtmarray[2]' would it be possible to return that as an integer?