This is my array:
aryProv(0).prov = "NOVA SCOTIA"
What the program does:
2 functions, if the user enters in a province, such as "NOVA SCOTIA", the program generates the abbreviation "NS". If they enter in "NS" the outcome is "NOVA SCOTIA".
What I want the program to do:
I want it to recognize multiple array outputs. See how I have "NOVA SCOTIA" in all caps? I want it so I can enter in like "Nova Scotia" or "nova scotia". This way it's not case sensitive. The program currently works fine but I can't make the array actually equal more than just the "NOVA SCOTIA".
I tried:
aryProv(0).prov = "NOVA SCOTIA" or "Nova Scotia" or "nova scotia" but these don't work. I also tried:
aryProv(0).prov = "NOVA SCOTIA", "Nova Scotia", "nova scotia"
But neither of these worked.
Can anyone help me out on this one? Aside from this minor detail, everything is running smoothly.
Thanks in advance for any help.
Mike
Question about my array setup
Page 1 of 110 Replies - 690 Views - Last Post: 12 November 2012 - 01:47 PM
Replies To: Question about my array setup
#2
Re: Question about my array setup
Posted 12 November 2012 - 08:28 AM
Stop. Stop. Stop.
To be clear that is not an array. That is one element of an array.
aryProv might be an array. But aryProv(0) is first element of that array. It can only hold one value.
The idea that you are going to make numerous arrays for every case combination is just plain silly.
and it seems obvious that you haven't so much as read any textbook's chapter on arrays or you wouldn't be trying to set a single element to several values.
VB6 might be 10 years dead and something that nobody would use to build a new program today, but I'm sure it might have some commands for dealing with case. For example
Its common to do this sort of things before comparrisons
My suggestion is you stop trying to build this application. You're clueless about the language you are working with or the concept of array's that you're trying to use. Pick up a book on VB.6 (Try the public library for something this old) and just work it cover to cover.
Personally though I think it would be a much better use of your time to work on a language people use in THIS century. I mean, its all equally new to you. You can spend 5,000 hours learning VB6 and qualify for 3 jobs a month updating legacy applications or you can spend the same 5,000 hours on a modern language and qualify for 100 times as many jobs.
Quote
This is my array: aryProv(0).prov = "NOVA SCOTIA"
To be clear that is not an array. That is one element of an array.
aryProv might be an array. But aryProv(0) is first element of that array. It can only hold one value.
The idea that you are going to make numerous arrays for every case combination is just plain silly.
and it seems obvious that you haven't so much as read any textbook's chapter on arrays or you wouldn't be trying to set a single element to several values.
VB6 might be 10 years dead and something that nobody would use to build a new program today, but I'm sure it might have some commands for dealing with case. For example
string temp = "NOVA SCOTIA".ToLower();// In C# this would set temp to "nova scotia"
Its common to do this sort of things before comparrisons
if (UserInput.ToLower() == "nova scotia")
{
// Then do this
}
My suggestion is you stop trying to build this application. You're clueless about the language you are working with or the concept of array's that you're trying to use. Pick up a book on VB.6 (Try the public library for something this old) and just work it cover to cover.
Personally though I think it would be a much better use of your time to work on a language people use in THIS century. I mean, its all equally new to you. You can spend 5,000 hours learning VB6 and qualify for 3 jobs a month updating legacy applications or you can spend the same 5,000 hours on a modern language and qualify for 100 times as many jobs.
This post has been edited by tlhIn`toq: 12 November 2012 - 08:30 AM
#3
Re: Question about my array setup
Posted 12 November 2012 - 08:48 AM
As a follow on, the equivalent in VB6 to ToUpper is UCASE$ or LCASE$ for ToLower.
How are you populating your "array" and what is the datatype of this "array"??
The fact that your referencing a property of "prov" suggests its some user defined type or a class?
Show us some more code on this, as what you've posted doesn't help and as mentioned previously, makes no sense.
How are you populating your "array" and what is the datatype of this "array"??
The fact that your referencing a property of "prov" suggests its some user defined type or a class?
Show us some more code on this, as what you've posted doesn't help and as mentioned previously, makes no sense.
This post has been edited by maj3091: 12 November 2012 - 08:48 AM
#4
Re: Question about my array setup
Posted 12 November 2012 - 01:02 PM
tlhIn`toq, on 12 November 2012 - 08:28 AM, said:
Stop. Stop. Stop.
To be clear that is not an array. That is one element of an array.
aryProv might be an array. But aryProv(0) is first element of that array. It can only hold one value.
The idea that you are going to make numerous arrays for every case combination is just plain silly.
and it seems obvious that you haven't so much as read any textbook's chapter on arrays or you wouldn't be trying to set a single element to several values.
VB6 might be 10 years dead and something that nobody would use to build a new program today, but I'm sure it might have some commands for dealing with case. For example
Its common to do this sort of things before comparrisons
My suggestion is you stop trying to build this application. You're clueless about the language you are working with or the concept of array's that you're trying to use. Pick up a book on VB.6 (Try the public library for something this old) and just work it cover to cover.
Personally though I think it would be a much better use of your time to work on a language people use in THIS century. I mean, its all equally new to you. You can spend 5,000 hours learning VB6 and qualify for 3 jobs a month updating legacy applications or you can spend the same 5,000 hours on a modern language and qualify for 100 times as many jobs.
Quote
This is my array: aryProv(0).prov = "NOVA SCOTIA"
To be clear that is not an array. That is one element of an array.
aryProv might be an array. But aryProv(0) is first element of that array. It can only hold one value.
The idea that you are going to make numerous arrays for every case combination is just plain silly.
and it seems obvious that you haven't so much as read any textbook's chapter on arrays or you wouldn't be trying to set a single element to several values.
VB6 might be 10 years dead and something that nobody would use to build a new program today, but I'm sure it might have some commands for dealing with case. For example
string temp = "NOVA SCOTIA".ToLower();// In C# this would set temp to "nova scotia"
Its common to do this sort of things before comparrisons
if (UserInput.ToLower() == "nova scotia")
{
// Then do this
}
My suggestion is you stop trying to build this application. You're clueless about the language you are working with or the concept of array's that you're trying to use. Pick up a book on VB.6 (Try the public library for something this old) and just work it cover to cover.
Personally though I think it would be a much better use of your time to work on a language people use in THIS century. I mean, its all equally new to you. You can spend 5,000 hours learning VB6 and qualify for 3 jobs a month updating legacy applications or you can spend the same 5,000 hours on a modern language and qualify for 100 times as many jobs.
I've read this a few times now and can't figure out why you're so angry towards it. I'm clearly new to it, so saying stuff like "you're clueless" really is not necessary. If you're that insulted by a post on here, then don't reply.
I don't understand why people have to be so degrading over text. I admit I'm not a professional at this but I'm wanting to learn, however.
#5
Re: Question about my array setup
Posted 12 November 2012 - 01:07 PM
RYKIN, on 12 November 2012 - 03:02 PM, said:
I'm clearly new to it, so saying stuff like "you're clueless" really is not necessary. If you're that insulted by a post on here, then don't reply.
You are taking it out of context.
Quote
You're clueless about the language you are working with or the concept of array's that you're trying to use. Pick up a book on VB.6 (Try the public library for something this old) and just work it cover to cover.
This statement is of fact, & he's trying to point you into the right direction rather than letting you learn incorrectly. Fundamentals of programming & development are necessary.
#6
Re: Question about my array setup
Posted 12 November 2012 - 01:09 PM
I'm done with this site. People like that guy ruin it for me.
The point is to come here and ask questions. I didn't come here looking for answers. See ya's. Thanks for the help.
The point is to come here and ask questions. I didn't come here looking for answers. See ya's. Thanks for the help.
#7
Re: Question about my array setup
Posted 12 November 2012 - 01:12 PM
#8
Re: Question about my array setup
Posted 12 November 2012 - 01:34 PM
Please don't think I'm angry. I'm not. One has to be emotionally invested in other person to be angry. I don't know you that well.
There is a difference between coming to a site looking for help with a specific issue and coming to a site without having done ANY basic preparation like working through the simplest of "Learn VB in 30 day" type books, and expecting everyone to hand-hold you through the ultra-basics.
You have to take some responsibility for yourself and your education. This is not a paid on-line university you've come to. This is an all volunteer site where senior coding professionals choose to mentor up and coming coding professionals they exhibit a decent work ethic.
Most of the people I talk to here feel there is also an obligation to help our industry at large. Those rookies that show they have what it takes will get LOTS of our time and patience. Those that are lazy, aren't willing to put in any effort on their own, won't put in any trial and error... basically those that show they would be someone we wouldn't want to see in the cubical next to use because they would be constantly ask "Show me how to do my job"... are people we don't waste much time on.
You show us some effort, we'll give you some effort. Like most places in life.
If you want to actually learn we're here to help.
My standard beginner resources post
There is a difference between coming to a site looking for help with a specific issue and coming to a site without having done ANY basic preparation like working through the simplest of "Learn VB in 30 day" type books, and expecting everyone to hand-hold you through the ultra-basics.
You have to take some responsibility for yourself and your education. This is not a paid on-line university you've come to. This is an all volunteer site where senior coding professionals choose to mentor up and coming coding professionals they exhibit a decent work ethic.
Most of the people I talk to here feel there is also an obligation to help our industry at large. Those rookies that show they have what it takes will get LOTS of our time and patience. Those that are lazy, aren't willing to put in any effort on their own, won't put in any trial and error... basically those that show they would be someone we wouldn't want to see in the cubical next to use because they would be constantly ask "Show me how to do my job"... are people we don't waste much time on.
You show us some effort, we'll give you some effort. Like most places in life.
If you want to actually learn we're here to help.
My standard beginner resources post
Spoiler
#9
Re: Question about my array setup
Posted 12 November 2012 - 01:39 PM
My problem isn't with that. I don't need a general common sense life lesson.
Furthermore, my problem is with someone saying I'm clueless. Then telling me to stop writing an application that works, minus the small part that doesn't.
What I came here for was a hint/nudge/help. I never asked for anyone to hand-hold me through it. I think you're jumping to conclusions a bit too fast here. I'd rather someone nudge me in the right direction instead of flat out telling me how to write a specific piece of code I don't understand.
To add; you knew it was an element, and I said the program works, so clearly I'm not here asking for you to write it. I stated above that the upper/lower cases don't work and it's defaulting to upper case as I have it set to DO that in the properties.
Jumping ahead and assuming doesn't get you anyway in life, either.
Furthermore, my problem is with someone saying I'm clueless. Then telling me to stop writing an application that works, minus the small part that doesn't.
What I came here for was a hint/nudge/help. I never asked for anyone to hand-hold me through it. I think you're jumping to conclusions a bit too fast here. I'd rather someone nudge me in the right direction instead of flat out telling me how to write a specific piece of code I don't understand.
To add; you knew it was an element, and I said the program works, so clearly I'm not here asking for you to write it. I stated above that the upper/lower cases don't work and it's defaulting to upper case as I have it set to DO that in the properties.
Jumping ahead and assuming doesn't get you anyway in life, either.
#10
Re: Question about my array setup
Posted 12 November 2012 - 01:42 PM
Let's keep the discussion technical and on topic rather than about disputes with other members, please.
Page 1 of 1
|
|

New Topic/Question
This topic is locked



MultiQuote









|