Function in a Function ?

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
lebrocoli
Pro Scripter
Posts: 53
Joined: Tue Sep 06, 2005 9:28 pm

Function in a Function ?

Post by lebrocoli » Fri Oct 05, 2007 7:11 pm

Hi!

Another beginner question!

I know I can do this Send>a

Now, in order to send the next avaible, my thinking was to convert to ascii first and then add 1.

But I tried various things with braces and percentage signs but nothing seems to work.

As an example, how do I do that?

Send>Ascii>97


The ultimate goal is to do something like:

Let> VAR=97
Send> Ascii>%VAR%+1


Waiting for your help!
Thanks in advance!

User avatar
JRL
Automation Wizard
Posts: 3517
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Fri Oct 05, 2007 7:40 pm

Here's a sample of what I think you're asking for.

Code: Select all

Run>Notepad.exe
WaitWindowOpen>Notepad*
Wait>1

Let>Char=96
Repeat>Char
add>Char,1
SetFocus>NotePad*
Ascii>%Char%

Wait>0.01
Until>Char=122

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Fri Oct 05, 2007 7:48 pm

Another way to skin the cat:

VBstart
VBend
Let>mynum=97
VBEval>chr(%mynum%),mychar
MDL>mychar
Let>mynum=mynum+1
VBEval>chr(%mynum%),mychar
MDL>mychar

lebrocoli
Pro Scripter
Posts: 53
Joined: Tue Sep 06, 2005 9:28 pm

Post by lebrocoli » Fri Oct 05, 2007 7:58 pm

Ok thanks.

I asked the question because I thought I had to use the 'send' command to send stuff in a GUI text field.

So I guess the question is:

What is the difference in using just Ascii>97 or using Send>Ascii>97 ?

Can we say that the internal 'Ascii' command already has a 'hidden' 'Send' command in it? You know what I mean?

Thanks!

User avatar
JRL
Automation Wizard
Posts: 3517
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Fri Oct 05, 2007 8:08 pm

What is the difference in using just Ascii>97 or using Send>Ascii>97 ?
The obvious difference is that Send>Ascii>97 won't work.
Can we say that the internal 'Ascii' command already has a 'hidden' 'Send' command in it?
I don't know the secret inner workings of the functions but as a generality, Yes, the Ascii> function performs a send. Look up Ascii in help for more info.

User avatar
Marcus Tettmar
Site Admin
Posts: 7391
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Fri Oct 05, 2007 8:30 pm

Ascii> does the same as Send> in that it sends the character specified by the ascii code. Send sends the actual characters entered. But they both "Send" the result to the active window.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

lebrocoli
Pro Scripter
Posts: 53
Joined: Tue Sep 06, 2005 9:28 pm

Post by lebrocoli » Tue Oct 09, 2007 2:39 pm

Makes sense now.

Thanks a lot!
That's great!

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts