TheDcoder

Maps 101: All you need to know about them!

49 posts in this topic

#1 ·  Posted (edited)

Hello Again! I previously stumbled upon a topic asking for maps datatype's instructions... I too wasn't sure what a map is until I tried it... So I am making this topic to help other newbies (and some oldbies) better understand the Maps datatype of AutoIt! Lets start! :D

A Note for Readers

The maps datatype is still in development and is currently in Alpha Stage (More Risky than Beta) and its unstable, so AutoIt can crash indefinably while using Maps! I can't guarantee if this will be implemented in stable versions, this is a fairly new thing to AutoIt coders & in my honest opinion I don't see any use for it Maps are the best datatype in AutoIt, Very Useful ^_^... Not hurting anyone though ;).  Also the maps datatype is DISABLED IN STABLE VERSIONS, So you need to install the latest beta version of AutoIt to make maps work :). If you find any bugs while using a map, please report it in the Official Bug Tracker

Introduction To Maps

Maps are just like arrays, instead they use "keys" to access elements inside them... A key can be either a string or an integer (Other datatypes work too but they are converted to a integer [Equivalent to Int($vKey)] before assignment [Source]). Although Integers don't represent the order of elements in a map unlike in an array...

Declaring Maps

Its similar to declaring an Array:

; This is the only way to declare a map
; You must have a declarative keyword like Dim/Global/Local before the declaration unless the map is assigned a value from a functions return

Local $mMap[] ; Don't insert any numbers or strings it!

Simple, Isn't it? :D

Using Maps

Using maps is similar to arrays (again!):

Local $mMap[] ; Lets declare our map first!

; Adding data to maps is easy...

; This is our key
;       |
;       v
$mMap["Key"] = "Value" ; <--- And our value!

; A key is Case-Sensitive meaning "Key" is not same as "key"!

$mMap["key"] = "value" ; Not the same as $mMap["Key"]!

; There are 2 different ways to access an element in a map

$mMap["Key"] ; 1st Method
$mMap.Key    ; 2nd Method

 Enumerating Maps

Its quite easy to enumerate through arrays but what about maps? how can I enumerate through them!?

#include <MsgBoxConstants.au3>

; Lets create our map first
Local $mMap[]

; Lets add some information to the map, feel free to modify & add new elements
$mMap["Name"] = "Damon Harris"
$mMap["Alias"] = "TheDcoder"
$mMap["Gender"] = "Male"
$mMap["Age"] = 14
$mMap["Location"] = "India"

$aMapKeys = MapKeys($mMap) ; MapKeys function returns all the keys in the format of an array
Local $sProfile = "Profile of " & $mMap["Name"] & ':' & @CRLF ; We will use this string later

For $vKey In $aMapKeys ; We use this to get the keys in a map :)
    $sProfile &= @CRLF & $vKey & ': ' & $mMap[$vKey] ; Add some details to the profile string using our map!
Next

MsgBox($MB_ICONINFORMATION + $MB_OK, "Profile", $sProfile) ; Finally display the profile :)

It is easy as always :P

Multi-Dimensional Maps

Now now... I know that you are a little confused that how can an multi-dimensional maps exist... Although I am not 100% sure if its called that but lets continue:

10d2e8e0d938774a7916595bedab6db8.png

#include <MsgBoxConstants.au3>

; Multi-Dimensional maps are just maps in a map

Local $mMapOfMapsvilla[] ; This map will store an other map

Local $mParkMap[] ; This Park map will be inserted in the Mapsvilla's map :P

$mMapOfMapsvilla["Map Item 1"] = "Town Hall"
$mMapOfMapsvilla["Map Item 2"] = "Police Station"
$mMapOfMapsvilla["Map Item 3"] = "Shopping Mall"
$mMapOfMapsvilla["Map Item 4"] = "Residential Area"
$mMapOfMapsvilla["Map Item 5"] = "Park"

$mParkMap["Map Item 1"] = "Cottan Candy Stand"
$mParkMap["Map Item 2"] = "Public Toilet"
$mParkMap["Map Item 3"] = "Woods"

