Writing Variable Values to Text Files 
Author Message
 Writing Variable Values to Text Files

How do you send array variable values to a textfile?

I tries to use this code:

    FSO.WriteLine(ArrayName(1))

...but it doesn't seem to work.

Thanks. -->Apple



Fri, 27 Jun 2003 14:44:23 GMT  
 Writing Variable Values to Text Files
You have to enumerate the values:

FSO.WriteLine(GetLine(ArrayName(1)))

Function GetLine(Values)
    Dim Value, Out
    For Each Value in Values
      Out = Out & "," & Value
    Next
   GetLine = Out
End

    I have wrote object, which lets you write variable number of values or
arrays to a script file. The object name is Active LogFile. See
http://www.pstruh.cz/help/ScptUtl/cm292.htm

Antonin Foller
PSTRUH Software
http://www.pstruh.cz


Quote:
> How do you send array variable values to a textfile?

> I tries to use this code:

>     FSO.WriteLine(ArrayName(1))

> ...but it doesn't seem to work.

> Thanks. -->Apple



Fri, 27 Jun 2003 02:39:49 GMT  
 Writing Variable Values to Text Files
The FileSystemObject does not itself have A WriteLine method.  You first
need to use one of the text file oriented methods (CreateTextFile or
OpenTextFile) to get a TextStream object opened for output.  It's the
TextStream object that has read/write methods...

FileSystemObject User's Guide
http://msdn.microsoft.com/scripting/VBScript/doc/jsFSOTutor.htm

The EXE links below are downloads of the complete documentation sets in
HTMLHelp format - highly recommended for offline use.  The Tutorial and
"...User's Guide" content is also included in the downloaded
documentation...

WSH 2.0 Tutorial
http://msdn.microsoft.com/scripting/windowshost/doc/wsTutorialTOC.htm
WSH Documentation
http://msdn.microsoft.com/scripting/windowshost/docs/reference/defaul...
http://msdn.microsoft.com/scripting/windowshost/wshdoc.exe

VBScript User's Guide
http://msdn.microsoft.com/scripting/vbscript/doc/vbstutor.htm
VBScript Documentation
http://msdn.microsoft.com/scripting/vbscript/techinfo/vbsdocs.htm
http://msdn.microsoft.com/scripting/vbscript/download/vbsdoc.exe

FileSystemObject User's Guide
http://msdn.microsoft.com/scripting/vbscript/doc/jsFSOTutor.htm
VBScript Run-Time Library Reference [FileSystemObject/Dictionary]
http://msdn.microsoft.com/scripting/vbscript/doc/VBSFSOTOC.htm

JScript User's Guide
http://msdn.microsoft.com/scripting/jscript/doc/jsconJScriptUsersGuid...
JScript Documentation
http://msdn.microsoft.com/scripting/jscript/techinfo/jsdocs.htm
http://msdn.microsoft.com/scripting/jscript/download/jsdoc.exe

WSC Tutorial
http://msdn.microsoft.com/scripting/scriptlets/doc/lettitle.htm
WSC Documentation
http://msdn.microsoft.com/scripting/scriptlets/serverdocs.htm
http://msdn.microsoft.com/scripting/scriptlets/wscdoc.exe

--
Michael Harris
Microsoft.MVP.Scripting
--

Please do not email questions - post them to the newsgroup instead.
--


Quote:
> How do you send array variable values to a textfile?

> I tries to use this code:

>     FSO.WriteLine(ArrayName(1))

> ...but it doesn't seem to work.

> Thanks. -->Apple



Fri, 27 Jun 2003 07:44:46 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Writing a Non-Text Value to File

2. passing variables from a text box to a document.write text box

3. Set a text file as variable value

4. writing to text file, control array names and values

5. Reading from a text file and writing toa text file from Vis Bas 6.0

6. Write contents of listbox to text file/populate listbox from text file

7. Writing comma delimited text files using double quotes - Write Statement

8. Reading text from a text file into a variable

9. Value single line text box with variable containing special characters

10. Value of a text box to a variable

11. Needed text box for text written from write to left

12. vb6-SQL value gets truncated in HTML text box via webclass response.write

 

 
Powered by phpBB® Forum Software