Jump to content

Recommended Posts

  • Moderators
Posted

jimmy123j,

Have you read this section of the guide which is included in the UDF download:

Quote

Closure and Reloading:

 If you delete the ListView, then it is recommended to use _GUIListViewEx_Close to free the memory used by the UDF.

 If you wish to reload the ListView with new data, you will need to clear the current content using _GUICtrlListView_DeleteAllItems, close it within the UDF using _GUIListViewEx_Close, reload the ListView with the new data and then reinitialise it using _GUIListViewEx_Init. Otherwise the UDF will become confused about the current content and errors will certainly occur.

It looks to me as if you are deleting the original data, but then NOT closing the existing instance of the ListView in the UDF before reloading it with data (and possibly reinitialising - that is not clear). In this case the UDF still believes that the ListView contains data and so will get very confused as the actual content - which is indicated by the error you get showing that the UDF internal map no longer matches the actual content.

So I recommend something along these lines:

; Clear the ListView
_GUICtrlListView_DeleteAllItems($TableList)
; Close it within the UDF
_GUIListViewEx_Close(TableIndex)
; Add new data
_GUICtrlListView_AddArray($TableList, $TableArray)
; Reinitialise the ListView with the new data
$TableIndex = _GUIListViewEx_Init($TableList, $TableArray, 0, Default, False, 32 + 512)

Does that solve the problem?

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

 

Posted
5 hours ago, Melba23 said:

jimmy123j,

Have you read this section of the guide which is included in the UDF download:

It looks to me as if you are deleting the original data, but then NOT closing the existing instance of the ListView in the UDF before reloading it with data (and possibly reinitialising - that is not clear). In this case the UDF still believes that the ListView contains data and so will get very confused as the actual content - which is indicated by the error you get showing that the UDF internal map no longer matches the actual content.

So I recommend something along these lines:

; Clear the ListView
_GUICtrlListView_DeleteAllItems($TableList)
; Close it within the UDF
_GUIListViewEx_Close(TableIndex)
; Add new data
_GUICtrlListView_AddArray($TableList, $TableArray)
; Reinitialise the ListView with the new data
$TableIndex = _GUIListViewEx_Init($TableList, $TableArray, 0, Default, False, 32 + 512)

Does that solve the problem?

M23

Yes, I've been try to use the GUIListViewEx_Close($TableIndex) at same position, before I ask the question ( not work to me)

But I just try move over to _GUICtrlListView_DeleteAllItems($TableList), then it's work

_GUIListViewEx_Close($TableIndex)

_GUICtrlListView_DeleteAllItems($TableList)

_GUICtrlListView_AddArray($TableList, $TableArray)

$TableIndex = _GUIListViewEx_Init($TableList, $TableArray, 0, Default, False, 32 + 512)

really really thank you M23, and forgive my foolish

Thanks again !!!

  • 2 weeks later...
  • 1 month later...
Posted

Hi M23, hope you're well.

I've added the functions from your UDF to my Calltips, and when using them, it highlighted something almost confusing: I've always ignored the second param for _GUIListViewEx_ReadToArray as I pretty much always want a count in [0]. But after comparing the results from Header Mode and Direct Mode parsing when adding Calltips, it seems that the param is named $iStart in the code for the function. If a user was to use Direct Mode when adding Calltips, then the name of the param would imply that it's "which row to start from" rather than "hold count in [0]".
A niggly, non-important thing that would be solved if a user was to take a few seconds to look at the function header; just thought I'd highlight it as you're usually nothing but consistent.

  • 2 months later...
Posted

Hello, it is possible to attach a personalized function when double click a specified cell? I've tried to set the edit flag to 9 but seems not work. I always get the "9" event when i perform a single click.

I want to do a doSomething() when a double click occours on columns 0,1,2,3,4 only.

Thank you in advance!

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GUIListViewEx.au3>
Global $iGreen = "0x00FF00", $iRed = "0xFF0000"
Global $sRet

; Create GUI
$hGUI = GUICreate("My GUI", 700, 230, -1, -1, BitOR($WS_SIZEBOX, $WS_SYSMENU))

; Create ListView For represent a db table with 6 column
$idListview = GUICtrlCreateListView("C0|C1|C2|C3|C4|C5", 5, 5, 610, 180, BitOR($LVS_REPORT, $LVS_SHOWSELALWAYS, $WS_BORDER))
_GUICtrlListView_SetExtendedListViewStyle($idListview, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_HEADERDRAGDROP))

