Jump to content
Sign in to follow this  
Balachander K

_GUICtrlListViewSort Sorting error.

Recommended Posts

Balachander K


I am using v3.1.1.130 (beta), WinXP-SP2.

I created a listview and added items to it.

When i sort by specific column, the numbers in it gets changed...please see the screen shots,

before sort and after sort...check the selected row...and column value changes...

i am sorting by column 'MBox No'.

please confirm or let me know what i am doing wrong...

the code i used is:

If $msg = $ListView_SRA Then _GUICtrlListViewSort($ListView_SRA, $B_DESCENDING, GUICtrlGetState($ListView_SRA))


Edited by Balachander K

Share this post

Link to post
Share on other sites
Balachander K


Please move this to support forum....

i think the reason for the change in text is this..

Number("222222222222222222222222222222") gives 7277124529082131342

so $a_lv[$X][$Y] = Number($v_item) line in _GUICtrlListViewSort changes 222222222222222222222222222222 to 7277124529082131342..

anybody explain please.

- Bala

Share this post

Link to post
Share on other sites


Yes, I think I've seen somewhere that the precision of large numbers has been changed lately, bur will be restored in a beta soon?

Meantime you could use a workaround from my UDF [link in my sig];

Uses a vbs sort, seems to convert up to 39 digit long numbers , as below;

Best, Randallc

#include "_GuiCtrlListView.au3"
$listviewA = _GUICtrlCreateListViewIndexed("Column 1        |Column 2|Column3",5,5,600,600,$LVS_REPORT)
    _GUICtrlCreateListViewItem("item" & 0&"|"&0&"|1131", $listviewA,-1,0,1)
    _GUICtrlCreateListViewItem("item" & 1&"|"&21&"|1131", $listviewA,-1,0,1)
    _GUICtrlCreateListViewItem("item" & 2&"|"&210&"|1131", $listviewA,-1,0,1)
    _GUICtrlCreateListViewItem("item" & 3&"|"&22&"|1131", $listviewA,-1,0,1)
For $x = 4 To 39;00
    _GUICtrlCreateListViewItem("item" & $x&"|"&StringLeft($s_twos,$x)&"|1131", $listviewA,-1,0,1)
ConsoleWrite("START :"&round(TimerDiff($timerstampS)) & " mseconds "&@lf)
While 1
  $msg = GUIGetMsg()
    Case $msg = $GUI_EVENT_CLOSE
  Case $msg = $listviewA
      __GUICtrlListViewSort($listviewA, -1, GUICtrlGetState($listviewA))

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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.