faustf Posted September 18, 2018 Posted September 18, 2018 hi guys i have a script like this , 1 is base and 2 file is include but i dont understund why when i try to run a second not work select o_O example: 1 prog expandcollapse popup#include <AutoItConstants.au3> #include <ButtonConstants.au3> #include <ComboConstants.au3> #include <Date.au3> #include <Debug.au3> #include <EditConstants.au3> #include <Excel.au3> #include <File.au3> #include <FTPEx.au3> #include <GUIConstants.au3> #include <GUIConstantsEx.au3> #include <GuiComboBoxEx.au3> #include <GuiStatusBar.au3> #include <GuiListView.au3> #include <GuiToolbar.au3> #include <GUIImageList.au3> #include <GuiEdit.au3> #include <GuiIPAddress.au3> #include <GDIPlus.au3> #include <GuiMenu.au3> #include <GuiScrollBars.au3> #include <GuiTreeView.au3> #include <IE.au3> #include <InetConstants.au3> #include <Misc.au3> #include <MsgBoxConstants.au3> #include <StaticConstants.au3> #include <TabConstants.au3> #include <ToolbarConstants.au3> #include <String.au3> #include <WindowsConstants.au3> #include <WinAPIRes.au3> #include <WinAPIShellEx.au3> #include <WinAPIFiles.au3> #include <WinAPI.au3> #include <SQLite.au3> #include <SQLite.dll.au3> #include "second.au3" ; mail macro per la gestione dell email di ebay Opt("GuiOnEventMode", 1) Opt("GUICloseOnESC", 0) Opt("GUIResizeMode", 128) _de_test($sLKeyWord,1) while 1 sleep(100) whend 2 prog Func _de_test($iItem_prod, $debug = 0, $NewProd = 0, $ListingType = 0, $ResultXpage = 0, $HideDuplicate = 0, $CountryRegion = 0) Select Case $NewProd = 0 $NewProd = "New" Case $ListingType = 0 $ListingType = "All" Case $ResultXpage = 0 $ResultXpage = "2000" Case $HideDuplicate = 0 $HideDuplicate = "True" Case $CountryRegion = 0 $CountryRegion = "IT" MsgBox(0, '3437', $CountryRegion) EndSelect MsgBox(0, '3438', $CountryRegion) EndFunc when first prog call a second not work a selec and return me a $CountryRegion = 0 , why ?? thankz at all
Moderators Melba23 Posted September 18, 2018 Moderators Posted September 18, 2018 faustf, You have set a default value of 0 for the $CountryRegion parameter in your function definition line: Func _de_test($iItem_prod, $debug = 0, $NewProd = 0, $ListingType = 0, $ResultXpage = 0, $HideDuplicate = 0, $CountryRegion = 0) So why are you surprised when you call the function without defining a value for that parameter: _de_test($sLKeyWord,1) and the function uses that default value? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
faustf Posted September 18, 2018 Author Posted September 18, 2018 because i aspect , the select , change a value
Moderators Melba23 Posted September 18, 2018 Moderators Posted September 18, 2018 (edited) faustf, Sorry, missed that line! M23 Edit: The Select structure is exiting after the first correct match (Case $NewProd = 0) and so never reaches the $CountryRegion case. You cannot use a Select structure to check multiple cases. As all you are doing is replacing the default 0 value of each parameter with another value, why not set these values as default in the first place? Func _de_test($iItem_prod, $debug = 0, $NewProd = "New", $ListingType = "All", $ResultXpage = "2000", $HideDuplicate = "True", $CountryRegion = "IT") M23 Edited September 18, 2018 by Melba23 Typo Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
faustf Posted September 18, 2018 Author Posted September 18, 2018 because if i use 0 can omitted when call a function
KaFu Posted September 18, 2018 Posted September 18, 2018 Yeah, but as Melba said, the select exits after the first match, which is $NewProd = 0, and never test's the rest. Test them all individually with if... then... clauses. OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2025-May-18) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16)
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