jaberwacky Posted August 20, 2016 Share Posted August 20, 2016 (edited) Hello. I'm trying to assign to a map, but I get the following error message: "..." (51) : ==> Subscript used on non-accessible variable.: $mSelected[$mCtrl.Hwnd] = $mCtrl $mSelected^ ERROR Here is a reproducer: Global $mCtrl[] $mCtrl.HWnd = GUICtrlCreateButton("ButtButt", 10, 10) Global $mSelected[] $mSelected[$mCtrl.HWnd] = $mCtrl Actually, my reproducer gives a different error: "...\Test.au3" (1) : ==> Variable subscript badly formatted.: Global $mCtrl[] Global $mCtrl[^ ERROR I can't find my error. Do you see it? Edited August 20, 2016 by jaberwacky Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
jaberwacky Posted August 20, 2016 Author Share Posted August 20, 2016 Actually, I forgot to run my reproducer under beta. Now there is no error in that. Still is one in the main script though. Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
jaberwacky Posted August 20, 2016 Author Share Posted August 20, 2016 (edited) Here is my exact function from the main script: Func _add_to_selected(Const $mCtrl) Switch MapExists($mSelected, $mCtrl.Hwnd) Case False $selected_count += 1 $mSelected[$mCtrl.Hwnd] = $mCtrl ConsoleWrite($selected_count & @TAB & $mCtrl.Hwnd & @CRLF) Return True EndSwitch Return False EndFunc HHHHHHHHRRRRRRRRRRNNNNNNNNNNNNNNNGGGGGGGGGGGGGGGGG!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! There is no reason this shouldn't work! Edited August 20, 2016 by jaberwacky Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
jaberwacky Posted August 20, 2016 Author Share Posted August 20, 2016 Nevermind, I figured it out!!!!!!!!!!!!!!!!!! Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now