Global $dataPoolArray = retrieveData()      ; THE DATAPOOL SIZE IS UNKNOWN A THIS POINT, IT COMES FROM DATABASE
_GUICtrlListView_AddArray($idListview, $dataPoolArray)

; Initiate ListView = sort on column click - editable headers - header colours - user colours
$iLVIndex_1 = _GUIListViewEx_Init($idListview, $dataPoolArray, 0, 0, True, 1 + 8 + 32)     ; + 16

; ****  IF the last column of the row is '1' the background color must be $iGreen, else must be $iRed  ****
Local $dataPoolRowNum = UBound($dataPoolArray, $UBOUND_ROWS)     ; Total number of rows. In this example it will be 10.
Local $dataPoolColNum = UBound($dataPoolArray, $UBOUND_COLUMNS)     ; Total number of columns. In this example it will be 20.

; Create colour array - 0-based to fit ListView content
Global $aLVCol_1[$dataPoolRowNum][$dataPoolColNum]
For $iRow = 0 To $dataPoolRowNum - 1
    If $dataPoolArray[$iRow][5] = 1 Then ; Check the required column and fill colour array accordingly
        For $iCol = 0 To $dataPoolColNum - 1
            $aLVCol_1[$iRow][$iCol] = ";" & $iGreen
        Next
    Else
        For $iCol = 0 To $dataPoolColNum - 1
            $aLVCol_1[$iRow][$iCol] = ";" & $iRed
        Next
    EndIf
Next

; Load colour array into ListView
_GUIListViewEx_LoadColour($iLVIndex_1, $aLVCol_1)

Local $j
    For $j = 0 To 4
      _GUIListViewEx_SetEditStatus($iLVIndex_1, $j, 9, "doSomething()" )  ; <- PErsonalized function if double click this items
    Next
     _GUIListViewEx_SetEditStatus($iLVIndex_1, 5, 2,"1|0",1+2)

;~  If colours used then this function must be run BEFORE GUISetState
_GUIListViewEx_MsgRegister()


GUISetState()

While 1
    $iMsg = GUIGetMsg()
    Switch $iMsg
        Case $GUI_EVENT_CLOSE
            ConsoleWrite("EXIT signal" & @CRLF)
            Exit
    EndSwitch
    $vRet = _GUIListViewEx_EventMonitor()
            If @error Then
                ConsoleWrite("Event error: " & @error)
            EndIf
            Switch @extended
                Case 0
                    ; No event detected
                Case 1 ;DOUBLE CLICK
                    If $vRet = "" Then
                        ConsoleWrite("Edit aborted" & @CRLF)
                    Else
                        ;_ArrayDisplay($vRet)
                        Local $clickedRow = $vRet[1][0]
                        Local $clickedColumn = $vRet[1][1]
                        Local $oldValue = $vRet[1][2]
                        Local $newValue = $vRet[1][3]
                        ConsoleWrite("YOU DOUBLE CLICKED ROW " & $clickedRow & " ON COLUMN " & $clickedColumn & " old value " & $oldValue & "new value " & $newValue &@CRLF)
                        PrintEntireRowValues($idListview, $clickedRow)
                        ConsoleWrite(@CRLF)
                        Local $c0 =_GUICtrlListView_GetItemText($idListview, $vRet[1][0])
                        ;updateC0onDB($newValue, $c0)
                        If $newValue = '1' Then
                           For $j = 0 To 5
                              _GUIListViewEx_SetColour($iLVIndex_1, ";" & $iGreen, $vRet[1][0], $j)
                           Next
                        Else
                           For $j = 0 To 5
                           _GUIListViewEx_SetColour($iLVIndex_1, ";" & $iRed, $vRet[1][0], $j)
                           Next
                        EndIf
;~                      ConsoleWrite($oldValue & " " & $newValue & @CRLF)
                    EndIf
                Case 9 ; SINGLE CLICK
                    Local $clickedRow = $vRet[1]
                    Local $clickedColumn = $vRet[2]
                    ConsoleWrite("SINGLECLICK ON ROW: " & $clickedRow & " ,COLUMN: " & $clickedColumn)
                    PrintCellValue($idListview, $clickedRow,$clickedColumn)
                    PrintEntireRowValues($idListview, $clickedRow)
                    ConsoleWrite(@CRLF)
            EndSwitch
WEnd

Func PrintCellValue($aListView, $aRowIndex, $aRowColum)
    ConsoleWrite(" CELLVALUE: " & _GUICtrlListView_GetItemText($aListView, $aRowIndex, $aRowColum) )
