Sign in to follow this  
Followers 0
julia

how to see the value of a variable in SciTE4AutoIt3

3 posts in this topic

Dear all,

I'm quite new with AutoIt and programming in general. I'm trying to use AutoIt to periodically download data from a device which has an associated software for this purpose.

I'd like to use a simple function that I found in the web: _ControlMouseClick.au3 but I can't.

Global $aPos
$iTitle = "Kestrel® Tracker - Communicator"
$iText = "&Load from Kestrel® Tracker"
$iControl = "132512"
$iButton = "left"
$iClicks = "1"
$iSpeed = "10"
$iXpos = ""
$iYpos = ""
$iOriginal = Opt("MouseCoordMode", 2) ;Get the current MouseCoordMode; Change the MouseCoordMode to relative coords
$aPos = ControlGetPos($iTitle, $iText, $iControl) ;Get the position of the given control
;MouseClick($iButton,$aPos[0] + ($aPos[2]/2) + $iXpos, $aPos[1] + ($aPos[3]/2) + $iYpos, $iClicks, $iSpeed) ;Move the mouse and click on the given control
Opt("MouseCoordMode",$iOriginal) ;Change the MouseCoordMode back to the original

Trying to find out the problem, I would like to see the value of a variable ($aPos) on SciTE4AutoIt3 command line (?), how should I do that?

This is probably a very basic question but I would apprecite very much your help.

Thanks in advance.

Share this post


Link to post
Share on other sites



julia,

Welcome the the AutoIt forum. :)

You can do this by using either ConsoleWrite (the data appears in the lower SciTE pane while the script continues) or MsgBox (you see a dialog and the script halts until it is closed). Here is how you might do it:

Global $aPos
$iTitle = "Kestrel® Tracker - Communicator"
$iText = "&Load from Kestrel® Tracker"
$iControl = "132512"
$iButton = "left"
$iClicks = "1"
$iSpeed = "10"
$iXpos = ""
$iYpos = ""
$iOriginal = Opt("MouseCoordMode", 2) ;Get the current MouseCoordMode; Change the MouseCoordMode to relative coords
$aPos = ControlGetPos($iTitle, $iText, $iControl) ;Get the position of the given control

; Do some errorchecking
If IsArray($aPos) Then
    ; Now choose one of these and comment out the other
    ConsoleWrite($aPos[0] & " - " & $aPos[1] & @CRLF)
    MsgBox(0, "Position", $aPos[0] & " - " & $aPos[1])
Else
    ; And then the matching one of these
    ConsoleWrite("Error" & @CRLF)
    MsgBox(0, "Position", "Error")
EndIf

;MouseClick($iButton,$aPos[0] + ($aPos[2]/2) + $iXpos, $aPos[1] + ($aPos[3]/2) + $iYpos, $iClicks, $iSpeed) ;Move the mouse and click on the given control
Opt("MouseCoordMode",$iOriginal) ;Change the MouseCoordMode back to the original

All clear? :)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Dear M23,

thank for your reply. I understand yuor suggestion. I tried it with a different control and it works.

Thank you very much.

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