Link to home
Start Free TrialLog in
Avatar of Kfkm09
Kfkm09Flag for United States of America

asked on

Two Questions

Hi, I am making a speech recognition program in Visual Basic 6.0, and have come along two questions that are probably not very difficult to answer, but since I am a relative beginner... Well, you get the idea :-). First of all, I have an entire dictionary saved as a .TXT file in which every single line is another word. I was wondering if there was any way I could get those words into my VB program using the 'Case' operation. My second question is, how do I add on to the text in a text box instead of covering up what was just written in it with new text. For example, if I pressed a button that made a text box say "Hi", and then pressed another button that made the text box say "Hello", "Hi" would dissapear, and on would come "Hello". How could I make it say "Hi Hello" instead? Thank you in advanced!
ASKER CERTIFIED SOLUTION
Avatar of rjdown
rjdown
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
PS for Q2, if you want a space between the words, you would have to do it yourself:

Text1 = Text1 + " " + NewText

or alternatively

Text1 = Text1 + chr(32) + NewText
just a minor point---> it is MUCH safer to use the String Concatenation operator & rahter than +:

Text1.Text = Text1.Text & " " & NewText

it is also MUCH better style to use the EXPLICIT property, rather than the DEFAULT property (.TEXT is the DEFAULT property of a text box).  This will help if you EVER decide top upgrade to VB.NET, and in .NET, controls DO NOT HAVE DEFAULT PROPERTIES.

AW
:O

noted thanks :)
Avatar of Kfkm09

ASKER

So there isn't a way to get the words into Visual Basic using case? The reason I need to use this is because of the way I have written the rest of the program. I would have to change everything really.
Avatar of Kfkm09

ASKER

Thank you so much!