| 6 |
kaklik |
1 |
VERSION 1.0 CLASS
|
|
|
2 |
BEGIN
|
|
|
3 |
MultiUse = -1 'True
|
|
|
4 |
Persistable = 0 'NotPersistable
|
|
|
5 |
DataBindingBehavior = 0 'vbNone
|
|
|
6 |
DataSourceBehavior = 0 'vbNone
|
|
|
7 |
MTSTransactionMode = 0 'NotAnMTSObject
|
|
|
8 |
END
|
|
|
9 |
Attribute VB_Name = "Opt"
|
|
|
10 |
Attribute VB_GlobalNameSpace = False
|
|
|
11 |
Attribute VB_Creatable = True
|
|
|
12 |
Attribute VB_PredeclaredId = False
|
|
|
13 |
Attribute VB_Exposed = False
|
|
|
14 |
Attribute VB_Ext_KEY = "SavedWithClassBuilder6" ,"Yes"
|
|
|
15 |
Attribute VB_Ext_KEY = "Top_Level" ,"Yes"
|
|
|
16 |
'#####################################################
|
|
|
17 |
'# #
|
|
|
18 |
'# OPT - Trida usnadnujici vstup a vystup do souboru #
|
|
|
19 |
'# by Michal FrdlĂk 2005, verze 1.2 #
|
|
|
20 |
'# #
|
|
|
21 |
'#####################################################
|
|
|
22 |
|
|
|
23 |
|
|
|
24 |
Public Function BasicInputFromFileToOneLine(ByRef Str, Path As String) As Boolean
|
|
|
25 |
On Error GoTo nf
|
|
|
26 |
Dim ofile
|
|
|
27 |
ofile = Path
|
|
|
28 |
wrap$ = Chr$(13) + Chr$(10)
|
|
|
29 |
Open ofile For Input As #1
|
|
|
30 |
Do Until EOF(1)
|
|
|
31 |
Line Input #1, lineoftext$
|
|
|
32 |
alltext$ = alltext$ & lineoftext$
|
|
|
33 |
Loop
|
|
|
34 |
Str = alltext$
|
|
|
35 |
Close #1
|
|
|
36 |
BasicInputFromFileToOneLine = True
|
|
|
37 |
Exit Function
|
|
|
38 |
nf: BasicInputFromFileToOneLine = False
|
|
|
39 |
End Function
|
|
|
40 |
Public Function BasicInputFromFileToMultiLine(ByRef Str, Path As String) As Boolean
|
|
|
41 |
On Error GoTo nf
|
|
|
42 |
Dim ofile
|
|
|
43 |
ofile = Path
|
|
|
44 |
wrap$ = Chr$(13) + Chr$(10)
|
|
|
45 |
Open ofile For Input As #1
|
|
|
46 |
Do Until EOF(1)
|
|
|
47 |
Line Input #1, lineoftext$
|
|
|
48 |
alltext$ = alltext$ & lineoftext$ & wrap$
|
|
|
49 |
Loop
|
|
|
50 |
Str = alltext$
|
|
|
51 |
Close #1
|
|
|
52 |
BasicInputFromFileToMultiLine = True
|
|
|
53 |
Exit Function
|
|
|
54 |
nf: BasicInputFromFileToMultiLine = False
|
|
|
55 |
End Function
|
|
|
56 |
Public Function BasicOutputToFile(Str, Path As String) As Boolean
|
|
|
57 |
On Error GoTo nf
|
|
|
58 |
Dim save$
|
|
|
59 |
Dim hFile As Integer
|
|
|
60 |
save = Str
|
|
|
61 |
hFile = FreeFile
|
|
|
62 |
Open Path For Output As hFile
|
|
|
63 |
Print #hFile, save
|
|
|
64 |
Close hFile
|
|
|
65 |
BasicOutputToFile = True
|
|
|
66 |
Exit Function
|
|
|
67 |
nf: BasicOutputToFile = False
|
|
|
68 |
End Function
|
|
|
69 |
|