i have this Type And This List
later on i tried to change the order of sort by Assigning a new Value to the aQueue integer
the values i try to assign is between 5 and 498 based on a lower integer in the item list
i did the following
what i expecting from the sub is returning an integer start with 6 From First Request then start to get new integer based on lower integer in the Item list plus 1
as example
6
7
8
9
etc... until it reach 498
but the output of this sub gives repetitive numbers
6
7
7
7
7
it keeps giving same integers after second request even i checked if the value is equal then added + 1 and still getting same integers
what iam doing wrong ?
B4X:
Dim alist As List
For i = 0 To 200 -1
Dim username As String
Dim usr As User
usr.username = "Item"&i
usr.aQueue= 503
alist.Add(usr)
Next
alist.SortType("aQueue", True)
later on i tried to change the order of sort by Assigning a new Value to the aQueue integer
the values i try to assign is between 5 and 498 based on a lower integer in the item list
i did the following
B4X:
Public Sub SetQueue(Auser As user)
Dim Cqueue As Int
Cqueue= 5
For i = alist.Size -1 To 0 Step -1
Dim usr As user
usr = alist.Get(i)
If (usr.aQueue > 2) And (usr.aQueue< 499)Then
If Cqueue = usr.aQueue Then
Cqueue= Cqueue + 1
End If
Cqueue = usr.aQueue
End If
Next
Cqueue = Cqueue + 1
Auser.aQueue= Cqueue
End Sub
what i expecting from the sub is returning an integer start with 6 From First Request then start to get new integer based on lower integer in the Item list plus 1
as example
6
7
8
9
etc... until it reach 498
but the output of this sub gives repetitive numbers
6
7
7
7
7
it keeps giving same integers after second request even i checked if the value is equal then added + 1 and still getting same integers
what iam doing wrong ?