|
-
Jun 17th, 2002, 08:36 AM
#1
Thread Starter
Member
Newbee Question
I currently program in VB and need to do some VBS. The major question is opening and writing files. In VB I have to use an OPEN statement, but in VBS all it seems you have to do is the following:
Set logfile = FSO.OpenTextFile("\\myDrive\reskit$\logpw.txt", 8, 0)
logfile.Write Date & "," & Time & "," & localMach & ",PW change 2 failure" & vbNewLine
logfile.Close
Is the Set command opening the file or just reserving the file name? I need to have several computer writing to this log file at a time.
Thanks for the information.
Jim
-
Jun 18th, 2002, 03:48 AM
#2
The OpenTextFile returns a textstream object
You assign an object to an object variable
with the Set statement:
Set variable = object
-
Jun 18th, 2002, 08:16 AM
#3
Thread Starter
Member
DeadEyes,
Thank you for the information. One more question. When is the file actually OPEN for writing. Under VB, the file is open with the "OPEN filename AS OUTPUT". Is this the same for VBS or it only opens the file when you do the myfilename.write?
Thanks again.
Jim
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|