Jump to content

Recommended Posts

Posted

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

#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
Posted

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

  • Moderators
Posted (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 by Melba23
Typo

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Posted

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
×
×
  • Create New...