| | |
help me about save and not save text file
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Jul 2007
Posts: 35
Reputation:
Solved Threads: 0
hi .... im having trouble about how to not save text file...
'i create a textfile like this ..'
Set ts2 = fs.CreateTextFile(vtxt & "_" & Format(Date, "ddmmyy") & ".txt")
vsmg = "my text"
ts2.writeline (vsmg)
'call a notepad'
Call Shell("notepad.exe " & (vtxt & "_" & Format(Date, "ddmmyy") & ".txt"), vbNormalFocus)
ok here goes my problem , I want to false the below function but it showed me an error ..... In the other word, I dont wanna my Notepad which contain no error is being saved but ..... pls help me....
If lbl1.Caption = "NoError" Then Set ts2 = fs.CreateTextFile(vtxt & "_" & Format(Date, "ddmmyy") & ".txt") = False
'i create a textfile like this ..'
Set ts2 = fs.CreateTextFile(vtxt & "_" & Format(Date, "ddmmyy") & ".txt")
vsmg = "my text"
ts2.writeline (vsmg)
'call a notepad'
Call Shell("notepad.exe " & (vtxt & "_" & Format(Date, "ddmmyy") & ".txt"), vbNormalFocus)
ok here goes my problem , I want to false the below function but it showed me an error ..... In the other word, I dont wanna my Notepad which contain no error is being saved but ..... pls help me....
If lbl1.Caption = "NoError" Then Set ts2 = fs.CreateTextFile(vtxt & "_" & Format(Date, "ddmmyy") & ".txt") = False
•
•
Join Date: Jul 2007
Posts: 35
Reputation:
Solved Threads: 0
that's the things , how to come out from the creation procedure ? is it easier for me to delete the files that has been created ?
Set ts2 = fs.CreateTextFile(vtxt & "_" & Format(Date, "ddmmyy") & ".txt")
If lbl1.Caption = "No error" Then Set ts2 = fs.DeleteFile(vtxt & "_" & Format(Date, "ddmmyy") & ".txt")
there is an error showing Expected funciton or vairable ..... at fs.DeleteFile . i dont know why ... can u please explain it to me?
Set ts2 = fs.CreateTextFile(vtxt & "_" & Format(Date, "ddmmyy") & ".txt")
If lbl1.Caption = "No error" Then Set ts2 = fs.DeleteFile(vtxt & "_" & Format(Date, "ddmmyy") & ".txt")
there is an error showing Expected funciton or vairable ..... at fs.DeleteFile . i dont know why ... can u please explain it to me?
Hi,
u need not set it to something ts2, just delete it:
There is another way to delete file:
REgards
Veena
u need not set it to something ts2, just delete it:
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
fs.DeleteFile(vtxt & "_" & Format(Date, "ddmmyy") & ".txt")
There is another way to delete file:
Kill (vtxt & "_" & Format(Date, "ddmmyy") & ".txt")REgards
Veena
![]() |
Similar Threads
- Cant readline in text file.... URGENT help~ (VB.NET)
- How to save all search engine results urls in a text file (C)
- save ARRay elements to a file (C++)
- Java multiple text file saving (Java)
- Problems of looping in saving to a text file (C)
- Save a text file in an csv.file with ascii? (PHP)
- IE6 (file/save as) does not save pages correctly on my local disk (Web Browsers)
- Read and write to an ASCII Text file (Java)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Using timer in Class
- Next Thread: Multiline in a list box
| Thread Tools | Search this Thread |
Tag cloud for Visual Basic 4 / 5 / 6
* 6 429 2007 access activex add age append application basic beginner birth bmp calculator cd cells.find click client code college column component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver subroutine table tags textbox time timer urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





