-
Feb 4th, 2015, 10:34 AM
#1
Thread Starter
New Member
new to visual basic need help with adding text to text box by command button
i am using visual basic 6 and i want to make a program that add letters or remove letters from a word in text box and but the result in a label
for example if i type the word "cat" and click the command button the label shows "cats" but it i type the word "ox" it shows "oxen" and if i type "sheep" it shows "sheep" and "foot" becomes "feet"
a basic plural program
i am familiar with the if condition and for next loop but i am unable to do what i want with these alone it just doesn't work
any help will be appreciated
thank you
-
Feb 4th, 2015, 10:50 AM
#2
Re: new to visual basic need help with adding text to text box by command button
There is no simple rule for getting the plural out of a singular.
You can create a table which contains for every word the singular and the plural.
Or you can implement a smaller table which only contains the exceptions:
http://www.edufind.com/english-grammar/plural-nouns/
-
Feb 4th, 2015, 10:56 AM
#3
Thread Starter
New Member
Re: new to visual basic need help with adding text to text box by command button
yes i just want the basic rules not the exception like for every word that ends with s or sh add es and for every other word add only s
and if the word has oo in the middle change them to ee
i dont know how to write a code for that
-
Feb 4th, 2015, 11:02 AM
#4
Re: new to visual basic need help with adding text to text box by command button
First write what you want to happen to a given singular down on paper.
These are your logic rules and these logic rules should not be conflicting with each other.
Example:
-> Foot
Add a "s" for the plural
-> Foots
Replace "oo" with "ee"
-> Feets
The result... Not what you want
-
Feb 4th, 2015, 11:05 AM
#5
Thread Starter
New Member
Re: new to visual basic need help with adding text to text box by command button
cant i make it apply only the rule that turns oo to ee if the word contains oo?
-
Feb 4th, 2015, 12:30 PM
#6
Re: new to visual basic need help with adding text to text box by command button
Turning oo into ee would not be a good idea anyway.
for example
Feed is not the plural of Food
-
Feb 4th, 2015, 12:42 PM
#7
Thread Starter
New Member
Re: new to visual basic need help with adding text to text box by command button
these where just examples the language i will be working with is Arabic but i thought English plural would be the closest thing to what i want to do
i just want a code that analyses the word i but and if a certain condition in a certain letter in that word is met it gives me a certain change in that letter
like in foot the condition here is that the second and forth letters are o and the result will be to change the third and forth letter to e and show the result on my label is there any code that can do this??
-
Feb 4th, 2015, 01:42 PM
#8
Re: new to visual basic need help with adding text to text box by command button
Originally Posted by mimijem
these where just examples the language i will be working with is Arabic but i thought English plural would be the closest thing to what i want to do
i just want a code that analyses the word i but and if a certain condition in a certain letter in that word is met it gives me a certain change in that letter
like in foot the condition here is that the second and forth letters are o and the result will be to change the third and forth letter to e and show the result on my label is there any code that can do this??
Yes of course you can do that, it would be simple but as I pointed out the word food meets the same criteria and to change the 0s to Es would create a totally different non plural word.
Now I have no idea what the rules may be in the language you are talking about so I do not know is this applies there and of course I have no idea how to tell you to create a rule for a language I do not know I can only point out that you example is not a good one as there are several words that may have oo that would not become ee.
You say you are aware of the If condition and looping so the other things you would need to look at are Instr() , Mid$(), Replace$() and Right$()
-
Feb 4th, 2015, 04:12 PM
#9
Re: new to visual basic need help with adding text to text box by command button
but i thought English plural would be the closest thing to what i want to do
NOT HARDLY! English HAS to be THE MOST mixed-up jumble of letters/characters in the universe (except Maybe Mandarin!!!). :-)
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|