Indexes   

File (Object)

Represents the file object.
Role: The file object allows to manipulate files with UNIX and Windows. Use it instead of the one of Visual Basic to make portable macros. Its gives access to information about the file and can open a file as a TextStream object.

Property Index

Size
Returns the size of the file.
Type
Returns the type of the file.

Method Index

OpenAsTextStream
Opens the file and retrieves it as a TextSteam object.

Properties


o Property Size() As (Read Only)
Returns the size of the file.
Example:
This example retrieves in FileSize the size of the File TestFile.
 Dim FileSize As Long
 FileSize = TestFile.Size
 
o Property Type() As (Read Only)
Returns the type of the file. For instance, if the file has a .txt or .doc extension, its type will be "Text Document".
Example:
This example retrieves in FileType the type of the File TestFile.
 Dim FileType As String
 FileSize = TestFile.Size
 

Methods


o Func OpenAsTextStream( iMode) As
Opens the file and retrieves it as a TextSteam object. Paramater iMode can have the value "ForReading", "ForWriting" or "ForAppending".
Example:
This example opens the file TestFile for reading and retrieves in the text stream TextStr.
 Dim TextStr As CATIATextSteam
 Set TextStr = TestFile.OpenAsTextStream("ForReading")
 

Copyright © 2006, Dassault Systèmes. All rights reserved.