Das Notes Forum

Domino 9 und frühere Versionen => Entwicklung => Thema gestartet von: pippo am 05.04.03 - 15:37:25

Titel: FileSystemObject
Beitrag von: pippo am 05.04.03 - 15:37:25
Hallo Leute,

FileSystemObject ist eine total geile Sache! 8)

nur bei OpenTextFile gibt es mir immer einen Fehler zurück!? ???

Dim fs, a, retstring
Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.OpenTextFile("c:\testfile.txt", ForReading, False)

Kann mir da bitte jemand einen Tipp geben?

Grüße, Pippo
Titel: Re:FileSystemObject
Beitrag von: Axel am 05.04.03 - 18:35:58
Hi,

wie lautet denn die Fehlermeldung.


Ich vermute, dass es sich bei dem Parameter ForReading um eine Konstante handelt und das sie nicht vorhanden ist.

Axel
Titel: Re:FileSystemObject
Beitrag von: Rob Green am 06.04.03 - 22:23:16
Sub OpenTextFileTest
   Const ForReading = 1, ForWriting = 2, ForAppending = 8
   Dim fso, f
   Set fso = CreateObject("Scripting.FileSystemObject")
   Set f = fso.OpenTextFile("c:\testfile.txt", ForWriting, True)
   f.Write "Hello world!"
   f.Close
End Sub

Function ReadTextFileTest
   Const ForReading = 1, ForWriting = 2, ForAppending = 8
   Dim fso, f, Msg
   Set fso = CreateObject("Scripting.FileSystemObject")
   Set f = fso.OpenTextFile("c:\testfile.txt", ForWriting, True)
   f.Write "Hello world!"
   Set f = fso.OpenTextFile("c:\testfile.txt", ForReading)
   ReadTextFileTest = f.Read(5)
End Function

Wo hast Du ForReading bei Dir definiert?
Laut MS KN Base heißt es:
"iomode
Optional. Can be one of three constants: ForReading, ForWriting, or ForAppending. "

Settings
The iomode argument can have any of the following settings:
Constant Value Description
ForReading 1 Open a file for reading only. You can't write to this file.
ForWriting 2 Open a file for writing.
ForAppending 8 Open a file and write to the end of the file.
Titel: Re:FileSystemObject
Beitrag von: pippo am 07.04.03 - 08:17:08
Hallo,

danke für die schnelle Antwort! 8)

Wünsche Euch noch einen schönen Tag

aus Italien,
Pippo