I am very confused about what is going on here but I have had a good look at it and a attempt to translate or decipher what is happening...
'i' counts the length of the AddPIN text
'b' is a var of the whole form. what's it doing at the end of this code?:
DTMF(copy(addPIN.text,i,1),b);
I think its telling the DTMF procedure to copy the AddPIN text (1 digit at a time) and...??? what is the 1 for? and b???
'j' start as 0 and counts until its less than 10x (multiplied by) the number specified in the SecondsBetweenPIN Text box. then it sleeps for 100 (milliseconds??.) after that, it adds 1 to 'j'
then it goes back to the start of the loop, it does this until 'i' reaches the length of the AddPIN text.
//***********************************************
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
b:integer;
procedure TForm1.DTMF(n:string;c:integer);
begin
if Assigned(CurrentCall) and CurrentCall.Active then
SimpleSip1.PlayWavFile(CurrentCall, AppPath+n+'.wav');
LOG('SEND: '+n);
end;
procedure TForm1.sendingPIN;
var i,j,b:integer;
begin
Log ('Now Sending PIN...');
for i:=1 to length(AddPIN.text) do
begin
DTMF(copy(addPIN.text,i,1),b);
j:=0;
while j<(10*StrToInt(SecondsBetweenPIN.Text)) do
begin
sleep(100);
application.ProcessMessages;
inc(j);
end;
end;
end;
//*************************************************
Ps: the reason I added the DTMF procedure is because i cant see how this procedure can do anything other than what its meant to do.
Could someone else have a go at deciphering this and perhaps correct me if I am wrong in my assumptions?
'i' counts the length of the AddPIN text
'b' is a var of the whole form. what's it doing at the end of this code?:
DTMF(copy(addPIN.text,i,1),b);
I think its telling the DTMF procedure to copy the AddPIN text (1 digit at a time) and...??? what is the 1 for? and b???
'j' start as 0 and counts until its less than 10x (multiplied by) the number specified in the SecondsBetweenPIN Text box. then it sleeps for 100 (milliseconds??.) after that, it adds 1 to 'j'
then it goes back to the start of the loop, it does this until 'i' reaches the length of the AddPIN text.
//***********************************************
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
b:integer;
procedure TForm1.DTMF(n:string;c:integer);
begin
if Assigned(CurrentCall) and CurrentCall.Active then
SimpleSip1.PlayWavFile(CurrentCall, AppPath+n+'.wav');
LOG('SEND: '+n);
end;
procedure TForm1.sendingPIN;
var i,j,b:integer;
begin
Log ('Now Sending PIN...');
for i:=1 to length(AddPIN.text) do
begin
DTMF(copy(addPIN.text,i,1),b);
j:=0;
while j<(10*StrToInt(SecondsBetweenPIN.Text)) do
begin
sleep(100);
application.ProcessMessages;
inc(j);
end;
end;
end;
//*************************************************
Ps: the reason I added the DTMF procedure is because i cant see how this procedure can do anything other than what its meant to do.
Could someone else have a go at deciphering this and perhaps correct me if I am wrong in my assumptions?