Sign in to follow this  
Followers 0
JAFN

ListView questions

34 posts in this topic

We had traveled so far from the original topic that I thought it best to start a new thread.

So M23, I created a listview and successfully loaded in the array and set the column widths and headers.

Func DVDWindow()

    $DVDid = GUICreate("DVD List",600, 300, 2, 2)
    GUISetState()

    $NumberOfRecords = Load_Array()
    $ListViewHandle = GUICtrlCreateListView("Title|Price|Quantity|Genre", 2, 2, 450, 268)

    _GUICtrlListView_SetColumn($ListViewHandle, 0, "Title", 200,0)
    _GUICtrlListView_SetColumn($ListViewHandle, 1, "Price", 80,0)
    _GUICtrlListView_SetColumn($ListViewHandle, 2, "Quantity", 80,2)
    _GUICtrlListView_SetColumn($ListViewHandle, 3, "Genre", 80,0)

    _GUICtrlListView_AddArray($ListViewHandle, $Data)

;_GUICtrlListView_GetColumnOrder

EndFunc

For now just point me at the relevant commands

1. knowing a header has been clicked and which header

2. Telling which row has been selected.

That will keep me a while. Whitling away at other functions.

Thanks


[size="2"]The second mouse gets the cheese[/size]

Share this post


Link to post
Share on other sites



If you look at the example script in the help file for the function _GUICtrlListView_SortItems you will see in there a way of detecting a column header click. The row selected would be found by by using the function _GUICtrlListView_GetSelectedIndices which will tell you the index to the LV item selected.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

Thank you.

The second item was easy to understand and adapt.

The first makes my brain ache. But I will attack it again when I am refreshed in the morning.


[size="2"]The second mouse gets the cheese[/size]

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

There is another way of detecting a column click on a ListView. If you're using OnEvent mode you can do something like this

