-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathModResources.bas
More file actions
88 lines (71 loc) · 2.13 KB
/
ModResources.bas
File metadata and controls
88 lines (71 loc) · 2.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
Attribute VB_Name = "ModResources"
Option Explicit
'Original Coding by: Solomon Manalo
Public fso As New FileSystemObject
Public itn As Node
Public itm As ListItem
Public Msg, inp As Variant
'Public crypt As New cSimpleCrypt
Public gDataPath As String
Public Const invFileName As String = ".x,/x<x>x?x:x;x'x[x]x{x}x=x*x~x`x" & """"
Public Function DataPath() As String
DataPath = gDataPath
End Function
Public Function OpenFileDoc(LibPath, pathFilename As String) As Boolean
'Dim f As New frmDocument
Dim a As New FileSysObject
If fso.FileExists(LibPath & pathFilename) = False Then
OpenFileDoc = False
Exit Function
End If
OpenFileDoc = True
'f.pathf = pathFilename
'f.Caption = fso.GetFileName(pathFilename)
'f.txtDoc.OpenFile (LibPath & pathFilename)
'f.txtDoc.bChange = False
'f.Show
End Function
Public Function SaveFileDoc(LibPath As String, pathFilename As String, Data As String) As Boolean
'Dim f As New frmDocument
Dim a As New FileSysObject
If fso.FileExists(LibPath & pathFilename) = False Then
SaveFileDoc = False
Exit Function
End If
SaveFileDoc = True
Call SaveFile(LibPath & pathFilename, Data)
End Function
Public Function SaveFileAs(LibPath As String, pathFilename As String, Data As String) As Boolean
'Dim f As New frmDocument
Dim a As New FileSysObject
SaveFileAs = True
Call SaveFile(LibPath & pathFilename, Data)
End Function
Public Function IsNoFileName(tmp As String) As Boolean
If InStr(LCase(Trim(tmp)), "code-file") _
And LCase(Left(tmp, Len("code-file"))) = "code-file" Then
IsNoFileName = True
Else
IsNoFileName = False
End If
End Function
Public Function ValidName(tmp As String) As Boolean
Dim inv() As String
Dim i As Integer
inv = Split(invFileName, "x")
For i = 1 To UBound(inv)
If InStr(tmp, inv(i)) Then
ValidName = False
Exit For
Else
ValidName = True
End If
Next i
End Function
Public Sub HL(txt As TextBox)
With txt
.SelStart = 0
.SelLength = Len(.Text)
.SetFocus
End With
End Sub