$mMapOfMapsvilla.Park = $mParkMap

MsgBox($MB_OK, "Map Location", $mMapOfMapsvilla["Map Item 1"]) ; Will display Town Hall
MsgBox($MB_OK, "Map Location", $mMapOfMapsvilla.Park["Map Item 1"]) ; Will display Cottan Candy Stand

I am sure its easy for you to understand now :)

Frequently Asked Questions (FAQs) & Their answers

Q #1. Help! My code does not respond to anything (or) I get an "Variable subscript badly formatted" error on the line of declaration...
A. DONT USE F5 or Go, Instead use Alt + F5 or Tools -> Beta Run in SciTE (Make sure that you have Beta installed)

Q #2. Why are you using "m" in-front of every map variable?
A. Best coding Practices: Names of Variables :)

Q #3. What are "Elements" which you mention frequently???
A. This is a newbie question (I have no intention of insulting you :)), so I guess you are new to programming. "Elements" are data slots inside a Map (or an Array), you can imagine elements as individual variable which are stored in a Map. You can access them using "keys", Please refer to "Introduction to Maps" section at the starting of this post :)

Q #4. Are Maps faster than Arrays?
A. You need to understand that Maps have different purpose than Arrays. Maps are designed to store data dynamically (like storing information for certain controlIDs of GUI) and Arrays are designed to store data in a order (for instance, Storing every character of a string in an element for easy access). If you still want to know then if Maps are faster, then the answer is maybe... Maps are *supposed* (I am not sure :unsure:) to be faster in addition of elements (while Arrays are painfully slow while adding or removing elements). Here (Post #24) is a benchmark (Thanks kealper! :D)

 

More FAQs coming soon! Feel free to ask a question in the mean while :)

Edited by TheDcoder
Modified "Introduction To Maps" about using other datatypes as keys...
4 people like this

AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Spoiler

My contributions to the AutoIt Community

Some messages & Apologizes:

If I hurt you, Please accept my apologies, I never (regardless of the situation) mean to hurt anybody!!!

Also, I am very busy with my project so I will appear in the last row of the online list, if you want to contact me: Email@TheDcoder.xyz

Or you can have a nice chat with me in freenode, I use the same nick on freenode too!

3fHNZJ.gif

PLEASE JOIN ##AutoIt AND HELP THE IRC AUTOIT COMMUNITY!

Share this post


Link to post
Share on other sites



I am lucky because:

  1. The above post was my 1123rd post :D
  2. I completed the post just before deadline :P

I hope you may enjoy the read, TD :)


AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Spoiler

My contributions to the AutoIt Community

Some messages & Apologizes:

If I hurt you, Please accept my apologies, I never (regardless of the situation) mean to hurt anybody!!!

Also, I am very busy with my project so I will appear in the last row of the online list, if you want to contact me: Email@TheDcoder.xyz

Or you can have a nice chat with me in freenode, I use the same nick on freenode too!

3fHNZJ.gif

PLEASE JOIN ##AutoIt AND HELP THE IRC AUTOIT COMMUNITY!

Share this post


Link to post
Share on other sites

Wow this looks cool, I am sure it will come in handy.  I just sort of got comfortable with Arrays not too long ago, I assume that Maps are going to be sort of like RegEx.

"The best practice is to not use them unless you need them" and still stick to Arrays for most tasks.

I would love to see some real life examples however of where a map can more easily do what an array could not so that I can sort of wrap my head around when this would be best used or make a task easier. 

Share this post


Link to post
Share on other sites

I can't think use of maps too :P, But I guess I will eventually discover its use :)


AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Spoiler

My contributions to the AutoIt Community

Some messages & Apologizes:

If I hurt you, Please accept my apologies, I never (regardless of the situation) mean to hurt anybody!!!

Also, I am very busy with my project so I will appear in the last row of the online list, if you want to contact me: Email@TheDcoder.xyz

Or you can have a nice chat with me in freenode, I use the same nick on freenode too!

3fHNZJ.gif

