Jump to content

<guilist.au3> And $lbs_multiplesel


Recommended Posts

I get the following error. Anyone know why?

C:\Program Files\AutoIt3\beta\Include\test 4.au3 (27) : ==> Variable used without being declared.:

$listbox_1 = GUICtrlCreateList("", 50, 40, 180, 120, BitOR($LBS_SORT, $WS_BORDER, $WS_VSCROLL, $LBS_NOTIFY, $LBS_MULTIPLESEL))

$listbox_1 = GUICtrlCreateList("", 50, 40, 180, 120, BitOR($LBS_SORT, $WS_BORDER, $WS_VSCROLL, $LBS_NOTIFY, ^ ERROR

>AutoIT3.exe ended.

>Exit code: 0 Time: 24.333

Link to comment
Share on other sites

did you have the line

#include <GuiList.au3>

in your code?

Yes, I do. Thanks for replying.

*EDIT*

And if I add this, I get this:

Global Const $LBS_MULTIPLESEL = 0x8

:\Documents and Settings\[My Name]\Personal\AutoIt\Script - Tasks.au3(33,30) : ERROR: $LBS_MULTIPLESEL previously declared as a 'Const'

Global $LBS_MULTIPLESEL = 0x8

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Documents and Settings\[My Name]\My Documents\Personal\AutoIt\Script - Tasks.au3 - 1 error(s), 0 warning(s)

Edited by litlmike
Link to comment
Share on other sites

To keep it to a minimum, here is the problem script. There is another script that calls this function, let me know if you need more.

#include <GUIConstants.au3>
#include <GuiList.au3>
#include <Array.au3>

Global $String_Replacement
;Global $LBS_MULTIPLESEL = 0x8


$A_F = "A|B|C|D|E|F"
$G_L = "G|H|I|J|K|L"
$M_R = "M|N|O|P|Q|R"

Func GUI_3_Pick_Categories ()
    
    Global $MESSAGE = "The following buttons have been clicked"
    GUICreate("My GUI list", 700, 400); will create a dialog box that when displayed is centered
    
    $listbox_1 = GUICtrlCreateList("", 50, 40, 180, 120, BitOR($LBS_SORT, $WS_BORDER, $WS_VSCROLL, $LBS_NOTIFY, $LBS_MULTIPLESEL))
    GUICtrlSetData(-1, $A_F)
    
    $listbox_2 = GUICtrlCreateList("", 250, 40, 180, 120, BitOR($LBS_SORT, $WS_BORDER, $WS_VSCROLL, $LBS_NOTIFY, $LBS_MULTIPLESEL))
    GUICtrlSetData(-1, $G_L)
    
    $listbox_3 = GUICtrlCreateList("", 500, 40, 180, 120, BitOR($LBS_SORT, $WS_BORDER, $WS_VSCROLL, $LBS_NOTIFY, $LBS_MULTIPLESEL))
    GUICtrlSetData(-1, $M_R)
    
    $add_list = GUICtrlCreateList("", 350, 240, 180, 120, BitOR($LBS_SORT, $WS_BORDER, $WS_VSCROLL, $LBS_NOTIFY, $LBS_MULTIPLESEL))
    
    
    $add = GUICtrlCreateButton("Add", 65, 250, 75, 25)
    $clear = GUICtrlCreateButton("Clear", 160, 250, 75, 25)
    $done = GUICtrlCreateButton("Done", 260, 250, 75, 25)
    
    GUICtrlSetLimit(-1, 200); to limit horizontal scrolling
    Dim $msg_set_data_1
    GUISetState()
    $msg = 0
    While 1
        $msg = GUIGetMsg()
        Select
            Case $msg = $add
                $ret = _GUICtrlListGetSelItemsText($listbox_1)
                If IsArray($ret) Then
                    For $i = 1 To $ret[0]
                        GUICtrlSetData($add_list, $ret[$i])
                    Next
                EndIf
                
                
                $ret = _GUICtrlListGetSelItemsText($listbox_2)
                If IsArray($ret) Then
                    For $i = 1 To $ret[0]
                        GUICtrlSetData($add_list, $ret[$i])
                    Next
                EndIf
                
                
                $ret = _GUICtrlListGetSelItemsText($listbox_3)
                If IsArray($ret) Then
                    For $i = 1 To $ret[0]
                        GUICtrlSetData($add_list, $ret[$i])
                    Next
                EndIf
            Case $msg = $clear
                GUICtrlSetData($add_list, "")
            Case $msg = $GUI_EVENT_CLOSE
                Exit
                
            Case $msg = $done
                Dim $list_array[1] = [0]
                For $x = 0 To _GUICtrlListCount($add_list) - 1
                    ReDim $list_array[UBound($list_array) + 1]
                    $list_array[0] = $list_array[0] + 1
                    $list_array[UBound($list_array) - 1] = _GUICtrlListGetText($add_list, $x)
                Next
                
                
                $sDelim = "|"; delimiter
                $Replace_With = " & "
                $istart = 1;Starts _ArrayToString on This element number
                $array_as_string = _ArrayToString ( $list_array, $sDelim , $istart)
            ;$Array_Now_Split = StringSplit ( $array_as_string, $sDelim )               
                
                $String_Replacement = StringReplace ($array_as_string, $sDelim, $Replace_With)
                ToolTip ($String_Replacement)
                Return  
        EndSelect
    WEnd

EndFunc;==>GUI_3_Pick_Categories
Link to comment
Share on other sites

i get no errors

>"C:\Program Files\AutoIt3\SciTe\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /beta /ErrorStdOut /in "C:\Documents and Settings\FROST-GA\My Documents\AutoIt\test4.au3" /autoit3dir "C:\Program Files\AutoIt3\beta" /UserParams

>Running AU3Check (1.54.1.1) params: from:C:\Program Files\AutoIt3\beta

+>AU3Check ended.rc:0

>Running:(3.1.1.121):C:\Program Files\AutoIt3\beta\autoit3.exe "C:\Documents and Settings\FROST-GA\My Documents\AutoIt\test4.au3"

+>AutoIT3.exe ended.rc:0

>Exit code: 0 Time: 16.868

#include <GUIConstants.au3>
#include <GuiList.au3>
#include <Array.au3>

Global $String_Replacement
;Global $LBS_MULTIPLESEL = 0x8


$A_F = "A|B|C|D|E|F"
$G_L = "G|H|I|J|K|L"
$M_R = "M|N|O|P|Q|R"

GUI_3_Pick_Categories()

Func GUI_3_Pick_Categories ()
    
    Global $MESSAGE = "The following buttons have been clicked"
    GUICreate("My GUI list", 700, 400); will create a dialog box that when displayed is centered
    
    $listbox_1 = GUICtrlCreateList("", 50, 40, 180, 120, BitOR($LBS_SORT, $WS_BORDER, $WS_VSCROLL, $LBS_NOTIFY, $LBS_MULTIPLESEL))
    GUICtrlSetData(-1, $A_F)
    
    $listbox_2 = GUICtrlCreateList("", 250, 40, 180, 120, BitOR($LBS_SORT, $WS_BORDER, $WS_VSCROLL, $LBS_NOTIFY, $LBS_MULTIPLESEL))
    GUICtrlSetData(-1, $G_L)
    
    $listbox_3 = GUICtrlCreateList("", 500, 40, 180, 120, BitOR($LBS_SORT, $WS_BORDER, $WS_VSCROLL, $LBS_NOTIFY, $LBS_MULTIPLESEL))
    GUICtrlSetData(-1, $M_R)
    
    $add_list = GUICtrlCreateList("", 350, 240, 180, 120, BitOR($LBS_SORT, $WS_BORDER, $WS_VSCROLL, $LBS_NOTIFY, $LBS_MULTIPLESEL))
    
    
    $add = GUICtrlCreateButton("Add", 65, 250, 75, 25)
    $clear = GUICtrlCreateButton("Clear", 160, 250, 75, 25)
    $done = GUICtrlCreateButton("Done", 260, 250, 75, 25)
    
    GUICtrlSetLimit(-1, 200); to limit horizontal scrolling
    Dim $msg_set_data_1
    GUISetState()
    $msg = 0
    While 1
        $msg = GUIGetMsg()
        Select
            Case $msg = $add
                $ret = _GUICtrlListGetSelItemsText($listbox_1)
                If IsArray($ret) Then
                    For $i = 1 To $ret[0]
                        GUICtrlSetData($add_list, $ret[$i])
                    Next
                EndIf
                
                
                $ret = _GUICtrlListGetSelItemsText($listbox_2)
                If IsArray($ret) Then
                    For $i = 1 To $ret[0]
                        GUICtrlSetData($add_list, $ret[$i])
                    Next
                EndIf
                
                
                $ret = _GUICtrlListGetSelItemsText($listbox_3)
                If IsArray($ret) Then
                    For $i = 1 To $ret[0]
                        GUICtrlSetData($add_list, $ret[$i])
                    Next
                EndIf
            Case $msg = $clear
                GUICtrlSetData($add_list, "")
            Case $msg = $GUI_EVENT_CLOSE
                Exit
                
            Case $msg = $done
                Dim $list_array[1] = [0]
                For $x = 0 To _GUICtrlListCount($add_list) - 1
                    ReDim $list_array[UBound($list_array) + 1]
                    $list_array[0] = $list_array[0] + 1
                    $list_array[UBound($list_array) - 1] = _GUICtrlListGetText($add_list, $x)
                Next
                
                
                $sDelim = "|"; delimiter
                $Replace_With = " & "
                $istart = 1;Starts _ArrayToString on This element number
                $array_as_string = _ArrayToString ( $list_array, $sDelim , $istart)
           ;$Array_Now_Split = StringSplit ( $array_as_string, $sDelim )                
                
                $String_Replacement = StringReplace ($array_as_string, $sDelim, $Replace_With)
                ToolTip ($String_Replacement)
                Return  
        EndSelect
    WEnd

EndFunc;==>GUI_3_Pick_Categories

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
Share on other sites

i get no errors

Bah, I guess I will have to give you the other scripts. First one, is the main script, that includes all my scripts. I will give the other relevant scripts in a bit here.

#include <GUIConstants.au3>
#include <ACT_Functions.au3>
#include <Log_Ins.au3>
#include <Click_Time_Left.au3>
#include <Add_To_Date.au3>
#include <BasicEmail.au3>
#include <Open_Work_Stuff.au3>
#include <GUI_Time_Slots.au3>
#include <script - Write Proposal.au3>
#include <Thank_You_Come_Again.au3>
#include <test 4.au3>
;#include <GuiList.au3>

;Global Const $LBS_MULTIPLESEL = 0x8

;;;;;;;; Body of program would go here;;;;;;;;
While 1
    Sleep(100)
WEnd
;;;;;;;;
Link to comment
Share on other sites

This is the conditional script, that calls GUI_3. I had to change some of the data, because it is sensitive material, and if I posted, could get me in trouble.

*Edit*

When the script 'sees' $SF_Text, it should call our GUI above. Instead, this is when I get the errors mentioned.

Global $o_IE
Global $CIS_AA_Text = "BLAH BLAH"
Global $CIS_AA_Text_NEW = "BLAH BLAH x2"
Global $CIS_Text = "BLAH BLAH BLAH BLAH BLAH BLAH"
Global $CIS_Text_NEW = "BLAH BLAH"
Global $DA_Text_NEW = "BLAH BLAH"
Global $FA_Text = "BLAH BLAH"
Global $FA_Text_NEW = "BLAH BLAH"
Global $SF_Text = "WHY Won't you work?!"
Global $SF_Text_NEW = "IF you see this, I work correctly!!!"
Global $xxxxxxxxx = "BLAH BLAH"
Global $String_Replacement


Func Edit_Descriptions_Page ($var)
;Edit Description on the IE Page
sleep (500)
$o_SearchForm = _IEFormGetObjByIndex ($o_IE, 0)
$o_Keywords = _IEFormElementGetObjByIndex ($o_SearchForm, "description" & $var)
_IEAction($o_Keywords,"focus")
_IEAction($o_Keywords,"selectall")
Send("{CTRLDOWN}c{CTRLUP}")
$description_text = ClipGet ()
ToolTip ($description_text)
Sleep (1000)
ToolTip ("")

If $description_text = $CIS_AA_Text Then
    _IEFormElementSetValue ($o_Keywords, $CIS_AA_Text_NEW)
EndIf

If $description_text = $CIS_Text Then
    _IEFormElementSetValue ($o_Keywords, $CIS_Text_NEW)
EndIf

If $description_text = $FA_Text Then
    _IEFormElementSetValue ($o_Keywords, $FA_Text_NEW)
EndIf

If $description_text = $DA_Text Then
    _IEFormElementSetValue ($o_Keywords, $DA_Text_NEW)
EndIf;Works Great to here!

If $description_text = $SF_Text Then
    GUI_3_Pick_Categories ()
    $Description_New = StringReplace ( $SF_Text_NEW, $xxxxxxxxx, $String_Replacement)
    _IEFormElementSetValue ($o_Keywords, $SF_Text_NEW)
EndIf

Return
EndFunc
Edited by litlmike
Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...