Log in

View Full Version : Extremely Annoying DTM Error.



John
07-05-2012, 05:51 AM
I Have a script that uses These DTMS:
http://puu.sh/FZmZ
But I keep getting This error for no reason.
http://puu.sh/FZnD
It always comes up when I'm about 1 - 1 and a half hours into a proggy.

Does anyone Have a solution?

Note: I will only show SRL Members + my full code over Skype Screen Share.

zluo
07-05-2012, 06:02 AM
ctrl+f and see if freedtm is anywhere else? you probably already done this but meh

bolshak25
07-05-2012, 06:06 AM
do you constantly call these? or do you call load at the beginning and fre at the end?

John
07-05-2012, 06:07 AM
ctrl+f and see if freedtm is anywhere else? you probably already done this but meh
Thanks for the Idea but I've only used FreeDTM() where I showed you in the picture.


do you constantly call these? or do you call load at the beginning and fre at the end?
Call at the start and free on terminate. No other places.

Sir Ducksworthy
07-05-2012, 06:13 AM
Try using a TIntegerArray
SetLength(6, Dtmz);
Dtmz[0]:=DTMFROMSTRING('blahblah);
etc

Then AddOnTerminate(FreeDtmz);

In FreeDTMz; put

For I:=0 to High(Dtmz) do
Try
FreeDTM(Dtmz[I]);
Except
End;

You'll get no exceptions that way ;)
Also you can add as many as you want into the array and you won't need to worry about adding them to the FreeDTM procedure.
To me it sounds as if Lpouch is getting freed somewhere in your script before terminating somehow.

Hope that helps,
~Leet

John
07-05-2012, 06:28 AM
Try using a TIntegerArray
SetLength(6, Dtmz);
Dtmz[0]:=DTMFROMSTRING('blahblah);
etc

Then AddOnTerminate(FreeDtmz);

In FreeDTMz; put

For I:=0 to High(Dtmz) do
Try
FreeDTM(Dtmz[I]);
Except
End;

You'll get no exceptions that way ;)
Also you can add as many as you want into the array and you won't need to worry about adding them to the FreeDTM procedure.
To me it sounds as if Lpouch is getting freed somewhere in your script before terminating somehow.

Hope that helps,
~Leet
Gettin This..
http://puu.sh/FZI6
with
http://puu.sh/FZIQ

Brandon
07-05-2012, 06:34 AM
The reason why you're getting access violations/errors is because your dtm's are local. They need to be global.


var
ListOfDTMs: TIntegerArray;

Procedure LoadAll;
begin
SetLength(ListOfDTMs, 5);

ListOfDTMs[0] := DTMFromString('');
ListOfDTMs[1] := DTMFromString('');
ListOfDTMs[2] := DTMFromString('');
ListOfDTMs[3] := DTMFromString('');
ListOfDTMs[4] := DTMFromString('');
end;


Procedure FreeAll;
var
I, L: Integer;
begin
L:= High(ListOfDTMs);
For I:= 0 To L Do
FreeDTM(ListOfDTMs[I]);
end;

begin
LoadAll;
AddOnTerminate('FreeAll');
end.

John
07-05-2012, 06:36 AM
The reason why you're getting access violations/errors is because your dtm's are local. They need to be global.

They were Global?

Brandon
07-05-2012, 06:40 AM
They were Global?

I just posted the code..

Also you're doing Array of TIntegerArray which is equal to T2DIntegerArray. So when you index it, you're basically passing a TIntegerArray to FreeDTM which takes just an Integer Handle.

It should just be IntegerArray. No need for 2 Dimensions. Also do a set length on the global array unless you're going to do a const static array which is:

array [0..5] of Integer;

EDIT: Yours wasn't global in that picture. DTMz is local.

John
07-05-2012, 06:46 AM
I just posted the code..

Also you're doing Array of TIntegerArray which is equal to T2DIntegerArray. So when you index it, you're basically passing a TIntegerArray to FreeDTM which takes just an Integer Handle.

It should just be IntegerArray. No need for 2 Dimensions. Also do a set length on the global array unless you're going to do a const static array which is:

array [0..5] of Integer;

EDIT: Yours wasn't global in that picture. DTMz is local.

Oh sorry, i see what you mean now.

Sir Ducksworthy
07-05-2012, 12:42 PM
Hey I got your pm is everything working now? :)