IvanCodin 0 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 Share this post Link to post Share on other sites
czardas 1,269 Posted June 11, 2011 Default values. operator64 ArrayWorkshop Share this post Link to post Share on other sites
MHz 80 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 Share this post Link to post Share on other sites
water 2,391 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 2020-10-10 - Version 1.5.2.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX (NEW 2020-12-15 - Version 1.6.3.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2020-06-27 - Version 1.3.2.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - WikiTask Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - WikiTutorials:ADO - Wiki, WebDriver - Wiki Share this post Link to post Share on other sites
IvanCodin 0 Posted June 11, 2011 Thanks all!! I see I need to change some of my scripts :-) Me Share this post Link to post Share on other sites