![]() |
| ||
| Array I'm new with VB and I'm trying to write an array to find the time zone per state. AL = CST NY = EST CA = PST If I have a data that has NY as a state I will put EST on the output ...] Can somebody sho me the basic of array writing. |
| ||
| This is untested, but something like this might work string timeZone[3], state, zone |
| ||
| Close Dani :-), but this isn't C/Java :-P. First of all, I'm assuming your using VB6. If you're not, tell me what VB version you're using and I'll adjust the code. A better way of implimenting this, is to add a Class Module. I named my class module clsStateTime, and this is the code inside it: Public state As String You should fill in the other 50 states with the results you want. To use this class, I made this code under a command button (but, you could do it however you want): Private Sub Command1_Click() Just as a note, the index is the number in between the ()! Dani, notice how I Dim'ed it with a (2), but I used 3 "slots" in the array? Thats another VB difference :-P. Oh yeah, we don't dim vars with the type first either :-P. |
| All times are GMT -4. The time now is 7:42 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC