
File1.Open newbie problem
Did you place the file control on your form?
You can also create the file control programmatically:
Dim File1
File1 = CreateObject("FILECTL.File")
Also you need to define fsAppendMode
Place this in a module:
' --------------------------------------------------------------------------
---
' File/FileSystem Control
' --------------------------------------------------------------------------
---
' File Mode
Const fsModeInput = 1
Const fsModeOutput = 2
Const fsModeRandom = 4
Const fsModeAppend = 8
Const fsModeBinary = 32
' File Access Type
Const fsAccessRead = 1
Const fsAccessWrite = 2
Const fsAccessReadWrite = 3
' File Lock Mode
Const fsLockReadWrite = 0
Const fsLockWrite = 1
Const fsLockRead = 2
Const fsLockShared = 3
' File Attributes
Const fsAttrNormal = 0
Const fsAttrReadOnly = 1
Const fsAttrHidden = 2
Const fsAttrSystem = 4
Const fsAttrVolume = 8
Const fsAttrDirectory = 16
Const fsAttrArchive = 32
Brian Crosby
Quote:
> I'm not sure why the following routine does not work. I get the error
> "variable not defined: File1"
> Private Sub submit_Click()
> File1.Open "Test.txt", fsAppendMode
> File1.LinePrint "Hello world"
> File1.Close
> End Sub
> Am I missing some declarations or other initiating code ?
> Thanks