| | |
Question RE using Array Values in Case/If statements
![]() |
•
•
Join Date: Apr 2008
Posts: 5
Reputation:
Solved Threads: 0
I have a VBS that I using to create a phone list..I've posted quite a few questions relating to it on these forumns, and have been getting some good feed back, so I thought I'd post one last question. I have a list of names that is pulled from my Active Directory, and I have found a way to alphabetize them (using a bubble sort). The names are in an array which I populated with only the first name and last name of the user, however my form is sorted by other attributes of the account...so question 1 is do I lose all the other attributes of the record that is being pulled when I place them in the array? and question 2 is how would I use the entries of the array in my if statement that is nested within a case statement?
Here is a sample of the code that I am using...
Here is a sample of the code that I am using...
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
EnumerateUsers(oCont) Dim oUser Dim arrNames() intSize = 0 For Each oUser In oCont ' start bubble sort ReDim preserve arrNames(intsize) arrNames(intsize) = oUser.SN & ", " & oUser.GivenName intSize = intSize + 1 Next For i = (UBound(arrNames) - 1) to 0 Step -1 For j= 0 to i If UCase(arrNames(j)) > UCase(arrNames(j+1)) Then strHolder = arrNames(j+1) arrNames(j+1)=arrNames(j) arrNames(j) = StrHolder End If Next 'end bubble sort, now all names are in alphabetical order by last name Select Case LCase(oUser.Class) Case "user" If oUser.telephoneNumber <> "" then If oUser.physicalDeliveryOfficeName = "Wixom" then If oUser.department = "Engineering" then sdata = "<tr>" sdata = sdata & "<td class='list'>" & oUser.GivenName & " " & oUser.SN & "</td>" sdata = sdata & "<td class='list'>" & oUser.telephoneNumber & "</td>" sdata = sdata & "</tr>" wixEng(wixEngRow) = sdata 'wixEngRow = wixEngRow wixEngRow = wixEngRow + 1 end if
![]() |
Similar Threads
- C++ PROBLEMS (C++)
- Building an array-user-option class to manipulate an array (Java)
- Lookup tables - how to perform a switch using a string (C++)
- I've got Trojan.Holax... is this bad? (Viruses, Spyware and other Nasties)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Help in coding using msflexgrid
- Next Thread: Help with Code to Make an acess 2000 report show up in visual basic 6
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age application basic beginner birth bmp calculator cd cells.find click client code college component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report save search sendbyte sites sort sql sql2008 sqlserver subroutine tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