EndFunc

Func PrintEntireRowValues($aListView, $aRowIndex)
    Local $c0 =_GUICtrlListView_GetItemText($aListView, $aRowIndex)
    Local $c1 =_GUICtrlListView_GetItemText($aListView, $aRowIndex,1)
    Local $c2 =_GUICtrlListView_GetItemText($aListView, $aRowIndex,2)
    Local $c3 =_GUICtrlListView_GetItemText($aListView, $aRowIndex,3)
    Local $c4 =_GUICtrlListView_GetItemText($aListView, $aRowIndex,4)
    Local $c5 =_GUICtrlListView_GetItemText($aListView, $aRowIndex,5)
    ConsoleWrite(" ROW VALUE: " & $c0 & " " & $c1 & " " & $c2 & " " & $c3 & " " & $c4 & " " & $c5)
EndFunc

Func sayHello()
   ConsoleWrite("HELLO")
EndFunc

Func retrieveData()
    Local $array[2][6] = [['v00', 'v01', 'v02', 'v03', 'v04', '1'], ['v10', 'v11', 'v12', 'v13', 'v14', '0']]
    Return $array
EndFunc   ;==>retrieveData

 

Posted

Please ignore the  request i made before because I've solved the problem after reading all the pages in this thread. THe solution is pretty simple:

 

 

; These variables stores the last clicked cell, will be renewed when a '9' event is detected
    Local $clickedRow
    Local $clickedColumn
    $vRet = _GUIListViewEx_EventMonitor()
            If @error Then
                If @error = 3 Then
                    ConsoleWrite("Non-editable column" & getCellValue($idListview, $clickedRow,$clickedColumn) & @CRLF)
                    ConsoleWrite("DOUBLECLICK ON ROW: " & $clickedRow & " ,COLUMN: " & $clickedColumn)
                Else
                    ConsoleWrite("Event error: " & @error)
                EndIf
            EndIf
            Switch @extended
                Case 0
                    ; No event detected
                Case 1 ;DOUBLE CLICK
                    If $vRet = "" Then
                        ConsoleWrite("Edit aborted" & @CRLF)
                    Else
                        ;_ArrayDisplay($vRet)
                        Local $clickedRow = $vRet[1][0]
                        Local $clickedColumn = $vRet[1][1]
                        Local $oldValue = $vRet[1][2]
                        Local $newValue = $vRet[1][3]
                        ConsoleWrite("YOU EDITED ROW " & $clickedRow & " ON COLUMN " & $clickedColumn & " old value " & $oldValue & "new value " & $newValue &@CRLF)
                        PrintEntireRowValues($idListview, $clickedRow)
                        ConsoleWrite(@CRLF)
                        Local $c0 =_GUICtrlListView_GetItemText($idListview, $vRet[1][0])
                        ;updateC0onDB($newValue, $c0)
                        If $newValue = '1' Then
                           For $j = 0 To 5
                              _GUIListViewEx_SetColour($iLVIndex_1, ";" & $iGreen, $vRet[1][0], $j)
                           Next
                        Else
                           For $j = 0 To 5
                           _GUIListViewEx_SetColour($iLVIndex_1, ";" & $iRed, $vRet[1][0], $j)
                           Next
                        EndIf
;~                      ConsoleWrite($oldValue & " " & $newValue & @CRLF)
                    EndIf
                Case 9 ; SINGLE CLICK
                    $clickedRow = $vRet[1]
                    $clickedColumn = $vRet[2]
                    ConsoleWrite("SINGLECLICK ON ROW: " & $clickedRow & " ,COLUMN: " & $clickedColumn)
                    PrintCellValue($idListview, $clickedRow,$clickedColumn)
                    PrintEntireRowValues($idListview, $clickedRow)
                    ConsoleWrite(@CRLF)
            EndSwitch

 

  • 2 months later...
  • 2 weeks later...
  • Moderators
Posted (edited)

Hi,

It is with some embarrassment that I realise I never posted a modified UDF in response to this bug report - however, better late than never!

Could @pixelsearch (or someone else if they have the time) please check this new version and confirm that it works for them - it obviously does for me!

Thanks in advance,

M23

 

Edited by Melba23
Deleted Beta code

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
On 3/8/2020 at 5:15 PM, Melba23 said:

Could @pixelsearch (or someone else if they have the time) please check this new version...

Hi Melba23 :)
Sorry for not answering earlier as I'm not on the site as often as I used to be.
Here are the results of the tests I just did :

