Tech Support Forums - TechIMO
Tech Support Forums - TechIMO
http://www.techimo.com/forum/webmastering-programming/150226-how...
Remember Me?
How to create, edit, and delete a text file using Visual Basic 6? How to create, edit, and delete a text file using Visual Basic 6?
Register Blogs FAQ Members List Calendar
Advanced Search
Reply
How to create, edit, and delete a text file using Visual Basic 6?
Thread Tools Search this Thread
Discussions: 223,064, Posts: 2,625,883, Members: 276,946 #1 (permalink) Question How to create, edit, and delete a text file using Visual Basic 6?
Acid_ICE24
Member Acid_ICE24's Avatar Join Date: Jul 2005 Location: Cavite, Phil. Posts: 94
Unlimited Online Backup Backup your whole computer for just $7.95/month. No limits, 100% safe.
www.livedrive.com
Ads by Google
PowerBasic vs VisualBasic
www.powerbasic.com
PowerBasic vs VisualBasic Faster. No Run-Times. No Bloat!CGI, Macros, ASM, Reg Expressions hi pips! i'm working on a vb6 project right now and there's a part in it where i need to create a log file. anybody knows how 2 create a text file and then later on, edit or delete it? i made some research and this is what i produced, so far: Sub GenerateLog(vValue As Variant, sField As String) Dim iFileNumber As Integer Static iErrCtr As Integer iErrCtr = iErrCtr + 1 iFileNumber = FreeFile Open App.Path & "\HCFA_LOG.txt" For Append As #iFileNumber If bLogCreated = False Then Write #iF ileNumber, "DATE: " & Format(Date, "MM/dd /yyyy") Write #iFileNumber,
AdChoices
Ask a Tech Question (free)!
Most Active Discussions
Is It Just Me? (641) Let's be real - who are you voting .. (19) Help! (17) Obama Campaign in Ohio Sues to Bloc.. (31) Just some thoughts (42) Lag...don't know why!! (11) Can I replace an ATI Gfx card with .. (5) Disable JAVA Now - 0-day exploit hi.. (14) F@H **Official** SPAM Thread Episod.. (292) graphic card & mobo (8) Which one is better: GT 620M or Rad.. (5 )
Recent Discussions
order cheap accutane Stanley (0) Help! (17) Just some thoughts (42) Analyze your Facebook data with new W.. (1 ) Help with Windows Media Player (1) new gmail address (2) Can I replace an ATI Gfx card with nV.. (5) 4Gbs of Memory Installed Only 2Gbs Sh.. (3) Install SP1 without internet (12) Lag...don't know why!! (11) Disable JAVA Now - 0-day exploit hits.. (14) Acer & linux (4 ) change router password.. (3)
1 trong 4
9/2/2012 5:36 AM
How to create, edit, and delete a text file using Visual Basic 6? - Tech Su...
http://www.techimo.com/forum/webmastering-programming/150226-how...
"TIME: " & Format(Time, "hh:mm AMPM") Write #iFileNumber, Write #iFileNumber, End If bLogCreated = True Write #iFileNumber, "Error #: " & iErrCtr Write #iFileNumber, "GUID: " & sDocGUID Write #iFileNumber, "Error in field: '" & sField & "'" Write #iFileNumber, "Data: " & vValue Write #iFileNumber, Close #iFileNumber End Sub this works fine but i don't really like how the output looks (notice the quotation marks?). and everytime i call this sub, it doesn't overwrite the old one. any kind of help is welcome.... thanks!
Useful apps (42) Java casting... (6) Totally Awesome Battlefield 3 Case Mo.. (4) F@H **Official** SPAM Thread Episode .. (292 ) Video (1) Computer issue - Please help (4) Need help on what monitor cable I nee.. (3) graphic card & mobo (8) Samsung Harddrive Problem (2) Upgrading graphics in Inspiron 660s (1) Which one is better: GT 620M or Radeo.. (5) save aol mail attachments (3)
Embedded Developer
www.embeddeddeveloper.com Embedded Developer Find Compare Buy Processors & ToolsParametric Database, Ordering Info
Ads by Google
Attached Files File Type: HCFA_LOG.txt (1.3 KB, 4790 views) txt
2 trong 4
9/2/2012 5:36 AM
How to create, edit, and delete a text file using Visual Basic 6? - Tech Su...
http://www.techimo.com/forum/webmastering-programming/150226-how...
#2 (permalink)
Acid_ICE24
Member Acid_ICE24's Avatar Join Date: Jul 2005 Location: Cavite, Phil. Posts: 94
anybody?
Ads by Google
Acid_ICE24 is offline
Old August 26th, 2005, 12:13 PM
Iturea
Banned Iturea's Avatar Join Date: Jan 2004 Location: Earth Posts: 420
Iturea is offline
Old August 27th, 2005, 02:08 AM
Acid_ICE24
Member Acid_ICE24's Avatar Join Date: Jul 2005 Location: Cavite, Phil. Posts: 94
Acid_ICE24 is offline
Old August 14th, 2008, 04:27 AM
kid_headshot
Junior Member Join Date: Aug 2008 Posts: 1
Ahh, I recently had the same problem as you, but in reverse. I wanted to add data to my file every time, without overwriting what data already existed, as I was making a highscores list. I was using the "OUTPUT" command instead of the "APPEND". If you're making a log file, you want the "OUTPUT" command. Just replace the word "APPEND" with "OUTPUT". However, for the output command, your log file, HCFA_LOG.txt will need to already exist. If this is a problem, then perhaps you could use APPEND but also use the "kill" command to delete your text file upon opening your program each time? EDIT: Oh yeah, and if you don't like the look of that the "write" command produces, use the "print" command in place of it. The print command doesn't store any data about strings or
3 trong 4
9/2/2012 5:36 AM
How to create, edit, and delete a text file using Visual Basic 6? - Tech Su...
http://www.techimo.com/forum/webmastering-programming/150226-how...
variables of any kind, so there are no quotations to separate variables. So, if it's just for the sake of its looks, use print.
Last edited by kid_headshot : August 14th, 2008 at 04:31 AM. Reason: Adding more to my answer
kid_headshot is offline
Reply
Similar Threads
Thread Visual Basic Help? HELP!! - Visual Basic Scan Text (Visual Basic .NET question) Visual Basic .Net - DLL file question Visual Basic HELP!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Thread Starter redfoxstorm darssus firewolf firewolf George VII Forum Webmastering and Programming Webmastering and Programming Applications and Operating Systems Applications and Operating Systems Webmastering and Programming Replies 1 1 2 15 8 Last Post February 14th, 2005 10:39 AM October 6th, 2004 01:40 PM October 4th, 2003 02:23 PM September 17th, 2003 10:25 PM May 18th, 2002 05:46 PM
All times are GMT -4. The time now is 07:36 AM. TechIMO Copyright 2012 All Enthusiast, Inc. Contact Us - Tech Support Forums - TechIMO.com - Archive - Privacy Statement - Terms of Use Coupons and Deals and Dealighted - Store Ratings, Avoid Scam Businesses - Top
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
4 trong 4
9/2/2012 5:36 AM