Jump to content

Why wont my list load? :(


BatMan22
 Share

Recommended Posts

I'm trying to make a form to select certain samples from a file and add it to another file.. Can't figure out why it wont work.. I tried it with and without the array, and the program just lists the file location instead of contents.. Also any chance someone has something like this already setup with each list attached to a file?

 

Thanks all :)

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <WindowsConstants.au3>
#include <FileConstants.au3>
#include <MsgBoxConstants.au3>
#include <WinAPIFiles.au3>
#include <Date.au3>
#include <File.au3>

Global $aDate, $aTime
$text = ClipGet()
$sFileName = "\\SERVER\Server H\Staff Dropbox\blah\" & @MON & @MDAY & @YEAR & ".que"

#Region ### START Koda GUI section ### Form=
$Form2 = GUICreate("Choices Dialog", 345, 252, -1, -1)
$ListBox1 = GUICtrlCreateList("", 8, 8, 137, 201)
GUICtrlSetData(-1, "Item1|Item2|Item3|Item4|Item5")
$Button1 = GUICtrlCreateButton(">", 156, 15, 30, 25)
$Button2 = GUICtrlCreateButton(">>", 156, 48, 31, 25)
$Button3 = GUICtrlCreateButton("<", 157, 81, 31, 25)
GUICtrlSetState(-1, $GUI_DISABLE)
$Button4 = GUICtrlCreateButton("<<", 157, 114, 32, 25)
$ListBox2 = GUICtrlCreateList("", 200, 8, 137, 201)
$Button5 = GUICtrlCreateButton("&OK", 104, 225, 75, 25)
$Button6 = GUICtrlCreateButton("&Cancel", 184, 225, 75, 25)
$Clear = GUICtrlCreateButton("&Clear", 264, 225, 75, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
GUICtrlSetData($ListBox1, "")
GUICtrlSetData($ListBox2, "")

$FileNameList = FileReadToArray($sFileName)

GUICtrlSetData($ListBox1, $sFileNameList)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
         Case $Button6
            Exit
         Case $Clear
            GUICtrlSetData($ListBox1, "")


    EndSwitch
WEnd

 

Link to comment
Share on other sites

I'm trying to make a form to select certain samples from a file and add it to another file.. Can't figure out why it wont work.. I tried it with and without the array, and the program just lists the file location instead of contents.. Also any chance someone has something like this already setup with each list attached to a file?

 

Thanks all :)

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <WindowsConstants.au3>
#include <FileConstants.au3>
#include <MsgBoxConstants.au3>
#include <WinAPIFiles.au3>
#include <Date.au3>
#include <File.au3>

Global $aDate, $aTime
$text = ClipGet()
$sFileName = "\\SERVER\Server H\Staff Dropbox\blah\" & @MON & @MDAY & @YEAR & ".que"

#Region ### START Koda GUI section ### Form=
$Form2 = GUICreate("Choices Dialog", 345, 252, -1, -1)
$ListBox1 = GUICtrlCreateList("", 8, 8, 137, 201)
GUICtrlSetData(-1, "Item1|Item2|Item3|Item4|Item5")
$Button1 = GUICtrlCreateButton(">", 156, 15, 30, 25)
$Button2 = GUICtrlCreateButton(">>", 156, 48, 31, 25)
$Button3 = GUICtrlCreateButton("<", 157, 81, 31, 25)
GUICtrlSetState(-1, $GUI_DISABLE)
$Button4 = GUICtrlCreateButton("<<", 157, 114, 32, 25)
$ListBox2 = GUICtrlCreateList("", 200, 8, 137, 201)
$Button5 = GUICtrlCreateButton("&OK", 104, 225, 75, 25)
$Button6 = GUICtrlCreateButton("&Cancel", 184, 225, 75, 25)
$Clear = GUICtrlCreateButton("&Clear", 264, 225, 75, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
GUICtrlSetData($ListBox1, "")
GUICtrlSetData($ListBox2, "")

$FileNameList = FileReadToArray($sFileName)

GUICtrlSetData($ListBox1, $sFileNameList)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
         Case $Button6
            Exit
         Case $Clear
            GUICtrlSetData($ListBox1, "")


    EndSwitch
WEnd

 

Link to comment
Share on other sites

You're not even looping through the array...

Then you changed the line to read the whole file, of course it's going all in one line.

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <WindowsConstants.au3>
#include <FileConstants.au3>
#include <MsgBoxConstants.au3>
#include <WinAPIFiles.au3>
#include <Date.au3>
#include <File.au3>

Global $aDate, $aTime, $i
$text = ClipGet()
$sFileName = FileOpen("C:\Users\careca\Desktop\1.txt") ;"\\SERVER\Server H\Staff Dropbox\blah\" & @MON & @MDAY & @YEAR & ".que"

#Region ### START Koda GUI section ### Form=
$Form2 = GUICreate("Choices Dialog", 345, 252, -1, -1)
$ListBox1 = GUICtrlCreateList("", 8, 8, 137, 201)
GUICtrlSetData(-1, "Item1");|Item2|Item3|Item4|Item5")
$Button1 = GUICtrlCreateButton(">", 156, 15, 30, 25)
$Button2 = GUICtrlCreateButton(">>", 156, 48, 31, 25)
$Button3 = GUICtrlCreateButton("<", 157, 81, 31, 25)
GUICtrlSetState(-1, $GUI_DISABLE)
$Button4 = GUICtrlCreateButton("<<", 157, 114, 32, 25)
$ListBox2 = GUICtrlCreateList("", 200, 8, 137, 201)
$Button5 = GUICtrlCreateButton("&OK", 104, 225, 75, 25)
$Button6 = GUICtrlCreateButton("&Cancel", 184, 225, 75, 25)
$Clear = GUICtrlCreateButton("&Clear", 264, 225, 75, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
GUICtrlSetData($ListBox1, "")
GUICtrlSetData($ListBox2, "")

Local $sFileNameList = FileReadToArray($sFileName)
For $i= 0 To UBound($sFileNameList)-1
GUICtrlSetData($ListBox1, $sFileNameList[$i])
Next

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
         Case $Button6
            Exit
         Case $Clear
            GUICtrlSetData($ListBox1, "")
    EndSwitch
WEnd

 

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

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...