Global Const $ListView = GUICtrlCreateListView("Header1|Header2|Header3", 20, 45, 400, 450)
(GUICtrlSetOnEvent(-1, "ColumnClick")

Func ColumnClick()
    ConsoleWrite("You clicked on column # " & GUICtrlGetState($ListView))
EndFunc

This is just an example and, of course, would require more code to make it a working one. :unsure:

Message mode would work similarly:

Global Const $ListView = GUICtrlCreateListView("Header1|Header2|Header3", 20, 45, 400, 450)

While 1
    $msg = GUIGetMsg()
    Switch $msg
       Case $ListView
          ConsoleWrite("You clicked on column # " & GUICtrlGetState($ListView))
    EndSwitch
Wend
Edited by BrewManNH

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

Global Const $ListView = GUICtrlCreateListView("Header1|Header2|Header3", 20, 45, 400, 450)

While 1
    $msg = GUIGetMsg()
    Switch $msg
       Case $ListView
          ConsoleWrite("You clicked on column # " & GUICtrlGetState($ListView))
    EndSwitch
Wend

Thank you, that was most helpful.

I'm not sure I understand why GUICtrlGetState($ListView) returns the column number. I just accept that it does.

I am having these problems:

1. I can not figure out how to trigger the update of the listview on screen after sort.

2. the sort routine seems to only sort the first column. I have tried a lot of things some of which are still present in the sort code.

I include the whole code as I never fully sure what will be needed and am hopeful that you have the time to give me tips on improving my style.

DVDlister.garth is 4 items separated by '*'

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=shout.ico
#AutoIt3Wrapper_Outfile=iteration.exe
#AutoIt3Wrapper_Add_Constants=n
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

;
;
;  DVDLister
;
;  a more advanced program. A list that can be sorted different ways and printed
;
;

;
; Global variables section
;
Global $Name            = "DVDLister"
Global $NameVersion     = $Name & " 0.10"   ; Always placed here so I can easily chance the version number.
Global $DataFileName    = "Titles.garth"    ; Name of the file containing the informstion
Global $DVDid           = ""                ; Window GUI handle. Null if not loaded or file does not exist.
Global $ListViewHandle  = ""                ; The ListView handle. Needed by many functions.
Global $ArraySize       = 0                 ; The depth of the array
Global $Apply, $Refresh, $test, $Print      ; Button Handles
Global $Data
; Tray Traggers

;
;
; include section
;

#include <Array.au3>
#include <File.au3>
#include <GUIConstantsEx.au3>
#include <GuiListView.au3>


;
; Opts
;
Opt("TrayMenuMode", 3) ; Default tray menu items (Script Paused/Exit) will not be shown.
Opt("TrayAutoPause", 0) ; No Pause on Menu

;
; Tray Triggers
;

; GUI Triggers
;
Local $Print, $Sort, $Apply, $Exit

;
; Create Tray Menu
;
$beginitem = TrayCreateItem("Run")
TrayCreateItem("") ; seperation line
$aboutItem = TrayCreateItem("About")
TrayCreateItem("") ; seperation line
$exitItem = TrayCreateItem("Close")
TraySetState()

;Load_Array() ; duplicate effort but has the variable needed for the trigger below.


;
; Main Forever Loop
;
While 1

    ; Look for GUI events
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            EndWindow()

         Case $ListViewHandle
             _GUICtrlListView_BeginUpdate($ListViewHandle)
             _ArraySort($Data, 0, 0, 0, GUICtrlGetState($ListViewHandle))
;           GUICtrlSetState($ListViewHandle$ListViewHandle,0)
             _GUICtrlListView_EndUpdate($hListView)
            _ArrayDisplay($ListViewHandle)
            GUICtrlSetData($test, GUICtrlGetState($ListViewHandle))  ;testing
        Case $Print

        Case $Apply
            WriteArrayToFile()

        Case $Refresh()
            KeyTap()
            If MsgBox(256+48+1,"Warning","Refreshing will erase any changes made since the last 'Apply'") = 1 Then Load_Array()

        Case $Exit

        Case $test
             GUICtrlSetData($test, _GUICtrlListView_GetSelectedIndices($ListViewHandle)) ; testing

    EndSwitch

    ; Look for tray events
    Switch TrayGetMsg()
        Case $exitItem
            MyExit()
        Case $beginitem
            StartProgram()
        Case $aboutItem
            aboutMsg()
    EndSwitch

WEnd

;
; Tray Routines
;

Func MyExit()
    EndWindow()
    Exit

EndFunc   ;==>MyExit

Func aboutMsg()

    Local $message
    $message = $NameVersion & @CRLF & @CRLF
    $message = $message & "by Garth Bigelow"
    $message = $message & @CRLF & "With the infinite patience of the AutoIt Help Forums" & @CRLF
    $message = $message & @CRLF & "no rights reserved"
    MsgBox(64, "about:", $message)

EndFunc   ;==>aboutMsg

Func StartProgram()

    EndWindow()
    DVDWindow()

EndFunc   ;==>StartProgram

;
; GUI Routines
;    Functions Below Here are in Alphabeticaql order
;

Func ButtonCenter($Width, $ListWidth, $ButtonWidth)

    Return (($Width + $ListWidth - $ButtonWidth) / 2)

EndFunc   ;==>ButtonCenter

Func ButtonPosition($row, $TopBottomSep, $ButtonHeight)

    Return ($TopBottomSep*$row)+($ButtonHeight * ($row-1))

EndFunc

Func DVDWindow()
    $Left = IniRead($Name & ".ini", "Starting Value", "Window Left", 2)
    If $Left = -32000 Then $Left = 2 ; if window was minimized at exit
    $Top  = IniRead($Name & ".ini", "Starting Value", "Window Top", 2)
    If $Top = -32000 Then $Top = 2 ; if window was minimized at exit

    $Width = 560
    $Height = 300

    $SidesSep = 4
    $TopBottomSep = 4
    $ButtonWidth = 80
    $ButtonHeight = 50

    $DVDid = GUICreate("DVD List", $Width, $Height, $Left, $Top)
    GUISetState()

    $NumberOfRecords = Load_Array()
    $ListViewHandle = GUICtrlCreateListView("Title|Price|Test|Genre", $SidesSep, $TopBottomSep, 450, 268, BitOR($LVS_EDITLABELS, $LVS_SINGLESEL))

    _GUICtrlListView_SetColumn($ListViewHandle, 0, "Title", 200, 0)
    _GUICtrlListView_SetColumn($ListViewHandle, 1, "Price", 80, 1)
    _GUICtrlListView_SetColumn($ListViewHandle, 2, "Quantity", 80, 1)
    _GUICtrlListView_SetColumn($ListViewHandle, 3, "Genre", 80, 0)
    _GUICtrlListView_AddArray($ListViewHandle, $Data)

    $Apply   = GUICtrlCreateButton("Apply"  , ButtonCenter($Width, 450, $ButtonWidth), ButtonPosition(1, $TopBottomSep, $ButtonHeight), $ButtonWidth, $ButtonHeight)
    $Refresh = GUICtrlCreateButton("Refresh", ButtonCenter($Width, 450, $ButtonWidth), ButtonPosition(2, $TopBottomSep, $ButtonHeight), $ButtonWidth, $ButtonHeight)
    $test    = GUICtrlCreateButton("",        ButtonCenter($Width, 450, $ButtonWidth), ButtonPosition(3, $TopBottomSep, $ButtonHeight), $ButtonWidth, $ButtonHeight)
    $Print   = GUICtrlCreateButton("Print",   ButtonCenter($Width, 450, $ButtonWidth), ButtonPosition(5, $TopBottomSep, $ButtonHeight), $ButtonWidth, $ButtonHeight)

EndFunc   ;==>DVDWindow


; We don't want pushing tray item 'run' creating multiple windows
Func EndWindow()
    If $DVDid <> "" Then
        $WPos = WinGetPos($DVDid)
        $x = $WPos[0]
        $y = $WPos[1]
        If $x <> -32000 Then IniWrite($Name & ".ini", "Starting Value", "Window Left", $x) ; save the x,y locations of the window
        If $y <> -32000 Then IniWrite($Name & ".ini", "Starting Value", "Window Top" , $y) ; so next time it will be in the same place

        GUIDelete($DVDid)
        $DVDid = ""
    EndIf

EndFunc   ;==>EndWindow


Func KeyTap()

    Beep(100,10)
    Beep(200,5)

EndFunc


Func Load_Array()

    Local $FileLines, $TempRow, $Lines
    _FileReadToArray($DataFileName, $Lines)

    Global $Data[$Lines[0] + 1][4]

    For $a = 1 To $Lines[0]
        $TempRow = StringSplit($Lines[$a], "*")
        $Data[$a][0] = $TempRow[1]
        $Data[$a][1] = $TempRow[2]
        $Data[$a][2] = $TempRow[3]
        $Data[$a][3] = $TempRow[4]
    Next
    $ArraySize = $Lines[0]

EndFunc   ;==>Load_Array


Func WriteArrayToFile()
    Dim $TempArray[$ArraySize+1]

    For $a = 0 to $ArraySize
        $TempArray[$a] = $Data[$a][0] & "*" & $Data[$a][1] & "*" & $Data[$a][2] & "*" & $Data[$a][3]
    Next
    _FileWriteFromArray($DataFileName, $TempArray, 1, 0)
    KeyTap()

EndFunc

[size="2"]The second mouse gets the cheese[/size]

Share this post


Link to post
Share on other sites

JAFN,

Hello again! :D

I'm not sure I understand why GUICtrlGetState($ListView) returns the column number

Because the Devs coded it that way! :>

I can not figure out how to trigger the update of the listview on screen after sort

You need to reload the array like this:

Case $ListViewHandle
    ;_GUICtrlListView_BeginUpdate($ListViewHandle)                     ; No need for this with a native ListViews
    _ArraySort($Data, 0, 0, 0, GUICtrlGetState($ListViewHandle))       ; Sort the array
    _GUICtrlListView_DeleteAllItems(GUICtrlGetHandle($ListViewHandle)) ; Delete the current content
    _GUICtrlListView_AddArray($ListViewHandle, $Data)                  ; Add the sorted content
    GUICtrlSetData($test, GUICtrlGetState($ListViewHandle)) ;testing

Note that the _GUICtrlListView_DeleteAllItems function requires the handle and not the ControlID of the ListView. It should accept the ControlID, but it does not so you have to get the handle yourself. :unsure:

the sort routine seems to only sort the first column

Sorts all the columns for me when I test it. ;)

