-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathmodProjectFiles.bas
83 lines (79 loc) · 3.04 KB
/
modProjectFiles.bas
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
Attribute VB_Name = "modProjectFiles"
Option Explicit
Public Function VBPCode(Optional ByVal ProjectFile As String = "") As String
VBPCode = VBPModules & vbCrLf & VBPForms & vbCrLf & VBPClasses & vbCrLf & VBPUserControls
End Function
Public Function VBPModules(Optional ByVal ProjectFile As String = "") As String
Dim S As String, L As Variant
Dim T As String
Const C As String = "Module="
If ProjectFile = "" Then ProjectFile = vbpFile
S = ReadEntireFile(ProjectFile)
For Each L In Split(S, vbCrLf)
If Left(L, Len(C)) = C Then
T = Mid(L, Len(C) + 1)
If IsInStr(T, ";") Then T = SplitWord(T, 2, ";")
'If IsInStr(LCase(T), "subclass") Then Stop
If LCase(T) = "modlistsubclass.bas" Then GoTo NextItem
VBPModules = VBPModules & IIf(VBPModules = "", "", vbCrLf) & T
End If
NextItem:
Next
End Function
Public Function VBPForms(Optional ByVal ProjectFile As String = "") As String
Const WithExt As Boolean = True
Dim S As String, L As Variant
Dim T As String
Const C As String = "Form="
If ProjectFile = "" Then ProjectFile = vbpFile
S = ReadEntireFile(ProjectFile)
For Each L In Split(S, vbCrLf)
If Left(L, Len(C)) = C Then
T = Mid(L, Len(C) + 1)
If IsInStr(T, ";") Then T = SplitWord(T, 1, ";")
If Not WithExt And Right(T, 4) = ".frm" Then T = Left(T, Len(T) - 4)
Select Case LCase(T)
Case "faxtest": T = "FaxPO"
Case "frmpos": T = "frmCashRegister"
Case "frmposquantity": T = "frmCashRegisterQuantity"
Case "calendarinst": T = "CalendarInstr"
Case "frmedi": T = "frmAshleyEDIItemAlign"
Case "frmpracticefiles": T = "PracticeFiles"
Case "txttextselect": T = "frmSelectText"
End Select
VBPForms = VBPForms & IIf(VBPForms = "", "", vbCrLf) & T
End If
NextItem:
Next
End Function
Public Function VBPClasses(Optional ByVal ProjectFile As String = "", Optional ByVal ClassNames As Boolean = False) As String
Dim S As String, L As Variant
Dim T As String
Const C As String = "Class="
If ProjectFile = "" Then ProjectFile = vbpFile
S = ReadEntireFile(ProjectFile)
For Each L In Split(S, vbCrLf)
If Left(L, Len(C)) = C Then
T = Mid(L, Len(C) + 1)
If IsInStr(T, ";") Then T = SplitWord(T, 2, ";")
VBPClasses = VBPClasses & IIf(VBPClasses = "", "", vbCrLf) & T
End If
NextItem:
Next
If ClassNames Then VBPClasses = Replace(VBPClasses, ".cls", "")
End Function
Public Function VBPUserControls(Optional ByVal ProjectFile As String = "") As String
Dim S As String, L As Variant
Dim T As String
Const C As String = "UserControl="
If ProjectFile = "" Then ProjectFile = vbpFile
S = ReadEntireFile(ProjectFile)
For Each L In Split(S, vbCrLf)
If Left(L, Len(C)) = C Then
T = Mid(L, Len(C) + 1)
If IsInStr(T, ";") Then T = SplitWord(T, 2, ";")
VBPUserControls = VBPUserControls & IIf(VBPUserControls = "", "", vbCrLf) & T
End If
NextItem:
Next
End Function