VB6 - Function to sort via Time Zone using State (USA) only?

Valleriani
Valleriani used Ask the Experts™
on
I am trying to 'sort' from lowest timezone to highest timezone in the USA using states. I'm not sure if there is already a function for this.

Basicly I have a line that has name/address/state/etc.. Kinda like Test,Name,15412 Blah Road,FL,etc,etc,etc.

I was wondering about 'sorting' in general, and how I could go around by sorting using 'states'.

Thanks!
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
GrahamSkanRetired
Top Expert 2012
Commented:
There is nothing built in to VB6, so you would need a source of data that matched the address information to a particular time zone.

A simple way of sorting is to use a listbox with the sorted property set to True. That way items added via Additem are automatically inserted in the sorted order.
Ok heres aquestion.

I have a list now of zip codes, which have the country as wel, for example, the zip code file is like:

22743      5      Eastern (GMT -05:00)
22746      5      Eastern (GMT -05:00)
22746      5      Eastern (GMT -05:00)
22747      5      Eastern (GMT -05:00)
22747      5      Eastern (GMT -05:00)
22748      5      Eastern (GMT -05:00)
22749      5      Eastern (GMT -05:00)
22801      5      Eastern (GMT -05:00)
22801      5      Eastern (GMT -05:00)
22802      5      Eastern (GMT -05:00)


ZIP CODE, timezone number, and actual time zone.

Basicly it would check for zip match, then it should sort via time zone number from lowest to highest, but I'm not sure how to do so, right now i have the timezones loading into a array:

Timezone1() is the zip, Timezone2() is the timezone number, Timezone3() is the actual timezone name.

What kind of sort functions could I have here? And is there any good way to check then output a sorted list?

Right now I have it where its just outputting a list, not checking for zip, but I've done this:

                If (domainnum(i) = 27) Then
                    usplit = Split(str1, ",")
                    For z = 0 To UBound(usplit)
                        If IsNumeric(usplit(z) And Len(usplit(z) = 5)) Then
                            For zz = 1 To UBound(Timezone1)
                                If Timezone1(zz) = usplit(z) Then
                                   'dostuffhere
                                   Exit For
                                End If
                            Next
                        End If
                    Next
                End If


The issue is, What would I do here so then I can sort it without Writing first? Currently I just have it ts.writeline but this doesn't promote any sorting, etc.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial