help me about save and not save text file

Reply

Join Date: Jul 2007
Posts: 35
Reputation: coco86 is an unknown quantity at this point 
Solved Threads: 0
coco86 coco86 is offline Offline
Light Poster

help me about save and not save text file

 
0
  #1
Aug 16th, 2007
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
Reply With Quote Quick reply to this message  
Join Date: Nov 2006
Posts: 907
Reputation: QVeen72 is on a distinguished road 
Solved Threads: 132
QVeen72's Avatar
QVeen72 QVeen72 is offline Offline
Posting Shark

Re: help me about save and not save text file

 
0
  #2
Aug 17th, 2007
Hi,

U cant set it to false,
as it is not a proper syntax.
Just dont do anything in If Condition.
Come out of Creation procedure if ur label message is satisfied..

Regards
Veena
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 35
Reputation: coco86 is an unknown quantity at this point 
Solved Threads: 0
coco86 coco86 is offline Offline
Light Poster

Re: help me about save and not save text file

 
0
  #3
Aug 19th, 2007
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?
Reply With Quote Quick reply to this message  
Join Date: Nov 2006
Posts: 907
Reputation: QVeen72 is on a distinguished road 
Solved Threads: 132
QVeen72's Avatar
QVeen72 QVeen72 is offline Offline
Posting Shark

Re: help me about save and not save text file

 
0
  #4
Aug 20th, 2007
Hi,

u need not set it to something ts2, just delete it:

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. fs.DeleteFile(vtxt & "_" & Format(Date, "ddmmyy") & ".txt")

There is another way to delete file:
Kill (vtxt & "_" & Format(Date, "ddmmyy") & ".txt")

REgards
Veena
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 2432 | Replies: 3
Thread Tools Search this Thread



Tag cloud for Visual Basic 4 / 5 / 6
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2010 DaniWeb® LLC