Old Bad Posted January 30, 2012 Share Posted January 30, 2012 How i will get that h index in to integer (tk), in case that index is that when script finds DTM (not the last (3 in that script)) maybe i will get differently that integer tk which indicates what DTM was found ? program New; var h: array of Integer; Index,DTM55,DTM56,DTM57,DTM58,k,l ,tk: Integer; klots1:boolean; begin DTM55 := DTMFromString('78DA63F4606060106240013549109A11CA670' + '4A9F120A0C68C48352A04D40811A986809B0157BD075D'); DTM56 := DTMFromString('78DA6314626060006124509304A119A17C463' + '322D5A81050A342841A2122D59811A1C68308F79811E12F62D410B00' + 'B002C920BEB'); DTM57 := DTMFromString('78DA6354616060106240013549109A11CA67F' + '420420DC81C15026ACC88546346845DC4A8F120C25F04D400007EDF0' + '9F5'); DTM58 := DTMFromString('78DA6354616060106240013549109A11CA678' + 'C22420DC81C33026ACC8854A342408D07916ACC88F017013500AF3F0' + 'A3D'); SetLength(h, 4); h[0] := DTM57; h[1] := DTM55; h[2] := DTM56; h[3] := DTM58; for Index := Low(h) to High(h) do if (klots1=false) then begin if FindDTM(h[index],k,l,0,0,400,400) then begin tk:=(h[index]); writeln('tk:='+inttostr(tk)); writeln('klots found'); klots1:= true; end; end; end. Quote Link to comment Share on other sites More sharing options...
FHannes Posted January 30, 2012 Share Posted January 30, 2012 I don't understand what you're asking Quote Link to comment Share on other sites More sharing options...
Old Bad Posted January 30, 2012 Author Share Posted January 30, 2012 something like this if script finds DTM57 then then tk:= 0 and if DTM56 then tk:=1 and if DTM56 then tk:=2 and so on but how?? and i have 60 diference DTMs by the way Quote Link to comment Share on other sites More sharing options...
FHannes Posted January 30, 2012 Share Posted January 30, 2012 Looks like you're doing it right already, but you should put "Break;" after "klots1:= true;", so it doesn't continue searching the other dtms when it has found one. Quote Link to comment Share on other sites More sharing options...
Old Bad Posted January 30, 2012 Author Share Posted January 30, 2012 Break dont work even if i dont use h[3] it will give me tk value 3 ---------- Post added at 11:10 PM ---------- Previous post was at 11:06 PM ---------- i get it working needed to change also tk:=h[index]; into tk:=Index; thanx Quote Link to comment Share on other sites More sharing options...
FHannes Posted January 30, 2012 Share Posted January 30, 2012 hmm yes, i didn't notice that... However, you should use Break and remove the klots1 stuff. Quote Link to comment Share on other sites More sharing options...
Bixby Sayz Posted January 31, 2012 Share Posted January 31, 2012 Nvm. Ninjad by Freddy again. Quote Link to comment Share on other sites More sharing options...