SRL Archive - Help

Extremely Annoying DTM Error.


John

2012-07-05 01:51:47

I Have a script that uses These DTMS:
But I keep getting This error for no reason.
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

2012-07-05 02:02:38

ctrl+f and see if freedtm is anywhere else? you probably already done this but meh

bolshak25

2012-07-05 02:06:50

do you constantly call these? or do you call load at the beginning and fre at the end?

John

2012-07-05 02:07:02

From: zluo
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.

From: bolshak25
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

2012-07-05 02:13:20

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);
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

2012-07-05 02:28:26

From: leetsxc
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);
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..
with

Brandon

2012-07-05 02:34:52

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

2012-07-05 02:36:28

From: Brandon
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

2012-07-05 02:40:13

From: John
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

2012-07-05 02:46:02

From: Brandon
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

2012-07-05 08:42:02

Hey I got your pm is everything working now? :)