All clear? You know what to do if not! ;)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites

Hi M23,

I must actually be learning as each explaining is getting easier to understand. :unsure:

The middle two columns are sorting like strings, and I need them sorted like numbers.

I think this is one of those situations where I would learn just as much looking at the actual code.

Plus I'm hip deep in the printing routine.

Thanks

JAFN


[size="2"]The second mouse gets the cheese[/size]

Share this post


Link to post
Share on other sites

You may want to look at the _GUICtrlListView_RegisterSortCallBack and _GUICtrlListView_SortItems functions which, in my opinion, give a better sort result than the ArraySort routine will give you. It's not nearly as fast on a long list, but the results are sometimes sorted better and also allows you to indicate that numbers should be sorted as numbers and not as strings.

Although, you'd need to have a routine to rebuild your array after you've sorted the listview because it only sorts the visual listview contents, and not the array used to build it.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

JAFN,

The middle two columns are sorting like strings, and I need them sorted like numbers.

Then tell AutoIt they are numbers and not strings! :unsure:

For $a = 1 To $Lines[0]
    $TempRow = StringSplit($Lines[$a], "*")
    $Data[$a][0] = $TempRow[1]
    $Data[$a][1] = Number($TempRow[2]) ; <<<<<<<<<<<<<<
    $Data[$a][2] = Number($TempRow[3]) ; <<<<<<<<<<<<<<
    $Data[$a][3] = $TempRow[4]
Next

M23

Edit: Typnig!

Edited by Melba23

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites

JAFN,

Then tell AutoIt they are numbers and not strings! :>

For $a = 1 To $Lines[0]
    $TempRow = StringSplit($Lines[$a], "*")
    $Data[$a][0] = $TempRow[1]
    $Data[$a][1] = Number($TempRow[2]) ; <<<<<<<<<<<<<<
    $Data[$a][2] = Number($TempRow[3]) ; <<<<<<<<<<<<<<
    $Data[$a][3] = $TempRow[4]
