If I do this I get an error saying expression produces no value.
But this is exactly what I am trying to do.
Main Topics
Browse All TopicsHello,
Here is my little problem. I am tying to figure out a way so that when someone puts a certing symbol in a textbox upon pressing a button that symbol turns into a string and is inserted into the string they already entered.
Ex.
If I write "Hello (%) How are you" I would like the (%) to be converted into "Hello GetName(Player) How are you" when it is outputted into a text file.
(%) = GetName(Player)
This is the part of my code where it reads the textbox:
sw.WriteLine(vbTab & vbTab & vbTab & "Say(QuestGiver, " & Chr(34) & txtQuestAccSay.Text & Chr(34) & Chr(41))
sw is my StreamWriter
Sorry is this is a newb question im still learning.
Thank you
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Thank you both the reason why I got the expression error was because I was importing system.io.file when I should have not.
When I use either code that you guys gave me though it will output twice in the text file just like this:
"Hello (%)"
"Hello GetName(Player)"
How Would I get it to stop doubling again thank you.
Business Accounts
Answer for Membership
by: CraigLazarPosted on 2009-04-05 at 22:27:33ID: 24074500
Hi,
If i understand your question, u can use the replace statement to do this fot u.
dim tmpStr as string
ex. tmpstr = replace(textbox1,"(%)","Ge tName(Play er)")
What this function does is it takes the source string as paramter 1, then the value u want to replace as 2nd paramter, then the 3rd paramter is what u want to replace it with.
sw.WriteLine(vbTab & vbTab & vbTab & "Say(QuestGiver, " & Chr(34) & replace(txtQuestAccSay.Tex t,"(%)","G etName(Pla yer)") & Chr(34) & Chr(41))
hope this helps