Alpha entry transformed to numeric

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
pzelenka
Newbie
Posts: 11
Joined: Mon Nov 25, 2002 9:55 pm
Location: South Dakota

Alpha entry transformed to numeric

Post by pzelenka » Mon Dec 16, 2002 5:30 pm

I am having a strange problem with the following script:

Cha>C:\Program Files\Meditech\MagicCS\Client\
Wait>1
Run Program>Vmagic.exe
CapsOn
Let>GAW_TYPE=1
Wait>1
GAW>window_title,x,y
If>window_title=Software by ABCDEF,login
Label>login
Wait>1
Send Character/Text>ABCXYZ
Press Enter
Send Character/Text>123456
Wait>0.3
Press Enter*2
WaitWindowOpen>ABC XYZ
Wait>0.5
REM>Let>GAW_TYPE=0
Wait>0.5
Press Down
Wait>0.5
Press Enter
WaitWindowOpen>abcdef*
WAIT>0.5
Press Right*2
Wait>0.5
Press Enter
WaitWindowOpen>abcdef*
Wait>0.5
Press Right*2
Wait>0.5
Press Enter
Wait>1.0
Press Down*9
Wait>0.3
Press Enter
Wait>0.5
****here is where the alpha is sent****
Send>y
****what is posted to the field is the number 86****
Wait>1.0
Press Enter*5
Wait>1
Send>pz
Wait>0.2
Press F12
Wait>2
Send>v
Wait>1
Press Enter

The Send>y command is posted in the filed as a number, 86. I have patched a command that will open notepad and have sent the "y" to the untitled document and what is presented is the number 86. I have changed the Send to Send>ny instead of just Send>y and the proper letters are posted. I have sent other letters using the Send command and they appear correctly.

Can anyone out there see anything in the script that might cause this to occur? Or, are there any ideas as to why this might be happening?

Thanks

pzelenka

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Mon Dec 16, 2002 5:53 pm

This is why:

GAW>window_title,x,y

y has now become a variable containing the value of the y axis coordinate of the upper left of the active window.

Here's a tip: If you ever encounter a problem like this and can't work it out - STEP THROUGH IT WITH THE DEBUGGER. Use the watch list and you will see the value of all the variables. If you step through your script then when you get to the above line you will see a variable called y appear. Then you suddenly go - OH THAT's what's causing it!

Another tip - use descriptive, sensible variable names, which are less likely to be confused with other values, like:

GAW>activewin_title,activewin_x,activewin_y
MJT Net Support
[email protected]

pzelenka
Newbie
Posts: 11
Joined: Mon Nov 25, 2002 9:55 pm
Location: South Dakota

Post by pzelenka » Mon Dec 16, 2002 10:32 pm

That was the problem. An variable not needed was ignored, I'm bad. I changed the variables created with GAW and the macro ran just fine.

I tried using the watch list for the first time on this macro after making the changes referred to above and I experienced some system errors while stepping through the script. The errors occur when the script reaches the first WaitWindowOpen. The program I am running under MS spawns a primary window and as routines are run, two other windows are opened both of which appear to be child windows. I am trying to detect the child windows as they open.

The error info is:

MSCHED caused an invalid page fault in
module MSCHED.EXE at 0177:004060a5.
Registers:
EAX=004086a8 CS=0177 EIP=004060a5 EFLGS=00010283
EBX=004086a8 SS=017f ESP=006ffdc4 EBP=00700354
ECX=00000000 DS=017f ESI=00700350 FS=4657
EDX=00700350 ES=017f EDI=00700454 GS=0000
Bytes at CS:EIP:
68 00 04 00 00 8d 44 24 04 50 8b 43 04 50 8b 03
Stack dump:

As I stated above the script runs fine, but it crashes when I step through using the debugger.

I'll look at again tomorrow mornin'.

Thanks for being gentle with your response.

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Tue Dec 17, 2002 7:45 am

This is not related to your original problem, but....

Maybe I missed something here, but what happens if the window title is NOT "Software by ABCDEF"?. It looked to me like you just continue with the same script no matter what the value is.

From your sample code:
If>window_title=Software by ABCDEF,login
Label>login
What is the action if window_title fails?
:?:
If it matches, you jump to login, which is the next line.
If it does not match you jump to the next line also.

Just curious :?

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