I am trying to figure out how round robin a list of tickets and users. What I would like to do is put a username with a ticket number and round robin the username till all the tickets are assigned.
Say I have a list of tickets and usernames
Tickets = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
Usernames = name1,name2,name3,name4
would like the output of:
1 - name1
2 - name2
3 - name3
4 - name4
5 - name1
6 - name2
7 - name3
8 - name4
an so on... till all tickets have a username.
Thanks in advance
Round Robin Help Topic is solved
Re: Round Robin Help
Code: Select all
Tickets = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
Usernames = name1,name2,name3,name4
result :=
ticketno=0
tmp=0
Loop,parse,Usernames, `,
total_users := A_Index
Loop,Parse, Tickets, `,
{
if (tmp=total_users)
tmp=0
tmp++
ticketno := A_LoopField
Loop,parse,Usernames, `,
if (A_index=tmp)
result := result . ticketno " - " A_LoopField "`n"
}
MsgBox % result
Re: Round Robin Help
Thank you very much! Exactly what I needed.