Next

Worked like a charm. I love the ones that are easier to implement, easy to understand, and teach me a useful function. ;):unsure:

I was about to ask a printer question but in framing the question the answer became obvious.

But there is one looming on the horizon:

I set the listview so that the items could be edited. But once you leave the cell the item returns to its original value. Why?


[size="2"]The second mouse gets the cheese[/size]

Share this post


Link to post
Share on other sites

JAFN,

Editing ListViews is not the easiest thing in the world. :>

Here is a script with editable ListViews which I wrote a while ago - it should keep you busy for the next few days trying to understand it! ;)

Seriously, the problem with sorting and editing ListViews is keeping track of what is going on with the data. Personally I have found that keeping the data in an array and using that to fill/refill the ListView is the best way to go. That way you do not have to worry about messing up the item indices when you sort, or adjust the data in any other way.

If you want a simple way to operate a ListView, you might want to look at the GUIListViewEx UDF in my sig. Very simple commands to sort, move and add/delete items to ListViews. :unsure:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites

Completely unrelated question. My third program has a simple stay on top window. Sometimes I have three instances of it running, Is there anyway of not having it should up on the task bar? Or at least only show up once? I have seen other programs do this.


[size="2"]The second mouse gets the cheese[/size]

Share this post


Link to post
Share on other sites

JAFN,

You can remove the button from the taskbar by using the "parent" parameter when you create your GUI. If you do not have a parent, then you can use the ever-present, but hidden, AutoIt window:

#include <GUIConstantsEx.au3>

; Create parent
$hGUI = GUICreate("Parent", 500, 500)
GUISetState()

; Use parent handle when creating child
$hGUI_No_TaskBar_1 = GUICreate("Child", 200, 200, 100, 100, Default, Default, $hGUI)
GUISetState()

; Or use the AutoIt window
$hGUI_No_TaskBar_2 = GUICreate("AutoIt Child", 200, 200, 200, 200, Default, Default, WinGetHandle(AutoItWinGetTitle()))
GUISetState()

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

The icon in the systray/notification area will always be present unless you use #NoTrayIcon or Opt("TrayIconHide").

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites

Too cool.

Used

$hGUI_No_TaskBar_2 = GUICreate("AutoIt Child", 200, 200, 200, 200, Default, Default, WinGetHandle(AutoItWinGetTitle()))
GUISetState()

And it slid in like it had always been there.

Now to work on the edit thing.

Thanks.


[size="2"]The second mouse gets the cheese[/size]

Share this post


Link to post
Share on other sites

#15 ·  Posted (edited)

I can't believe the progress being made today.

I'm holding on to more information.

Edited by JAFN

[size="2"]The second mouse gets the cheese[/size]

Share this post


Link to post
Share on other sites

Morning M23,

I made the mistake of coding way into the night.

During which I completely fouled the code.

3 hours into the morning and I haven't come close to fixing 3 of the 4 problems.

Problems:

1. if you press Refresh before making any column sorting changes it errors out with a bizarre error message many lines passed the end of the code (why do they always make error massages so that you can't copy them?) Compiled the error message is total gibberish.

2. Sometimes when you leave the program you get a 'using a non-array variable with array data' crash and burn at line 212.

3. Print function flickers for second and is gone.

I thought for sure I could get this.

Before I kludged that one the actual printing part was not working. Pointers on that one would be helpful.

Can you unscramble this one so I can continue?

As before I will change .garth to .txt for the upload

DvdLister.au3

Titles.txt

tongue-clap.wav


[size="2"]The second mouse gets the cheese[/size]

Share this post


Link to post
Share on other sites

#17 ·  Posted (edited)

1. if you press Refresh before making any column sorting changes it errors out with a bizarre error message many lines passed the end of the code (why do they always make error massages so that you can't copy them?) Compiled the error message is total gibberish.

If it's a normal msgbox-window-thingy you can press ctrl+c to copy its text.

Edit:'

Edited by AdmiralAlkex

Share this post


Link to post
Share on other sites

If it's a normal msgbox-window-thingy you can press ctrl+c to copy its text.

Edit:'

No such luck. It is AutoIt Error Box. Much like Windows Error messages, you can't even select the text.

Thanks though.


[size="2"]The second mouse gets the cheese[/size]

Share this post


Link to post
Share on other sites

If you don't compile the script does it still give you the same error messages? If so, run it and find where the errors are in the uncompiled script before you even think of compiling it. You'll be chasing your tail for weeks otherwise.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

Problems:

3. Print function flickers for second and is gone.

I thought for sure I could get this.

And a little while later I did solve number 3.

Rookie mistake. Always check your assumptions.

The first two remain a mystery.


[size="2"]The second mouse gets the cheese[/size]

Share this post


Link to post
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
Sign in to follow this  
Followers 0