IvanCodin Posted June 11, 2011 Share Posted June 11, 2011 I have seen this many times and have not been able to find anything that describes what the minus value does. Here is an example from the Help file that show what I am talking about. What do the -1 values do? #include <GUIConstantsEx.au3> Opt('MustDeclareVars', 1) Example() Func Example() Local $widthCell, $msg, $iOldOpt GUICreate("My GUI") ; will create a dialog box that when displayed is centered GUISetHelp("notepad") ; will run notepad if F1 is typed $iOldOpt = Opt("GUICoordMode", 2) $widthCell = 70 GUICtrlCreateLabel("Line 1 Cell 1", 10, 30, $widthCell) ; first cell 70 width GUICtrlCreateLabel("Line 2 Cell 1", -1, 0) ; next line <= Here is an example of what I mean GUICtrlCreateLabel("Line 3 Cell 2", 0, 0) ; next line and next cell GUICtrlCreateLabel("Line 3 Cell 3", 0, -1) ; next cell same line <= Here is another example GUICtrlCreateLabel("Line 4 Cell 1", -3 * $widthCell, 0) ; next line Cell1 GUISetState() ; will display an empty dialog box ; Run the GUI until the dialog is closed Do $msg = GUIGetMsg() Until $msg = $GUI_EVENT_CLOSE $iOldOpt = Opt("GUICoordMode", $iOldOpt) EndFunc ;==>Example Me Link to comment Share on other sites More sharing options...
czardas Posted June 11, 2011 Share Posted June 11, 2011 Default values. operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
MHz Posted June 11, 2011 Share Posted June 11, 2011 (edited) Ah, I see. The -1 used to be Default in some cases. Since then the Default keyword has come into play. So consider these use of -1 as Default. IMO, -1 should have been replaced by Default long ago in examples. Edit: Typo fix Edited June 11, 2011 by MHz Link to comment Share on other sites More sharing options...
water Posted June 11, 2011 Share Posted June 11, 2011 When using the GUI-functions it can have the meaning of "last used control". In this example -1 is replaced by the ControlID of the Combo. GUICtrlCreateCombo("", 10, 10) GUICtrlSetData(-1, "item1|item2|item3", "item3") My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
IvanCodin Posted June 11, 2011 Author Share Posted June 11, 2011 Thanks all!! I see I need to change some of my scripts :-) Me 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