Results 1 to 7 of 7

Thread: Hello Fellow Scripters! (ClearDtm Array)

  1. #1
    Join Date
    Jan 2012
    Posts
    190
    Mentioned
    0 Post(s)
    Quoted
    10 Post(s)

    Default Hello Fellow Scripters! (ClearDtm Array)

    hi i was wondering on a few strategies on clearing an array of Dtm.

    like so for example

    Simba Code:
    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?

  2. #2
    Join Date
    May 2007
    Location
    England/Liverpool
    Posts
    1,004
    Mentioned
    9 Post(s)
    Quoted
    106 Post(s)

    Default

    edit: lol must be tired missread title

    thought of dif ways to load/call

    Simba Code:
    // 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
    Last edited by Mark; 01-12-2012 at 11:24 PM.

  3. #3
    Join Date
    Jan 2012
    Posts
    190
    Mentioned
    0 Post(s)
    Quoted
    10 Post(s)

    Default

    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''

  4. #4
    Join Date
    May 2007
    Location
    England/Liverpool
    Posts
    1,004
    Mentioned
    9 Post(s)
    Quoted
    106 Post(s)

    Default

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

    does this work

  5. #5
    Join Date
    Oct 2006
    Location
    ithurtsithurtsithurtsithurts
    Posts
    2,930
    Mentioned
    7 Post(s)
    Quoted
    135 Post(s)

    Default

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

  6. #6
    Join Date
    May 2007
    Location
    England/Liverpool
    Posts
    1,004
    Mentioned
    9 Post(s)
    Quoted
    106 Post(s)

    Default

    Quote Originally Posted by senrath View Post
    It would be better to do:
    Simba Code:
    for i := 0 to High(DTMArray) do
        FreeDTM(DTMArray[i]);
    i always forget about High

  7. #7
    Join Date
    Jan 2012
    Posts
    190
    Mentioned
    0 Post(s)
    Quoted
    10 Post(s)

    Default

    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?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •