Jump to content



Photo

Inconsistencies w/ Send() and Bigger Question


  • Please log in to reply
1 reply to this topic

#1 jdickens

jdickens

    Prodigy

  • Active Members
  • PipPipPip
  • 150 posts

Posted 30 December 2004 - 03:20 PM

Hi:
I am hoping this is reproducible for someone.
This seems to reveal some timing issue with AutoIt:

This func is still being written; ignore the irrelevant bits.
I have stripped out some things to make it briefer.
Most valid lines have: ;***:

func SendDataToVAM ($Successful)
$ValToTest = String(GuiCtrlRead($UnitNumEdit)) ; usually 015000
if NOT ValidateUnitNum($ValToTest) then
MsgBox(0, "Bad Input", "Correct Unit Num.")
else
MsgBox(0, "", $ValToTest) ;My Sanity Check 1
endif

if WinExists("AccountMate 6.5 for SQL Licensee: Farber RV") then
WinActivate("AccountMate 6.5 for SQL Licensee: Farber RV")
Send("MAIN{ENTER}JOB{ENTER}")
Send($ValToTest) ;***
Send("{ENTER}Scan Reader Test{ENTER}") ;***
;Originally, two lines above were on one line:
; Send(GuiCtrlRead($UnitNumEdit)+"{ENTER}Scan Reader Test{ENTER}")
MsgBox(0, "", $ValToTest) ;My Sanity Check 2
endif
endfunc

ValidateUnitNum confirms that there is 6 digits (characters, actually).
Send commands will plop the keys into various Edit boxes in the targeted app, with Enter refocusing among edit boxes.
When I had the *Original* code, here commented out, I got inconsistent values to app. The current code works -- why?
It was apparently stripping first char, since I got five chars sent to my app. I suspected an unwanted formatting of my input, because I use 015000 to test, and I kept getting 15000.
But one time I got 1500 for my send to my app.
Sanity Checks always come out fine.

My bigger question is:
Does AutoIt suffer from inconsistencies when the timing of apps it interacts with are slow running? I have also had intermittent problems Activating and Closing Windows using AutoIt when the app in question was sluggish.

J
PS This was using beta (GUI) version of AutoIt, but I thought q belonged here.
If I am too verbose, just say so. You don't need to run on and on.







#2 Jos

Jos

    oh joy ...

  • Developers
  • 21,071 posts

Posted 30 December 2004 - 07:07 PM

My bigger question is:
Does AutoIt suffer from inconsistencies when the timing of apps it interacts with are slow running?  I have also had intermittent problems Activating and Closing Windows using AutoIt when the app in question was sluggish.

<{POST_SNAPBACK}>

It is very likely you need to put some sleep(???) between you sends to give the cursor the time to position. Try playing with that a bit....
Preferably use Control commands if possible...

Visit the SciTE4AutoIt3 Download page for the latest versions                                                                 Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users