* The 1st bug report you mentioned (which concerned columns) has been solved with your fix from last Sunday (March 8th) .
Now when we run example 6, tick "Col" radio button, then insert/delete columns as much as we want, no error appears after all columns have beed deleted : problem solved.

* The 2nd bug report (which concerned rows) is still there.
Run example 6, click 7 times on Del => error at 7th click (i.e after the 6 rows have been correctly deleted, a 7th click when there are no more visible rows generate the following error)

1853248876_ErrorafterDel7times.thumb.png.7b4b98eea80da014a2a59d5ad78914a2.png

Tests have been done in a folder named "Nouveau dossier" containing 2 files only : GLVEx_Example_6.au3 and your last GUIListViewEx_Test.au3 (renamed GUIListViewEx.au3)

Good luck & fingers crossed :bye:

Posted (edited)

@Melba23 : I found a line in the UDF that could explain why there's a bug when we delete all rows :

Func _GUIListViewEx_DeleteSpec($iLV_Index, $vRange = "")
    ...
    If UBound($hGLVEx_SrcHandle) = 1 Then Return SetError(3, 0, "")
    ...
EndFunc   ;==>_GUIListViewEx_DeleteSpec

As $hGLVEx_SrcHandle is a Handle and not an Array, then the test will always be false. If we replace that line with :

If UBound($aGLVEx_Data[$iLV_Index][2]) = 1 Then Return SetError(3, 0, "")
    _ArrayDisplay($aGLVEx_Data[$iLV_Index][2], "Del button has been pressed") ; debug

Then deleting all visible 6 rows and pressing again the Del button won't generate any error... but problems won't all be solved. Please look at this :

486235276_Delbuttonpressedonce.thumb.png.3ad6d4df6afebc8c19e3d5a4fdc508e6.png

Precedent image is correct, Del button has been pressed once and Row 0 (col 0) is correct, indicating there are 6 visible rows in the listview (Deletion process will follow _ArrayDisplay)

645973988_Delbuttonpressedtwice.thumb.png.fa32f0b2fe821c1b27750e00c07bcb3f.png

Precedent image doesn't seem correct, Del button has been pressed a 2nd time and Row 0 (col 0) indicates "-1" instead of 5, which will cause fatal problems much later when we will Insert/Delete rows/columns (tested)

In case anyone wants to know what contains $aGLVEx_Data, then just add an _ArrayDisplay line here :

Func _GUIListViewEx_Init(...)
    ...
    _ArrayDisplay($aGLVEx_Data, $aGLVEx_Data[0][0] & " listview(s) initiated")

    ; Return ListView index
    Return $iLV_Index
EndFunc   ;==>_GUIListViewEx_Init

1175680908_2listviewsinitiated.png.906128224cbff7fc33454b524a90dea1.png

Hope this helps :bye:

Edited by pixelsearch
  • Moderators
Posted (edited)

pixelsearch,

You pinpointed the right place - brain fade on my part for checking the wrong variable!

That section of the function should read as follows:

; Load active ListView details
    $hGLVEx_SrcHandle = $aGLVEx_Data[$iLV_Index][0]
    $cGLVEx_SrcID = $aGLVEx_Data[$iLV_Index][1]
    Local $fCheckBox = $aGLVEx_Data[$iLV_Index][6]

    ; Copy array for manipulation
    $aGLVEx_SrcArray = $aGLVEx_Data[$iLV_Index][2]
    If UBound($aGLVEx_SrcArray) = 1 Then ; Check for no rows to delete
        Return SetError(3, 0, "")
    EndIf

Please try this version and see if I have managed to crack it this time.

M23

 

Edited by Melba23
Deleted Beta code

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
19 hours ago, pixelsearch said:

Run example 6, click 7 times on Del => error at 7th click (i.e after the 6 rows have been correctly deleted, a 7th click when there are no more visible rows generate the following error)

 

42 minutes ago, Melba23 said:

Please try this version and see if I have managed to crack it this time.

The error described by @pixelsearch does no longer arise. So your fix seems to work :).

Musashi-C64.png

"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

Posted (edited)

@Musashi : it's been a long time, thanks for the test !

@Melba23 : yes that issue is fixed but unfortunately we're not done.
As I wrote in the second part of my comment (July 28, 2019) another issue is still pending :

On 7/28/2019 at 5:07 AM, pixelsearch said:

* Run the script, click on Col button radio, click on Del 4 times to delete the 4 visible columns, then :
* Click on Row button radio, click one time on Ins (to insert a new row) and :

