SRL Archive - Help

Hello Fellow Scripters! (ClearDtm Array)


m3gaman3g3nd

2012-01-12 17:41:37

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

2012-01-12 17:45:28

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

2012-01-12 18:15:31

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

2012-01-12 18:24:17

for i:= 0 to 9999 do             //9999 to the number of DTM you have starting with 0
FreeDTM(DTMArray[i])

does this work

senrath

2012-01-12 18:53:38

It would be better to do:
for i := 0 to High(DTMArray) do
FreeDTM(DTMArray[i]);

Mark

2012-01-12 18:55:43

From: senrath
It would be better to do:
for i := 0 to High(DTMArray) do
FreeDTM(DTMArray[i]);


i always forget about High

m3gaman3g3nd

2012-01-12 21:17:13

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?