• Welcome to Jose's Read Only Forum 2023.
 

ITextStream.Column Property

Started by José Roca, July 13, 2008, 11:47:12 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

José Roca



The following example illustrates the use of the Column property.

JScript


function GetColumn()
{
   var fso, f, m;
   var ForReading = 1, ForWriting = 2;
   fso = new ActiveXObject("Scripting.FileSystemObject");
   f = fso.OpenTextFile("c:\\testfile.txt", ForWriting, true);
   f.Write("Hello World!");
   f.Close();
   f = fso.OpenTextFile("c:\\testfile.txt", ForReading);
   m = f.ReadLine();
   return(f.Column);
}


VBScript


Function GetColumn
   Const ForReading = 1, ForWriting = 2
   Dim fso, f, m
   Set fso = CreateObject("Scripting.FileSystemObject")
   Set f = fso.OpenTextFile("c:\testfile.txt", ForWriting, True)
   f.Write "Hello world!"
   f.Close
   Set f = fso.OpenTextFile("c:\testfile.txt", ForReading)
   m =   f.ReadLine
   GetColumn = f.Column
End Function


PowerBASIC


FUNCTION GetColumn () AS LONG

   LOCAL fso AS IFileSystem
   LOCAL f AS ITextStream
   LOCAL m AS STRING

   fso = NEWCOM ("Scripting.FileSystemObject")
   f = fso.OpenTextFile(UCODE$("c:\testfile.txt"), %IOMode_ForWriting, %VARIANT_TRUE)
   f.Write UCODE$("Hello world!" )
   f.Close
   f = fso.OpenTextFile(UCODE$("c:\testfile.txt"), %IOMode_ForReading)
   m = f.ReadLine
   FUNCTION = f.Column
   f.Close

END FUNCTION