Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > General > Help??


Reply
 
Thread Tools Display Modes
  #1  
Old 09-28-2002, 10:40 AM
vbnewbie2002
Guest
 
Posts: n/a
Default Help??


Ok im a real newbie and i have a question but u will have 2 explain as best as possible k? Ok is there a way that i could enter works into a text file and then say save the file as e.g test.txt the when i open my program and type some words into a text box as i type the text box would wait for a work i entered and replace it with a differnt 1 e.g the text file could look like this hello - hi then when i type hello im my text file in my program it would change to hi but i want to do this with as many words as possible... Thanks Me!..
Reply With Quote
  #2  
Old 09-28-2002, 10:48 AM
crabby's Avatar
crabby crabby is offline
mostly gone

Retired Moderator
* Expert *
 
Join Date: Aug 2002
Location: London / UK
Posts: 2,721
Default

if you know the words try replace or replace$
__________________
there are always two sides of a story and 12 ways to sing a song or write some code. so whats wrong ?

Avatar by lebb
Reply With Quote
  #3  
Old 09-28-2002, 10:50 AM
vbnewbie2002
Guest
 
Posts: n/a
Default

?? Im a newbie i dont quite understand.. P.s how would i get it 2 read from the .txt file aswel?? thanks....
Reply With Quote
  #4  
Old 09-28-2002, 11:05 AM
crabby's Avatar
crabby crabby is offline
mostly gone

Retired Moderator
* Expert *
 
Join Date: Aug 2002
Location: London / UK
Posts: 2,721
Default

Text1.Text = Replace$(Text1.Text, "old word", "new word")
__________________
there are always two sides of a story and 12 ways to sing a song or write some code. so whats wrong ?

Avatar by lebb
Reply With Quote
  #5  
Old 09-28-2002, 11:25 AM
Iceplug's Avatar
Iceplug Iceplug is offline
MetaCenturion

Retired Moderator
* Guru *
 
Join Date: Aug 2001
Location: California, USA
Posts: 16,583
Default

To read from the text file, try this:

Open "yourtextfile" For Input As #1
Line Input #1, ReadStr
Close #1

you will probably need to read each line into an array.
__________________

Iceplug, USN
Quadrill 1 Quadrill 2 (full) Quadrill 3 JumpCross .NET Website is ALIVE! - DL Platform Tour for VB.NET! Posting Guidelines Hint: Specify your location in your user cp profile if you want compassion!
Reply With Quote
  #6  
Old 09-28-2002, 12:00 PM
vbnewbie2002
Guest
 
Posts: n/a
Default

????
Reply With Quote
  #7  
Old 09-28-2002, 12:03 PM
vbnewbie2002
Guest
 
Posts: n/a
Default

morsnowski would the text1.replace thing work? I didnt think it would case it would be readin off a textfile????
Reply With Quote
  #8  
Old 09-28-2002, 12:04 PM
JDT JDT is offline
Original Contributor

Retired Moderator
* Guru *
 
Join Date: Jan 2001
Location: Watch Window
Posts: 2,781
Default

Try taking these examples and adding them to your code or start a new project so you can test them and see how they work. This is just about the only way to learn and understand VB.
__________________
JDT
Reply With Quote
  #9  
Old 09-28-2002, 12:07 PM
crabby's Avatar
crabby crabby is offline
mostly gone

Retired Moderator
* Expert *
 
Join Date: Aug 2002
Location: London / UK
Posts: 2,721
Default

sorry sometimes i'm a little confused ok so read you text file into an array and check in then. and just play around thats the funniest way to learn
__________________
there are always two sides of a story and 12 ways to sing a song or write some code. so whats wrong ?

Avatar by lebb
Reply With Quote
  #10  
Old 09-28-2002, 12:07 PM
vbnewbie2002
Guest
 
Posts: n/a
Default

OK then
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->