PLEASE JOIN ##AutoIt AND HELP THE IRC AUTOIT COMMUNITY!

Share this post


Link to post
Share on other sites

use a For..In Loop, instead of a For...To Loop.     Unless thats bad form, imho it looks cleaner.


,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Share this post


Link to post
Share on other sites
$mParkMap["Map Item 1"] = "Cottan Candy Stand"
$mParkMap["Map Item 2"] = "Public Toilet"
$mMapOfMapsvilla["Map Item 3"] = "Woods"

I don't get that bit.

Are you deliberately moving the woods in the park to the shopping mall in mapsvilla?


AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

@JohnOne :P People in the shopping mall wanted some sandal wood

@boththose How can I get the key to the element if I use For...In?

Edited by TheDcoder
forgot to reply boththose

AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Spoiler

My contributions to the AutoIt Community

Some messages & Apologizes:

If I hurt you, Please accept my apologies, I never (regardless of the situation) mean to hurt anybody!!!

Also, I am very busy with my project so I will appear in the last row of the online list, if you want to contact me: Email@TheDcoder.xyz

Or you can have a nice chat with me in freenode, I use the same nick on freenode too!

3fHNZJ.gif

PLEASE JOIN ##AutoIt AND HELP THE IRC AUTOIT COMMUNITY!

Share this post


Link to post
Share on other sites
#include <MsgBoxConstants.au3>

; Lets create our map first
Local $mMap[]

; Lets add some information to the map, feel free to modify & add new elements
$mMap["Name"] = "Damon Harris"
$mMap["Alias"] = "TheDcoder"
$mMap["Gender"] = "Male"
$mMap["Age"] = 14
$mMap["Location"] = "India"

$aMapKeys = MapKeys($mMap) ; MapKeys function returns all the keys in the format of an array
Local $sProfile = "Profile of " & $mMap[$aMapKeys[0]] & ':' & @CRLF ; We will use this string later

For $Key In $aMapKeys
    msgbox(0, '' , $Key & " = " & $mMap[$Key])
next

 


,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Share this post


Link to post
Share on other sites

AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Spoiler

My contributions to the AutoIt Community

Some messages & Apologizes:

If I hurt you, Please accept my apologies, I never (regardless of the situation) mean to hurt anybody!!!

Also, I am very busy with my project so I will appear in the last row of the online list, if you want to contact me: Email@TheDcoder.xyz

Or you can have a nice chat with me in freenode, I use the same nick on freenode too!

3fHNZJ.gif

PLEASE JOIN ##AutoIt AND HELP THE IRC AUTOIT COMMUNITY!

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

You can also keep your Funcs in your map with your data

; Lets create our map first
Local $mMap[]

; Lets add some information to the map, feel free to modify & add new elements
$mMap["Name"] = "Damon Harris"
$mMap["Alias"] = "TheDcoder"
$mMap["Gender"] = "Male"
$mMap["Age"] = 14
$mMap["Location"] = "India"
$mMap["Keys"] = MapKeys($mMap)


For $Key In $mMap["Keys"]
    If $Key <> "Keys" Then msgbox(0, '' , $Key & " = " & $mMap[$Key])
next

 

Edited by boththose
1 person likes this

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Share this post


Link to post
Share on other sites

@boththose Nice trick ;), But I will implement it in another example


AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Spoiler

My contributions to the AutoIt Community

Some messages & Apologizes:

If I hurt you, Please accept my apologies, I never (regardless of the situation) mean to hurt anybody!!!

Also, I am very busy with my project so I will appear in the last row of the online list, if you want to contact me: Email@TheDcoder.xyz

Or you can have a nice chat with me in freenode, I use the same nick on freenode too!

3fHNZJ.gif

PLEASE JOIN ##AutoIt AND HELP THE IRC AUTOIT COMMUNITY!

Share this post


Link to post
Share on other sites

I really don't like documenting alpha (not beta) functionality in the open Forum, because it's suggesting that this will at some point be included in a future release of AutoIt, unless @TheDcoder has been told something I don't know about?!


_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

@guinness I think I will update the introduction to be more specific on the current stage of development of maps :)

