SRL Archive - OSR Help

How to count DTMs in inventory?


ogustuce

2012-12-07 22:19:30

First is it possible?

second, i tried this


Function FUrnAmount:boolean;
var
x,y,FiredUrn:integer;
begin

FiredUrn := DTMFromString('mQwAAAHicY2ZgYHBiYmDwBWJzIJZkZGAQB2IxILY102RIDdRl2D4liEEOqI4fihmRMBAAAKnMBHQ=');
if FindDtm(FiredUrn,x,y,MIX1,MIY1,MIX2,MIY2) then
begin
if FiredUrn = 14 then
result:=true;
if FiredUrn < 14 then
Result:=false;
end;
FreeDtm(FiredUrn);
end;
but it doesnt work, any suggestion?

Brandon

2012-12-07 22:26:39

CountItemsIn(…….);

OR:

FindDTMs(TPA, ………);
Raastpa(TPA);

Length(TPA) will now give the amount of DTM's found and the locations of each one.

Flight

2012-12-07 22:34:02

Counting items via DTMs:

Count := CountItems('dtm', YOUR_DTM, []);

Your function, fixed:

Function FUrnAmount:boolean;
var
FiredUrn,C: Integer;
begin
FiredUrn := DTMFromString('mQwAAAHicY2ZgYHBiYmDwBWJzIJZkZGAQB2IxILY102RIDdRl2D4liEEOqI4fihmRMBAAAKnMBHQ=');
C := CountItems('dtm', FiredUrn, []);
Result := (C >= 14);
FreeDtm(FiredUrn);
end;

ogustuce

2012-12-07 22:40:21

Thank you flight