Wooltown Posted February 28, 2007 Share Posted February 28, 2007 It's so much easier if you read the fucking manual before asking a question, I missed _GUICtrlCreateListViewItem for example Strange that this function isn't included in AutoIT by default. My application works VERY fast. /Sven Link to comment Share on other sites More sharing options...
Wooltown Posted February 28, 2007 Share Posted February 28, 2007 Got it to work, but from column 8 and forward it won't sort, first column is numbered 0. /Sven Link to comment Share on other sites More sharing options...
Wooltown Posted February 28, 2007 Share Posted February 28, 2007 In your Script I found Func __GUICtrlListViewSort($lv, $BDESCdummy, $i_OrderColumn, $i_ReDraw = 1, $i_CheckForNull = 0) and I set $i_CheckForNull to 1 and the problem is solved, perhaps you should inform of that on tha main page. Brilliant and fast ! Link to comment Share on other sites More sharing options...
randallc Posted February 28, 2007 Author Share Posted February 28, 2007 In your Script I found Func __GUICtrlListViewSort($lv, $BDESCdummy, $i_OrderColumn, $i_ReDraw = 1, $i_CheckForNull = 0) and I set $i_CheckForNull to 1 and the problem is solved, perhaps you should inform of that on tha main page. Brilliant and fast !Hi, Thanks for your interest! - I got it doing what I needed at the time, and there was no ongoing interest, so let the dev drop. I will try to get it doc better; most people who were interested wanted to stick to the new sort plan; (to do with registry), even though I could never get any discussion going on why I could not get that to go fast! Also PaulIA has a new schedule for writing the ListView faster for faster large LVs (over 4000) which I have not tested, and which would need this to be modified to work; I haven't had the time for any of it so far! [not sure if he has a dll for faster sorts too?] Someone else had a dll for a faster LV sort, somewhere else, which was not fully exposed, I believe. Best,randall ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
Private Posted March 5, 2007 Share Posted March 5, 2007 That's what i call Support! i was irritated by the slow sorter but as reading this topic i'm sure this will be over!! i don't have VBS installed, but i'm trying with the Express VBS. Great work ! Best Regards, Daryl Link to comment Share on other sites More sharing options...
JohnBailey Posted March 7, 2007 Share Posted March 7, 2007 Can anyone here give me some guidance on sorting by criteria according to linked columns http://www.autoitscript.com/forum/index.php?showtopic=42222Maybe there is an easier way to do what I'm wanting to know how to do A decision is a powerful thing Link to comment Share on other sites More sharing options...
Wooltown Posted March 7, 2007 Share Posted March 7, 2007 The example script gives you the guidance, but $listview = _GUICtrlCreateListViewIndexed ..... - creates the ListView, replaces the standard ListView creation _GUICtrlCreateListViewItem($s_RandomListItem, $listview,-1,0,1) - add Items to the list, replaces standard ListViewItems creation __GUICtrlListViewSort( $listview,$B_DESCENDING,GUICtrlGetState($listview));,1,1) - This is what happens when you click on the label to sort. Hope this make sense ;_GUICtrlListViewSorter.au3 0_18 #include-once #include "_GUICtrlListView.au3" ;Dim $searchGUI,$listview, $Btn_Exit, $msg, $Status, $Btn_Insert, $ret, $Input_Index,$timerstamp $searchGUI = GUICreate("ListView Sort", 810, 623, (@DesktopWidth - 800) / 2, (@DesktopHeight - 600) / 2,$WS_MAXIMIZEBOX + $WS_MINIMIZEBOX) ;~ _GUISetCheckBoxesPresent();****************************** ;~ $listview = _GUICtrlCreateListViewIndexed("Index |col1 |col2|col3", 10, 10, 790, 530,$WS_VSCROLL,$LVS_EX_CHECKBOXES+$LVS_EX_GRIDLINES);Drag&Drop Columns $listview = _GUICtrlCreateListViewIndexed("Index |col1 |col2|col3", 10, 10, 790, 530, $LVS_SHOWSELALWAYS, BitOR($LVS_EX_GRIDLINES, $LVS_EX_HEADERDRAGDROP, $LVS_EX_FULLROWSELECT, $LVS_EX_REGIONAL));Drag&Drop Columns $timerstamp1 = TimerInit() for $i=1 to 4500; it also works quicker over 4000, but starts slowing down as "_GUICtrlListViewInsertItem" used $s_RandomListItem=$i&"|line"&Random(-10000, 10000, 1)&"|"&Random(-10000, 10000, 1)&"|more_"&Chr(Random(Asc("a"), Asc("z"), 1))&Chr(Random(Asc("a"), Asc("z"), 1))&String(Random(-10000, 10000, 1)) _GUICtrlCreateListViewItem($s_RandomListItem, $listview,-1,0,1) next ;$Btn_Exit = GUICtrlCreateButton("Exit", 300, 260, 70, 30) GUISetState() GUISetState(@SW_MAXIMIZE) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE; Or $msg = $Btn_Exit ExitLoop Case $msg = $listview ; sort the list by the column header clicked on $timerstamp1 = TimerInit() __GUICtrlListViewSort( $listview,$B_DESCENDING,GUICtrlGetState($listview));,1,1) ConsoleWrite("Time New :"&round(TimerDiff($timerstamp1)) & " mseconds to search."&@lf) ;MsgBox(0,"","Time New :"&round(TimerDiff($timerstamp1)) & " mseconds to search."&@lf,1) EndSelect WEnd Link to comment Share on other sites More sharing options...
JohnBailey Posted March 7, 2007 Share Posted March 7, 2007 Wooltown, this UDF seems to sort using just one column in the same way the original does. Maybe I'm missing something huge. I looked through the scripts too and can't seem to tell where it would allow for criteria sorting (eg. sort by one column and then another) A decision is a powerful thing Link to comment Share on other sites More sharing options...
randallc Posted March 7, 2007 Author Share Posted March 7, 2007 (edited) Hi, If you look in the zip in first post for "FastSubSort2D.au3" or similar name, there is a working example. Best, Randall PS The key sort criteria line here is; $i_ColSortIndex="2|-5|3";,[numbered by base 1 (ie first col number is "1")] [Sorts on cols 2,5,3 {DESC on 5 as NEGATIVE}] Edited March 7, 2007 by randallc ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
JohnBailey Posted March 8, 2007 Share Posted March 8, 2007 Randallc, Thanks! I'll have to do some tweaking, because the include is conflicting with vars I had setup originally. That's exactly what I've been searching for/trying to create. A decision is a powerful thing Link to comment Share on other sites More sharing options...
Wooltown Posted March 21, 2007 Share Posted March 21, 2007 It seems like the function dosen't work with 2 sortable ListViews in a GUI, or is there something I have missed ? Link to comment Share on other sites More sharing options...
JohnBailey Posted March 21, 2007 Share Posted March 21, 2007 Wooltown, could you give an example and describe what you mean a bit more? A decision is a powerful thing Link to comment Share on other sites More sharing options...
Wooltown Posted March 21, 2007 Share Posted March 21, 2007 On a GUI if you create 2 ListView and create them with GUICtrlCreateListViewIndexed, and then click on a column in one of them, strange things happen, items from listview 2 will occur in listview 1 and vice versa. I don't have time right now to make an axample script, but perhap in next week. Link to comment Share on other sites More sharing options...
randallc Posted March 21, 2007 Author Share Posted March 21, 2007 (edited) Hi, I can't remember details, but got it working in ""compare2GUIsArIcons.au3" [example scipt in the zip. post1] I had to; 1. i think limit total number controls between scripts to 4000. 2. use extra commands. See with in script; [i will rem out the lines for icons to show speedier.....] expandcollapse popupIf $i_MaxNumItems > 3999- (UBound($ar_listviewB) - 1) Then $i_MaxNumItems = 3999- (UBound($ar_listviewB) - 1)oÝ÷ Ù«¢+Ù%ÀÌØí¥}AÉÙ1X±ÐìÐìÀÌØí±¥ÍÑÙ¥ÝQ¡¸}1¥ÍÑY¥ÝIÉÜ ÀÌØí±¥ÍÑ٥ݰÀÌØíÉ}±¥ÍÑ٥ݰÀÌØí¥}EÕ¥¬¤oÝ÷ Ù*§m¢·¬"â²Ûâ{!ÈpjÇ%Éu·¢·Z0x-ë(®Û(¢yr¢wrدy«Z¶)uê^اbr±ÉbrG¢Ø^®Ìë-YoÈæ§u×j)l"ØbI¦Ø§jºÚÊÊÞiܢ̦Úrدx¸¬µXÁ«¢+Øí½µÁÉÉU%ÍÈ̹ÔÌÁ|ÄØ(¥¹±ÕÅÕ½Ðí}U% Ñɱ1¥ÍÑY¥Ü¹ÔÌÅÕ½Ðì(íø¥¹±ÕÅÕ½ÐíÉÉäɹÔÌÅÕ½Ðì(ÀÌØí¥}áÑÉ]¥Ñ ôÔÀÀ(ÀÌØí¥}áÑÉ!¥¡ÐôÌÀÀ)U% ÉÑ ÅÕ½Ðí±¥ÍÑ٥ܥѵÌÅÕ½Ðì°ÐØÀ¬ÀÌØí¥}áÑÉ]¥Ñ °ÌÔÀ¬ÀÌØí¥}áÑÉ!¥¡Ð°ÌÀ°ÌÀ°´Ä°ÀÌØí]M}a} AQ%1L¤)U%MÑ ½±½È ÁàÀÁÁ¤ìÝ¥±°¡¹É½Õ¹½±½È(ÀÌØíÑ¥µÉÍѵÁLôQ¥µÉ%¹¥Ð ¤)1½°ÀÌØí¥}AÉÙ ½µÁÉ°ÀÌØí¥}AÉÙ1X°ÀÌØí¥}EÕ¥¬ôÀ(ÀÌØíÉ}¥±Ìô}}¥±1¥ÍÑQ½ÉÉä¡MÉ¥ÁѥȵÀìÅÕ½ÐìÀäÈìÅÕ½Ðì¤(íøìôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôô(ÀÌØí±¥ÍÑÙ¥Ýô}U% Ñɱ ÉÑ1¥ÍÑY¥Ý%¹á ÅÕ½Ðí%¹àñ½°Äñ½°Éñ½°ÌÅÕ½Ðì°ÄÀ°ÄàÀ¬ÀÌØí¥}áÑÉ!¥¡Ð¼È°ÈÀÀ¬ÀÌØí¥}áÑÉ]¥Ñ ¼È°ÄÔÀ¬ÀÌØí¥}áÑÉ!¥¡Ð¼È°ÀÌØí1YM}M!=]M11]eL° ¥Ñ=H ÀÌØí1YM}a}I%1%9L°ÀÌØí1YM}a}!III=@°ÀÌØí1YM}a}U11I=]M1 P°ÀÌØí1YM}a}I%=90¤¤íɵÀíɽÀ ½±Õµ¹Ì(í}¥±MÑ%½¹Õ±Ð ÀÌØí±¥ÍÑ٥ݤ)½ÈÀÌØíàôÄQ¼ÄÀÀ(%}U% Ñɱ ÉÑ1¥ÍÑY¥Ý%Ñ´¡MÑÉ¥¹5¥ ÀÌØíÉ}¥±ÍlÀÌØíát°ÄȤ°ÀÌØí±¥ÍÑ٥ݰ´Ä°À°Ä¤)9áÐ(ÀÌØíÉ}±¥ÍÑÙ¥Ýô}1¥ÍÑY¥ÝÑQáÑÉÉä ÀÌØí±¥ÍÑ٥ݰĤìͽÉѽ¸ ½°ÄÍÄ(ìôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôô(ÀÌØí±¥ÍÑÙ¥Ýô}U% Ñɱ ÉÑ1¥ÍÑY¥Ý%¹á ÅÕ½Ðí%¹àñ½°Äñ½°Éñ½°ÌÅÕ½Ðì°ÄÀ°ÄÀ°ÈÀÀ¬ÀÌØí¥}áÑÉ]¥Ñ ¼È°ÄÔÀ¬ÀÌØí¥}áÑÉ!¥¡Ð¼È°ÀÌØí1YM}M!=]M11]eL° ¥Ñ=H ÀÌØí1YM}a}I%1%9L°ÀÌØí1YM}a}!III=@°ÀÌØí1YM}a}U11I=]M1 P°ÀÌØí1YM}a}I%=90¤¤íɵÀíɽÀ ½±Õµ¹Ì(í}¥±MÑ%½¹Õ±Ð ÀÌØí±¥ÍÑ٥ݤ(ÀÌØí¥}5á9Õµ%ѵÌô¡U ½Õ¹ ÀÌØíÉ}¥±Ì¤´Ä¤´¡U ½Õ¹ ÀÌØíÉ}±¥ÍÑ٥ݤ´Ä¤)%ÀÌØí¥}5á9Õµ%ѵÌÐìÌäää´¡U ½Õ¹ ÀÌØíÉ}±¥ÍÑ٥ݤ´Ä¤Q¡¸ÀÌØí¥}5á9Õµ%ѵÌôÌäää´¡U ½Õ¹ ÀÌØíÉ}±¥ÍÑ٥ݤ´Ä¤(íø½ÈÀÌØíàôÄQ¼ÀÌØí¥}5á9Õµ%ѵÌ)½ÈÀÌØíàôÄQ¼ÄÀÀÀ(íø½ÈÀÌØíàôÄQ¼Èäää(íø½ÈÀÌØíàôÄQ¼U ½Õ¹ ÀÌØíÉ}¥±Ì¤´Ä(%}U% Ñɱ ÉÑ1¥ÍÑY¥Ý%Ñ´¡MÑÉ¥¹5¥ ÀÌØíÉ}¥±ÍlÀÌØíát°ÄȤ°ÀÌØí±¥ÍÑ٥ݰ´Ä°À°Ä¤)9áÐ(ÀÌØíÉ}±¥ÍÑÙ¥Ýô}1¥ÍÑY¥ÝÑQáÑÉÉä ÀÌØí±¥ÍÑ٥ݰĤìͽÉѽ¸ ½°ÄÍÄ(ìôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôô(ÀÌØí±¥ÍÑÙ¥Ýô}U% Ñɱ ÉÑ1¥ÍÑY¥Ý%¹á ÅÕ½Ðí%¹àñ½°Äñ½°Éñ½°ÌÅÕ½Ðì°ÈÈÀ¬ÀÌØí¥}áÑÉ]¥Ñ ¼È°ÄÀ°ÈÀÀ¬ÀÌØí¥}áÑÉ]¥Ñ ¼È°ÄÔÀ¬ÀÌØí¥}áÑÉ!¥¡Ð¼È°ÀÌØí1YM}M!=]M11]eL° ¥Ñ=H ÀÌØí1YM}a}I%1%9L°ÀÌØí1YM}a}!III=@°ÀÌØí1YM}a}U11I=]M1 P°ÀÌØí1YM}a}I%=90¤¤íɵÀíɽÀ ½±Õµ¹Ì(í}¥±MÑ%½¹Õ±Ð ÀÌØí±¥ÍÑ٥ݤ(ÀÌØíѹ}½µÁÉôU% Ñɱ ÉÑ ÕÑѽ¸ ÅÕ½Ðí ½µÁÉÅÕ½Ðì°ÈØÀ¬ÀÌØí¥}áÑÉ]¥Ñ ¼È°ÄäÀ¬ÀÌØí¥}áÑÉ!¥¡Ð¼È°ÄÈÀ°ÈÔ¤)U%MÑMÑÑ ¤) ½¹Í½±]É¥Ñ ÅÕ½ÐíMQIPèÅÕ½ÐìµÀìI½Õ¹¡Q¥µÉ¥ ÀÌØíÑ¥µÉÍѵÁL¤¤µÀìÅÕ½ÐìµÍ½¹ÌÅÕ½ÐìµÀì1¤(ìôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôô)¼($ÀÌØíµÍôU%Ñ5Í ¤(%M±Ð($% ÍÀÌØíµÍôÀÌØíѹ}½µÁÉ($$%%9½ÐÀÌØí¥}AÉÙ ½µÁÉQ¡¸($$$$ÀÌØíÑ¥µÉÍѵÁ0ôQ¥µÉ%¹¥Ð ¤($$$%} ÉÑ1Y ½µÁÉÈ ÀÌØí±¥ÍÑ٥ݰÀÌØíÉ}±¥ÍÑ٥ݰÀ°ÀÌØíÉ}±¥ÍÑ٥ݰÀ°À¤ì ½°ÅÕ½ÐìÀÅÕ½Ðì½1Y}° ½°ÅÕ½ÐìÀÅÕ½Ðì½1Y}($$$% ½¹Í½±]É¥Ñ ÅÕ½Ðí ÉÑèÅÕ½ÐìµÀìI½Õ¹¡Q¥µÉ¥ ÀÌØíÑ¥µÉÍѵÁ0¤¤µÀìÅÕ½ÐìµÍ½¹ÌÅÕ½ÐìµÀì1¤($$$$ÀÌØíÉ}±¥ÍÑÙ¥Ýô}1¥ÍÑY¥ÝÑQáÑÉÉä ÀÌØí±¥ÍÑ٥ݰÀ°´Ä¤ì¹½ÐͽÉѽ¸ ½°ÀÍÄ($$$%5Í ½à À°ÅÕ½ÐìÅÕ½Ðì°ÅÕ½Ðí ÉÑèÅÕ½ÐìµÀìI½Õ¹¡Q¥µÉ¥ ÀÌØíÑ¥µÉÍѵÁ0¤¤µÀìÅÕ½ÐìµÍ½¹ÌÅÕ½Ðì¤($$$$ÀÌØí¥}AÉÙ1XôÀÌØí±¥ÍÑÙ¥Ý($$$$ÀÌØí¥}AÉÙ ½µÁÉôQÉÕ($$%¹%($% ÍÀÌØíµÍôÀÌØí±¥ÍÑÙ¥Ý($$%%ÀÌØí¥}AÉÙ1X±ÐìÐìÀÌØí±¥ÍÑÙ¥ÝQ¡¸}1¥ÍÑY¥ÝIÉÜ ÀÌØí±¥ÍÑ٥ݰÀÌØíÉ}±¥ÍÑ٥ݰÀÌØí¥}EÕ¥¬¤($$%}}U% Ñɱ1¥ÍÑY¥ÝM½ÉÐ ÀÌØí±¥ÍÑ٥ݰ´Ä°U% ÑɱÑMÑÑ ÀÌØí±¥ÍÑ٥ݤ¤ì°È¤ìÅÕ½ÐìÈÅÕ½Ðì±±½Ü͹¥¹¼Í¹¥¹($$% ½¹Í½±]É¥Ñ ÅÕ½ÐíU ½Õ¹ ÀÌØíÉ}±¥ÍÑ٥ݤ´ÄôÅÕ½ÐìµÀìU ½Õ¹ ÀÌØíÉ}±¥ÍÑ٥ݤ´ÄµÀì1¤($$$ÀÌØí¥}AÉÙ1XôÀÌØí±¥ÍÑÙ¥Ý($% ÍÀÌØíµÍôÀÌØí±¥ÍÑÙ¥Ý($$%%ÀÌØí¥}AÉÙ1X±ÐìÐìÀÌØí±¥ÍÑÙ¥ÝQ¡¸}1¥ÍÑY¥ÝIÉÜ ÀÌØí±¥ÍÑ٥ݰÀÌØíÉ}±¥ÍÑ٥ݰÀÌØí¥}EÕ¥¬¤($$%}}U% Ñɱ1¥ÍÑY¥ÝM½ÉÐ ÀÌØí±¥ÍÑ٥ݰ´Ä°U% ÑɱÑMÑÑ ÀÌØí±¥ÍÑ٥ݤ¤ì°ÈÅÕ½ÐìÈÅÕ½Ðì±±½Ü͹¥¹¼Í¹¥¹($$% ½¹Í½±]É¥Ñ ÅÕ½ÐíU ½Õ¹ ÀÌØíÉ}±¥ÍÑ٥ݤ´ÄôÅÕ½ÐìµÀìU ½Õ¹ ÀÌØíÉ}±¥ÍÑ٥ݤ´ÄµÀì1¤($$$ÀÌØí¥}AÉÙ1XôÀÌØí±¥ÍÑÙ¥Ý($% ÍÀÌØíµÍôÀÌØí±¥ÍÑÙ¥Ý($$%%ÀÌØí¥}AÉÙ1X±ÐìÐìÀÌØí±¥ÍÑÙ¥ÝQ¡¸}1¥ÍÑY¥ÝIÉÜ ÀÌØí±¥ÍÑ٥ݰÀÌØíÉ}±¥ÍÑ٥ݰÀÌØí¥}EÕ¥¬¤($$%}}U% Ñɱ1¥ÍÑY¥ÝM½ÉÐ ÀÌØí±¥ÍÑ٥ݰ´Ä°U% ÑɱÑMÑÑ ÀÌØí±¥ÍÑ٥ݤ¤ì°ÈÅÕ½ÐìÈÅÕ½Ðì±±½Ü͹¥¹¼Í¹¥¹($$% ½¹Í½±]É¥Ñ ÅÕ½ÐíU ½Õ¹ ÀÌØíÉ}±¥ÍÑ٥ݤ´ÄôÅÕ½ÐìµÀìU ½Õ¹ ÀÌØíÉ}±¥ÍÑ٥ݤ´ÄµÀì1¤($$$ÀÌØí¥}AÉÙ1XôÀÌØí±¥ÍÑÙ¥Ý(%¹M±Ð)U¹Ñ¥°ÀÌØíµÍôÀÌØíU%}Y9Q} 1=MBest, Randall Edited March 21, 2007 by randallc ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
nend Posted June 1, 2007 Share Posted June 1, 2007 Hoi Randallc, First of all sorry for my bad English. Your udf looks great but in my program I'm using date how are formatted as dd-mm-yyyy, You can't sort this wright with a normal sort. With the standard listview control I've change the date from dd-mm-yyyy to yyyy-mm-dd just before sorting and change it back before he shows the listview. I've did it with this 2 functions. Is ther a possibilitie to do that with your udf ? I am only using it on 4 columns all the other columns are sorted in a normal way. expandcollapse popupFunc GUICtrlListViewSortdatum($h_listview, ByRef $v_descending, $i_sortcol) Local $X, $Y, $Z, $b_desc, $columns, $items, $v_item, $temp_item If _GUICtrlListViewGetItemCount($h_listview) Then If (IsArray($v_descending)) Then $b_desc = $v_descending[$i_sortcol] Else $b_desc = $v_descending EndIf $columns = _GUICtrlListViewGetSubItemsCount($h_listview) $items = _GUICtrlListViewGetItemCount($h_listview) For $X = 1 To $columns $temp_item = $temp_item & " |" Next $temp_item = StringTrimRight($temp_item, 1) Local $a_lv[$items][$columns + 1], $i_selected $i_selected = StringSplit(_GUICtrlListViewGetSelectedIndices($h_listview), "|") For $X = 0 To UBound($a_lv) - 1 Step 1 For $Y = 0 To UBound($a_lv, 2) - 2 Step 1 $v_item = StringStripWS(_GUICtrlListViewGetItemText($h_listview, $X, $Y), 2) If (StringIsFloat($v_item) Or StringIsInt($v_item)) Then $a_lv[$X][$Y] = Number($v_item) Else $a_lv[$X][$Y] = $v_item EndIf Next $a_lv[$X][$Y] = $X if StringInStr($a_lv[$x][$i_sortcol], ":") Then $datum = StringSplit($a_lv[$x][$i_sortcol], " ") $a_lv[$x][$i_sortcol] = datum($datum[1]) & " " & $datum[2] Else $a_lv[$x][$i_sortcol] = datum($a_lv[$x][$i_sortcol]) EndIf Next _ArraySort($a_lv, $b_desc, 0, 0, $columns + 1, $i_sortcol) _GUICtrlListViewSetItemSelState($h_listview, -1, 0) For $X = 0 To UBound($a_lv) - 1 Step 1 For $Y = 0 To UBound($a_lv, 2) - 2 Step 1 if $Y = $i_sortcol then if StringInStr($a_lv[$x][$i_sortcol], ":") Then $datum = StringSplit($a_lv[$x][$i_sortcol], " ") $a_lv[$x][$i_sortcol] = datum($datum[1]) & " " & $datum[2] Else $a_lv[$x][$i_sortcol] = datum($a_lv[$x][$i_sortcol]) EndIf EndIf _GUICtrlListViewSetItemText($h_listview, $X, $Y, $a_lv[$X][$Y]) Next For $Z = 1 To $i_selected[0] If $a_lv[$X][UBound($a_lv, 2) - 1] = $i_selected[$Z]Then _GUICtrlListViewSetItemSelState($h_listview, $X, 1, 1) ExitLoop EndIf Next Next If (IsArray($v_descending)) Then $v_descending[$i_sortcol] = Not $b_desc Else $v_descending = Not $b_desc EndIf EndIf EndFunc func datum($datum) if StringInStr($datum, "/") Then $datum = StringSplit($datum, "/") $jaar = $datum[1] $maand = $datum[2] $dag = $datum[3] Return ($dag & "-" & $maand & "-" & $jaar) Else if StringInStr($datum, "-") Then $datum = StringSplit($datum, "-") $dag = $datum[1] $maand = $datum[2] $jaar = $datum[3] Return ($jaar & "/" & $maand & "/" & $dag) Else Return ("") EndIf EndIf $dag = "" $maand = "" $jaar = "" EndFunc Link to comment Share on other sites More sharing options...
randallc Posted June 1, 2007 Author Share Posted June 1, 2007 Hi, Not sure; I'll have a think. In the past, I have just created an extra column, with dates in a format for sorting, and kept that column hidden; direct the sort to click on the sorting column; but I forget how I did it. I would have to include all sorts of possibilities in the sort for the original date/ time format, so not sure it would be simple? Best, Randall ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
Siao Posted October 16, 2007 Share Posted October 16, 2007 1st post is all butchered, nothing to download... "be smart, drink your wine" Link to comment Share on other sites More sharing options...
randallc Posted October 16, 2007 Author Share Posted October 16, 2007 1st post is all butchered, nothing to download... hi,Thanks,True; i've put back the 2 main files, though more options are available in later scripts; look at the zip in searchminer link in signature too...Best, randall ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
Siao Posted October 16, 2007 Share Posted October 16, 2007 Thanks, gonna try with ~50000 items... "be smart, drink your wine" Link to comment Share on other sites More sharing options...
FuryCell Posted November 11, 2009 Share Posted November 11, 2009 (edited) Is there anywhere this can be downloaded? The link is broken in the first post. On that note, is anybody interested in creating a list view sort using the machine code? Edited November 11, 2009 by P5ych0Gigabyte HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now