@TheDcoder has been told something I don't know about?!

Ummm... Maybe.... Maybe Not :P


AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Spoiler

My contributions to the AutoIt Community

Some messages & Apologizes:

If I hurt you, Please accept my apologies, I never (regardless of the situation) mean to hurt anybody!!!

Also, I am very busy with my project so I will appear in the last row of the online list, if you want to contact me: Email@TheDcoder.xyz

Or you can have a nice chat with me in freenode, I use the same nick on freenode too!

3fHNZJ.gif

PLEASE JOIN ##AutoIt AND HELP THE IRC AUTOIT COMMUNITY!

Share this post


Link to post
Share on other sites

i would want to explore maps in maps to achieve the OP.  start at the smallest unit throwing them into larger and larger containers..

Local $mMapGlo[]
Local $mMapLocAus[]
Local $mMapLocDal[]
Local $mMapPersonNorth[]
Local $mMapPersonSouth[]
Local $mMapPersonDallas[]


$mMapPersonNorth["Jeff"] = "Jeff in N. Austin"
$mMapPersonSouth["Jack"] = "Jack in S. Austin"
$mMapPersonDallas["John"] = "John in Dallas"

$mMapLocAus["NorthAus"] = $mMapPersonNorth
$mMapLocAus["SouthAus"] = $mMapPersonSouth
$mMapLocDal["Dallas"] = $mMapPersonDallas

$mMapGlo["CentralTx"] = $mMapLocAus
$mMapGlo["NorthTx"] = $mMapLocDal


For $loc in $mMapGlo
    For $key in mapkeys($loc)
        For $item in $loc[$key]
            msgbox(0, '' , $key & @LF & $item)
        Next
    Next
next

 


,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Share this post


Link to post
Share on other sites

Its very similar to Scripting.Dictionary!

I thinking maps is recursive, it is?


m(o.O)m

Share this post


Link to post
Share on other sites

@Luigi Yes :)

 

I am happy to see people discovering new things with maps! Keep up the good work guys! :D


AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Spoiler

My contributions to the AutoIt Community

Some messages & Apologizes:

If I hurt you, Please accept my apologies, I never (regardless of the situation) mean to hurt anybody!!!

Also, I am very busy with my project so I will appear in the last row of the online list, if you want to contact me: Email@TheDcoder.xyz

Or you can have a nice chat with me in freenode, I use the same nick on freenode too!

3fHNZJ.gif

PLEASE JOIN ##AutoIt AND HELP THE IRC AUTOIT COMMUNITY!

Share this post


Link to post
Share on other sites

Are Maps similar to dynamic arrays? If you are inserting or deleting from a Map, does it work faster than an array?

Share this post


Link to post
Share on other sites

#19 ·  Posted (edited)

maps are similar to scripting.dictionary which is similar to an ini which i guess is similar to a 2D array with equal signs?

Edited by boththose

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Share this post


Link to post
Share on other sites

@MartinMarris  I thinks its a yes... I am not familiar with the concept of dynamic arrays but a quick google search explained me about them, though I didn't use them, I can say that a Map is similar (not same) to dynamic arrays, Resizing a map (i.e adding or removing elements from it) is faster compared to arrays.

 

Sorry for late reply, I was busy, TD :)


AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Spoiler

My contributions to the AutoIt Community

Some messages & Apologizes:

If I hurt you, Please accept my apologies, I never (regardless of the situation) mean to hurt anybody!!!

Also, I am very busy with my project so I will appear in the last row of the online list, if you want to contact me: Email@TheDcoder.xyz

Or you can have a nice chat with me in freenode, I use the same nick on freenode too!

3fHNZJ.gif

