
Massi
Members-
Posts
8 -
Joined
-
Last visited
Massi's Achievements

Seeker (1/7)
1
Reputation
-
mLipok reacted to a post in a topic: Problem in function _ArrayUnique, crash
-
Problem in function _ArrayUnique, crash
Massi replied to Massi's topic in AutoIt General Help and Support
LOL don't hate this function, it's useful Don't worry make a mistake is the first step before make all working in the right way Thank you for support, it seems to work well now -
Hi, I have update to the most recent Autoit version. I have a little problem with _ArrayUnique function. If I have one array with two rows. _ArrayUnique crashes. I haven't any problem if there are more than two rows. I know that seems useless use this function with two rows, but these rows are the result of a search (generally I have more than two rows). "C:\Program Files (x86)\AutoIt3\Include\Array.au3" (2290) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.: Local $vFirstElem = ( ($iDims = 1) ? ($aArray[$iBase]) : ($aArray[$iColumn][$iBase]) ) Local $vFirstElem = ( ($iDims = 1) ? ($aArray[$iBase]) : (^ ERROR #include <Array.au3> Dim $Test1[3][6]=[["11","12","13","14","15","16"],["21","22","23","24","25","26"],["21","22","23","24","25","26"]] Dim $Test[2][6]=[["11","12","13","14","15","16"],["21","22","23","24","25","26"]] Dim $result=0 _ArrayDisplay($Test1) _ArrayDisplay(_ArrayUnique($Test1, 2)) _ArrayDisplay($Test) _ArrayDisplay(_ArrayUnique($Test, 2)) I put a workaround that I don't use _ArrayUnique function if there are only two results
-
Thank you Melba, now is all clear and working. If I put _GUICtrlListView_BeginUpdate after _GUICtrlListView_DeleteAllItems all work fine(there is no need of _GUICtrlListView_EndUpdate because the function already do this). Is exactly as you say (I try other scripts with _GUICtrlListView_BeginUpdate but I cannot replicate the problem because it was in another function ) Thank you very much for helping me
-
Melba, N1 I also try to put other _GUICtrlListView_BeginUpdate($hLV) and _GUICtrlListView_EndUpdate($hLV) in other points of the script for debugging and was not working, I see that the GuiListView.au3 is changed in the two versions but was very complicated to understand the differences. I think that the right way to work was the previous one or the function doesn't do "Prevents updating of the control until the _GUICtrlListView_EndUpdate() function is called". Make a lot of operations in listview should not modify the behaviour of the function.This behaviour have to be documented or in my opinion this is a little bug. In everycase this workaround work for me, thank you Melba
-
Sorry Melba, yes I see the function _GUICtrlListView_EndUpdate is fast but here listview begins updating before _GUICtrlListView_EndUpdate function is called. The first time you push TEST all works well. Please, try to push the test button more than once. If you see autofit columns start before _GUICtrlListView_EndUpdate(maibe is diffcult to see because all the word are equal "AAAA"). If you put _GUICtrlListView_AddColumn($hLV, "", 50) instead of 100 this result is more clear As I said in version 3.3.8.1 this doesn't happen but maybe is a script problem or a PC problem, in this case please accept my apologies
-
Hi all. I have a problem with Listview function. I recently update from Autoit version 3.3.8.1 to new one. After the update the functions _GUICtrlListView_BeginUpdate - _GUICtrlListView_EndUpdate doesn't work in the right way. Listview doesn't wait _GUICtrlListView_EndUpdate to start updating so all the process is very slow. I try to search what's wrong but I can't manage to make it work. This is a piece of the code working, just to re-create the problem #include-once #include <EditConstants.au3> #include <Array.au3> #include <GuiListView.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <FontConstants.au3> Local $nMeta=550,$nAltezzaRiga=30,$nHMeta=300,$nLarghezzaLabel=70 ;PRIMA ERA 270 $Hmeta=$AltezzaRiga*9 Local $LarghezzaFinestra=1100,$AltezzaFinestra=700,$Font="Arial" $hFinestra = GUICreate("TEST", $LarghezzaFinestra,$AltezzaFinestra) ; Crea una finestra larga 800 e alta 600 GUISetState(@SW_SHOW,$hFinestra) GUISetFont(10, 400, 0, "Comic Sans MS") $lv = GUICtrlCreateListView("", 2, 2, $LarghezzaFinestra-4, 356);,$LVS_SORTDESCENDING) $hLV = GUICtrlGetHandle($lv) _GUICtrlListView_SetExtendedListViewStyle($hLV, BitOR($LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT, $LVS_EX_SUBITEMIMAGES)) _GUICtrlListView_AddColumn($hLV, "", 1500) $BottoneRicerca = GUICtrlCreateButton("TEST", 250 ,380+ $nAltezzaRiga*5-3, 55, 30);30+$nLarghezzaLabel+220 + 400 local $aRisultatoTotale[100][50] For $x=0 To 99 for $y=0 To 49 $aRisultatoTotale[$x][$y]="AAAAAAAAAAAA" Next Next Local $aNomeTabellaDatabase[3]=["2","TEST1","TEST2"] Local $aNumeroColonneTabella[3]=["2","10","15"] Local $aNumeroRigheTabella[3]=["2","3","6"] While 1 $msg=GUIGetMsg() Select Case $msg=$BottoneRicerca GuiRicerca($hFinestra,$lv,$hLV,$aRisultatoTotale, $aNomeTabellaDatabase, $aNumeroColonneTabella, $aNumeroRigheTabella) Case $msg=$GUI_EVENT_CLOSE ExitLoop EndSelect WEnd GUIDelete($hFinestra) Func GuiRicerca($hFinestra,$lv,$hLV,$aRisultatoTotale, ByRef $aNomeTabellaDatabase, ByRef $aNumeroColonneTabella, ByRef $aNumeroRigheTabella) Local $LarghezzaFinestra=1100,$AltezzaFinestra=700,$Font="Arial" Local $hDC = _WinAPI_GetDC($hLV) Local $hFont = _SendMessage($hLV, $WM_GETFONT) Local $hObject = _WinAPI_SelectObject($hDC, $hFont) Local $lvLOGFONT = DllStructCreate($tagLOGFONT) Local $aRet = DllCall('gdi32.dll', 'int', 'GetObjectW', 'ptr', $hFont, 'int', DllStructGetSize($lvLOGFONT), 'ptr', DllStructGetPtr($lvLOGFONT)) _WinAPI_SelectObject($hDC, $hObject) _WinAPI_ReleaseDC($hLV, $hDC) DllStructSetData( $lvLOGFONT, "Height",15) $hLVfont = _WinAPI_CreateFontIndirect( $lvLOGFONT ) DllStructSetData( $lvLOGFONT, "Weight", 700 ) $hLVfontBold = _WinAPI_CreateFontIndirect( $lvLOGFONT ) DllStructSetData( $lvLOGFONT, "Italic", True ) ;0 for normal, 1 for italic $hLVfontBoldItalic = _WinAPI_CreateFontIndirect( $lvLOGFONT ) DllStructSetData( $lvLOGFONT, "Weight", 400 ) ;700 for bold, 400 for regular $hLVfontItalic = _WinAPI_CreateFontIndirect( $lvLOGFONT ) _GUICtrlListView_BeginUpdate($hLV) ; *************************************BEGIN of LISTVIEW UPDATE While _GUICtrlListView_DeleteColumn($hLV, 1)=True ;Delete all the columns WEnd _GUICtrlListView_DeleteAllItems($hLV) ; Delete all item from ListView For $x=1 to UBound($aRisultatoTotale,2)-1 ; Add columns (in this example the number of columns doesn't change) _GUICtrlListView_AddColumn($hLV, "", 100) Next $stringa="" For $x=0 To UBound($aRisultatoTotale,1)-1 _GUICtrlListView_AddItem( $hLV,$aRisultatoTotale[$x][0]) For $y=1 to UBound($aRisultatoTotale,2)-1 _GUICtrlListView_AddSubItem( $hLV,$x,$aRisultatoTotale[$x][$y],$y) Next Next For $x=0 to UBound($aRisultatoTotale,2)-1 _GUICtrlListView_SetColumnWidth($lv, $x, $LVSCW_AUTOSIZE) ; Autofit the columns Next _GUICtrlListView_EndUpdate($hLV) ; *************************************END of LISTVIEW UPDATE EndFunc
-
Thank you Azjio, yours solution works well with [ in the file name. RFLTA now seems to works well. Thank you also to Melba23 this udf could be very useful in more than one situation.
-
Hi all, my first post. Sorry for my english. I like this UDF and I will try also the others projects suggested in this topic for sure. Maybe I've found a bug in this UDF or I misunderstand how to use in the proper way _RecFileListToArray My purpose is to find the folder where a file is placed (I know the file name). The function works well but I have an error if the name of file to search contains bracket [ Please try to create a file C:\Test\Nuovo Documento di [testo.txt and test the code below. Try again modifing the code and the name of txt with Nuovo Documento di testo.txt (without the bracket). Please let me know if I'm wrong using this function. #include "RecFileListToArray.au3" Dim $aFile,$FileName,$Test="C:\Test\" $FileName="Nuovo Documento di [testo.txt" $aFile=_RecFileListToArray($Test,$FileName, 1,1,0,1,"","") If @error=1 Then MsgBox(0,"Error","@Error:"&@error&@CR&"@Extended:"&@extended) Else MsgBox(0,"OK",$aFile[1]) EndIf