Subversion Repositories svnkaklik

Rev

Blame | Last modification | View Log | Download

VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "Opt"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Attribute VB_Ext_KEY = "SavedWithClassBuilder6" ,"Yes"
Attribute VB_Ext_KEY = "Top_Level" ,"Yes"
'#####################################################
'#                                                   #
'# OPT - Trida usnadnujici vstup a vystup do souboru #
'# by Michal FrdlĂ­k 2005, verze 1.2                  #
'#                                                   #
'#####################################################


Public Function BasicInputFromFileToOneLine(ByRef Str, Path As String) As Boolean
On Error GoTo nf
Dim ofile
ofile = Path
wrap$ = Chr$(13) + Chr$(10)
Open ofile For Input As #1
Do Until EOF(1)
    Line Input #1, lineoftext$
    alltext$ = alltext$ & lineoftext$
Loop
Str = alltext$
Close #1
BasicInputFromFileToOneLine = True
Exit Function
nf:    BasicInputFromFileToOneLine = False
End Function
Public Function BasicInputFromFileToMultiLine(ByRef Str, Path As String) As Boolean
On Error GoTo nf
Dim ofile
ofile = Path
wrap$ = Chr$(13) + Chr$(10)
Open ofile For Input As #1
Do Until EOF(1)
    Line Input #1, lineoftext$
    alltext$ = alltext$ & lineoftext$ & wrap$
Loop
Str = alltext$
Close #1
BasicInputFromFileToMultiLine = True
Exit Function
nf:    BasicInputFromFileToMultiLine = False
End Function
Public Function BasicOutputToFile(Str, Path As String) As Boolean
On Error GoTo nf
Dim save$
Dim hFile As Integer
save = Str
hFile = FreeFile
Open Path For Output As hFile
Print #hFile, save
Close hFile
BasicOutputToFile = True
Exit Function
nf:    BasicOutputToFile = False
End Function