I am running NMDC hub, so it is VBScripts.
The hub is running for registreted users only, and I want to make a list of the registreted users, as we are close to 1000 reg. users. It is damned hard to find a certain user in the NMDC window with that number of users.
I have no troubles to get the data from:
CStr(frmHub.lstOps.ListItems.Item(i).Text) and
CStr(frmHub.lstOps.ListItems.Item(i).SubItems(x))
But I have troubles to list them out, so it is showed in a nice list with the data in each columns.
I have tried to messure the Len(username) and then make a Space of 30-Len(username), but smalls and capitals broke that attempt.
Any way to make a position on a line in VB???
Any suggestions will be appreciated very much
HELP to format a list in nice columns
Moderator: Moderators
Since the clients don't use a Fixed Width Font, no matter what you do it won't work perfectly all the time. You are on the same path as I used that gave the best results... Prob no help, but here ya go.
Code: Select all
tText = "This is a list of registered users:" & vbCrlf
For Each usrUser in frmHub.lstOps.ListItems
If usrUser.SubItems(2) Then
If InStr(lCase(usrUser & " "),lCase(sData)) > 0 Then
tText = tText & "<" & usrUser & ">"
If len(cstr(usrUser))<18 Then tText = tText & vbTab
If len(cstr(usrUser))<9 Then tText = tText & vbTab & vbTab
tText = tText & vbTab & "Last Seen: "
If colUsers.OnLine(usrUser.Text) Then
tText = tText & "Online Now"
Else
If trim(usrUser.SubItems(3)) <> "" Then
tText = tText & usrUser.SubItems(3)
Else
tText = tText & "Never"
End If
End If
tText = tText & vbCrlf
End If
End If
Next
tText = tText & "End of Ops List."
Owner of Lurkers Lair a Phoenix Rising Hub
Thanks for your response, but I am sorry to say, it did not worked.
So now I have made the list in another order, starting with "Last Logged in", "Operator", "Name" and "Password". Now it is only the column with password, which is "not nice", but as it is only for my use, I can live with that.
I needed a list of all registreted user, not only ops, so I removed "If usrUser.SubItems(2) Then"
General I were looking for an easy way to make those columns, also in other lists, but as I understand it is a problem with not Fixed Width Fonts.
I have some txt-files for various info in the hub, and I had to write them in the client-notepad first, and then copy to the normal notepad to get the column right. That must be the same problem.
Thanks again
don_des
So now I have made the list in another order, starting with "Last Logged in", "Operator", "Name" and "Password". Now it is only the column with password, which is "not nice", but as it is only for my use, I can live with that.
I needed a list of all registreted user, not only ops, so I removed "If usrUser.SubItems(2) Then"
General I were looking for an easy way to make those columns, also in other lists, but as I understand it is a problem with not Fixed Width Fonts.
I have some txt-files for various info in the hub, and I had to write them in the client-notepad first, and then copy to the normal notepad to get the column right. That must be the same problem.
Thanks again
don_des