PLEASE JOIN ##AutoIt AND HELP THE IRC AUTOIT COMMUNITY!

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

  • Similar Content

    • Nareshm
      By Nareshm
      How to repeat my script when my control class does not match ?
       
      My Script : winActivate ( " PS :: Version - 2.2.0.0  - [PS Bill]")                   ControlClick ( "PS :: Version - 2.2.0.0  - [PS Bill]", "", "[NAME:btnSavebyFP]")                   ControlSend(" PS :: Version - 2.2.0.0  - [PS Bill]", "", "[NAME:btnSavebyFP]", "{enter}")                   WinActive ("Verification Number Entry ::")                   ControlClick("Next >", "","[NAME:btnNext]") ;if   >>>> Control <<<<  does not match repeat my script, ;if match exit script  

      Class:    WindowsForm734a
      Instance:    15
      ClassnameNN:    WindowsForm34a15
      Name:    BillPrint
      Advanced (Class):    [NAME:BillPrint]
      ID:    7875
      Text:    
      Position:    39, 310
      Size:    1221, 306
      ControlClick Coords:    745, 20
      Style:    0x56010000
      ExStyle:    0x00000000
      Handle:    0x00000000000C0468
    • Nareshm
      By Nareshm
      Please Somebody Help me i am trying to create new script but, i don't know how to create it.

      I am Creating script like this :
      ; My script here [First Script]
      Check the internet connection, if internet connected then
      ; My Script here [Second Script]
      If internet not connected, wait for connect, after connected run my second script
      If Control id/windows/title matched do nothing and end/exit autoit script
      If Control id/windows/title not matched repeat my first and second script again until control id/windows/tittle not matched

      match with :
      >>>> Window <<<<
      Title:    PS :: Version - 2.8.0.0  - [PS Bill]
      Class:    WindowsForm734a
      Position:    -8, -8
      Size:    1382, 744
      Style:    0x17CD0000
      ExStyle:    0x00050100
      Handle:    0x0000000000130572
      >>>> Control <<<<
      Class:    WindowsForm734a
      Instance:    15
      ClassnameNN:    WindowsForm34a15
      Name:    BillPrint
      Advanced (Class):    [NAME:BillPrint]
      ID:    7875
      Text:    
      Position:    39, 310
      Size:    1221, 306
      ControlClick Coords:    745, 20
      Style:    0x56010000
      ExStyle:    0x00000000
      Handle:    0x00000000000C0468
       
    • Nareshm
      By Nareshm
      I create message box but i dont know how to add button action when i click it.

      Help for : Add script for Button : Left, Right, Right Finger
      example when i press Left finger button do Case $idNotepad
                      $iPID = WinActivate ( " :PS :: Version - 2.8.0.0  - [eFS Bill]")
                              ControlSend(" :DS  - eF :: Version - 2.8.0.0  - [eF Bill]", "", "[NAME:btnReset]", "{esc}")
                              ControlClick ( " :DS  - eF :: Version - 2.8.0.0  - [eF Bill]", "", "[NAME:txtrdNo]")
                              ControlSend(" :DS  - eF:: Version - 2.8.0.0  - [eF Bill]", "", "[NAME:txtrdNo]", "^v")
                              ControlSend(" :DS  - eF :: Version - 2.8.0.0  - [eF Bill]", "", "[NAME:txtrdNo]", "{enter}")
      How to add like above ?
                    
                                                                sorry for my bad english
       
    • nacerbaaziz
      By nacerbaaziz
      Hi friends, I have a question, please.
      I have created a window containing a edit box
      I need to know how to change the keyboard language,
      e.g :
      if a user open the  script  it will be change the keyBord language   in window automatically into English
      I found more examples but didn't work with me .
      Note:  
       I use the windows 10 os
      Please help me .
      thanks in advance to all
      with my Greetings and my appreciation for all users and admins
    • JustinZandee
      By JustinZandee
      I want to create a loop which loops a code until for example f2 is pressed.
      So I tried something with _IsPressed but it doesn't work.
      Local $test = WinActivate("Notepad") Do Send("hi") Until _IsPressed("72", $test)  
      I don't know how I can do nothing when pressing f2 because it says "error: _IsPressed(): undefined function.".
      I did put 
      Send("hi") after Local $test = but it gives the same error.
      Does anyone know how to solve this problem? 
      Maybe I am wrong and I need to use a whole other Function.. I am new to AutoIT so I am sorry..