Sign in to follow this  
Followers 0
andromeda

Send commande

7 posts in this topic

hi,

When i use Send commande for send text for example on notepad, the send command is sent deveral times

for example if i use commande

send('toto',1)

send('{ENTER}'),0

then on the notepad i have

toto

toto

toto

toto

any idea ?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

The behaviour you describe suggests a loop. Please post the rest of your code as well (or at least a larger part of it). Also, the "0" behind Send("{ENTER}") must trigger an error. I presume it's a typo :D

Alzo

Edited by marfdaman

Don't take my pic to serious...~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~You Looked, but you did not see!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Share this post


Link to post
Share on other sites

The behaviour you describe suggests a loop. Please post the rest of your code as well (or at least a larger part of it). Also, the "0" behind Sen("{ENTER}") must trigger an error. I presume it's a typo :D

Alzo

My code delphi is :

var

i: integer;

sText: string;

begin

if trim(Edit1.Text) = '' then

begin

Showmessage('Veuillez saisir un texte');

ActiveControl := Edit1;

exit;

end;

FStop := False;

if (trim(Edit2.Text) = '') then Edit2.Text := '20';

if (trim(Edit3.Text) = '') then Edit3.Text := '400';

sText := trim(Edit1.Text);

for i := 1 to strToInt(Edit2.Text) do

begin

if FStop then break;

if sText <> '' then

begin

Autoit.Send(sText, 1);

Autoit.Send('{ENTER}', 0);

Autoit.Sleep(StrToInt(Edit3.Text));

end;

end;

if i put edt2.text := '10' then the outpout is ttriggered to 28 ???

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

I'm afraid I don't know delphi, so I can't tell what is going wrong. The autoit part appears to be correct to me :D

Edited by marfdaman

Don't take my pic to serious...~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~You Looked, but you did not see!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Share this post


Link to post
Share on other sites

I'm afraid I don't know delphi, so I can't tell what is going wrong. The autoit part appears to be correct to me :D

for me it don't work

when o put 10 it trigerred 35 times

i don't understand.

Thank in advance

Share this post


Link to post
Share on other sites

I don't know delphi either but I would sure be researching the behavior of:

strToInt(Edit2.Text) since it is obviously interpreting the value wrong.

Share this post


Link to post
Share on other sites

Why don't we try to limit the threads based on other scripting languages in this, theAutoit V3 support forum

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0