1218373535_Anotherrowissue.thumb.png.f4ccaacdf27bac73b4f80d3cfc64aae6.png
 

Test done with the very last UDF you uploaded 3 hours ago.
I'll try to investigate in case the problem isn't too hard to solve, fingers crossed.

Edit (1h after) :

If $aGLVEx_SrcArray[0][0] = 0 Then ...

The preceding line generates an issue when the Array got no more columns in it.
Maybe testing on [0][0] shouldn't be done when there are no more columns in the Array ?

$iNb_col = Ubound($aGLVEx_SrcArray, 2)
If @error Then Msgbox(0, "", "@error = " & @error)

Precedent test will define $iNb_col to 0, with an error = 2 ("Dimension is invalid") in case you test Ubound after all columns have been deleted.

My bad if precedent remarks are wrong.

Edited by pixelsearch
A quick thought on [0][0]
  • Moderators
Posted

pixelsearch,

I see the problem. It happens because deleting all the columns removes the shadow array element holding the number of rows - not something I ever thought a user would need to do! It looks as if I need to use a separate variable to hold that value - I will try and work on it over the next few days.

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)

Hi all,

Try and break this new Beta!

M23

 

 

Edited by Melba23
Removed Beta code

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 (edited)

Hi Melba23,
I just tried the last beta you uploaded 14 hours ago and got an error :

1111698739_aftermanyclicks.thumb.png.1f2697351fbff270f2487473f123a729.png

As I clicked several times the 4 buttons Ins / Del / Insert Spec / Delete Spec (plus both radio buttons Row / Col) then I can't remember exactly how many times I clicked here & there.
I'll try again, more carefully, to count how many clicks generate the error and which buttons are involved.

Edited by pixelsearch
typo
  • Moderators
Posted (edited)

pixelsearch,

Why are you compiling the script each time? Please just run it from SciTE and then post the error line from the console - then we do not need all these large screenshots.

M23

P.S. It also means you get a sensible line number to help me locate the line at which it failed.

Edited by Melba23

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
5 hours ago, Melba23 said:

pixelsearch,
Why are you compiling the script each time?
...
P.S. It also means you get a sensible line number to help me locate the line at which it failed.

Who ever said I was compiling it ? :blink:
I never compile anything so the error line number indicated in the picture is 100% accurate. Also having a screenshot is interesting, it allows to see how many rows/columns were visible when the error occured (amongst other things)

To run the script, I Just double-click the .au3 file, from Windows Explorer, which launches the uncompiled script outside Scite. By the way...

On 3/10/2020 at 2:44 PM, pixelsearch said:

Tests have been done in a folder named "Nouveau dossier" containing 2 files only : GLVEx_Example_6.au3 and your last GUIListViewEx_Test.au3 (renamed GUIListViewEx.au3)

Ok, this being explained, let's run the script from Scite (your wish) and do this simple thing :
1) One click over the Del button (it will delete 1 row, 5 still showing)
2) One click over any listview header => fatal error :

>"C:\Program Files\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Documents and Settings\Administrateur\Mes documents\Nouveau dossier\GLVEx_Example_6.au3"    
"C:\Documents and Settings\Administrateur\Mes documents\Nouveau dossier\GUIListViewEx.au3" (5634) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.:
Local $aCheckedItems[$iItemCount + 1] = [0]
Local $aCheckedItems[$iItemCount + 1] = [^ ERROR
>Exit code: 1    Time: 7.76

And this will be my last error picture below (your wish) to show everybody that the accurate error line number 5634 is correctly indicated from Scite and outside Scite (if we run again the .au3 script outside Scite) :

2068682185_SameerroroutsideorinsideScite.png.c2049e5fe67ae7458cf78784edc499cb.png

1125620426_Line5634.png.61ca295f174bf06394249006e74fd85e.png

  • Moderators
Posted (edited)

pixelsearch,

Fixed that one - try again!

M23

 

 

Edited by Melba23
Beta code removed

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

Hi Melba23,
Right, that line you added in the new beta solved the last issue :

Func __GUIListViewEx_Array_Delete(ByRef $avArray, $iIndex, $bDelCount = False)
    ...
    ; Do not overwrite count row
    If $iIndex = 0 Then $iIndex = 1

Only now, both pictures posted here appear correctly :
* 1st picture still shows "6" in row 0, col 0 (correct)
* 2nd picture now shows "5" in row 0, col 0 (correct) and not "-1" anymore

Bravo for the quick fix :thumbsup:

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
  • Recently Browsing   0 members

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