-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME.html
More file actions
178 lines (146 loc) · 8.99 KB
/
Copy pathREADME.html
File metadata and controls
178 lines (146 loc) · 8.99 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
<head><title> BadAss Library project documentation. </title></head>
<p>README - BadAss Library project documentation.<br>
12/16/25. wmk.</p>
<h3>Modification History.</h3>
<p>12/16/25. wmk. Runtime Error Handling section added.
12/16/25. wmk. (automated) Modification History sorted.</p>
<pre><code>
12/16/25. wmk. .md additional formatting.
1/11/24. wmk. Updated for Accounting/BadAss *git project.
11/5/22. wmk. Project Overview section updated.
10/23/22. wmk. Project Overview section documentation.
8/23/22. wmk. original document.
</code></pre>
<h3 id="IX">Document Sections.</h3>
<pre><code><a href="#1.0">link</a> 1.0 Project Overview - overall project description.
<a href="#2.0">link</a> 2.0 Project Files - files comprising the project.
<a href="#3.0">link</a> 3.0 Build Process - step-by-step library build instructions.
<a href="#4.0">link</a> 4.0 Runtime Error Handling.
</code></pre>
<!--============================================================================-->
<h3 id="1.0">1.0 Project Overview.</h3>
<p>The BadAss project contains all files that Calc or Excel need in order
to build the BadAss library for either app. The primary files required
for building the library are in the project folder. The individual macros'
source code is in the subfolders /Module1 and /Module2, and /Dialogs.</p>
<p>The /BadAss folder within the project is the current BadAss Library exported from
Calc. For now, the "build" process does not touch that folder. Any build of the
BadAss Library from the Geany project builds the resultant Module1 or Module2
.xba file in the src/Releae folder folder. This provides a level of separation
where any new build is separated from the existing library code.</p>
<p>In other words, the /BadAss folder is used for "export" operations from Calc
back into the *git project. The folder /BadAss/Release is used for "import"
operations to Calc for testing/integrating new code. Once the code has been
tested, it should then be exported to the /BadAss parent folder completing the
cycle.</p>
<p>The EditBas geany project is used for extracting, modifying, and re-integrating
macros within the BadAss Calc library. It uses its own shells in addition to
those defined in the Accounting/BadAss/Procs-Dev folder. The EditBas project is
managed from the Accounting/BadAss/Projects-Geany folder.</p>
<p>The library .xba files that contain all of the formalized macro definition
code may be built from the source code files by using the <em>make</em> utility.
The makefile for the build is <em>MakeBadAssLibrary.tmp</em> which is modified
by a DoSed.sh shell prior to executing the build.<br>
<strong>Caution:</strong> The library .xba or .dlg files may be overwritten by exporting
the running library from the Calc Macros/Organizer. This will make the "build"
source .bas files out-of-date with the running library. Whenever this is
done it will be necessary to re-sync the .bas source files to the code that
was exported into the .xba files for the build process to correctly regenerate
the library code.
<br><a href="#IX">Index</a>
<!--============================================================================--></p>
<h3 id="2.0">2.0 Project Files.</h3>
<p>The files fall into 4 categories:
1) macro source code, 2) dialog source files, 3) library definition files,
4) library Build files.</p>
<p><b>Macro Source Code.</b>
The macro source code for the library is spread across multiple Basic source code
files having the <em>.bas</em> file extension. This allows for easy maintenance of each
macro without having to edit in either the Calc or Excel app macro interface. The
<em>.bas</em> files are Basic code files without any XML markup (as needed by a "loaded"
library in the spreadsheet apps). Each module <module-name> has its source code
stored in its own BadAss/< module-name > folder.</p>
<p>The actual library source code that gets installed into the apps with the >macros>Organizer
extension is in "module" files that are collections of <em>.bas</em> files organized into
single files that are in XML Basic markup language. These files follow the naming
convention <em>< module-name >.xba</em>. They have an XML markup header preceding the Basic
code, and an XML markup footer following the Basic code. The Basic code within the
<em>.xba</em> file is recognizable, but has special characters "marked up" with XML coding
(e.g. the apostrophe (') character is marked up as (&)apos;). A shell utility is
provided that converts between the <em>.xba</em> file format and the <em>.bas</em> file format
for ease of editing.</p>
<p>The files XBAHeader.txt and XBAFooter.txt are stored with the project to provide
the Build process with the appropriate XML code wrapper for the <em>.xba</em> file that
the <em>make</em> utility creates for the BadAss library. <em>< module-name ></em> is edited into
the XBAHeader.txt file XML so the resultant .xba is properly tagged.</p>
<p><b>Dialog Source Files.</b>
The dialog source files are stored in folder BadAss/Dialogs. All dialog source files
have the <em>.xdl</em> filename extension. There is no <em>frame</em> interface for interactively
editing dialogs outside of Calc. The dialog source files stored in BadAss/Dialogs
are images of the *WINGIT_PATH/Libraries-Project/BadAss/*.xdl files. All editing
of the <em>.xdl</em> files is done interactively within the Calc/Edit Macros facility.</p>
<p>The <em>.xdl</em> files are XML DOCTYPE dlg:Window markup files. It is possible to make
manual changes to the .xdl files within the BadAssLibrary/Dialogs folder using
an editor. The CopyToGit.sh shell file may be used to copy the ./Dialogs folder
to the *WINGIT_PATH/Libraries-Project/BadAss *.xdl files. All bets are off
if this is done, as the editing is much easier performed in the graphic environment
of the Calc/Edit Macros tools.</p>
<p><b>Library Definition Files.</b>
The library definition files are stored in the BadAss project folder. These files have
the filename extensions <em>.xlb</em> and <em>.xlc</em>.<br><a href="#IX">Index</a></p>
<p><b>Library Build Files.</b>
The library build files are stored in the BadAss project folder. These files are
of multiple types with filenames <i>Make*</i>, *.sh, *.txt and are used by the utility
apps <em>make</em>, <em>sed</em>, and <em>awk</em>.<br><a href="#IX">Index</a>
<br><a href="#IX">Index</a>
<!--============================================================================--></p>
<h3 id="3.0">3.0 Build Process.</h3>
<p><br><a href="#IX">Index</a>
<!--============================================================================--></p>
<h3 id="4.0">4.0 Runtime Error Handling.</h3>
<p>The BadAss library contains a full complement of error handling macro
definitions that may be invoked at any point in runtime macro execution. This
allows for any workbook to have an active "ErrorLog" worksheet into which
runtime error messages may be recorded. In addition most macros within the
BadAss library contain an "ON ERROR GOTO" statement along with two labels
"NormalExit:" and "ErrorHandler:" for trapping errors.</p>
<p><strong>ON ERROR GOTO Handling.</strong><br></p>
<p><strong>Error Log Usage.</strong><br>
The following support subs are provided for Module error logging:</p>
<pre><code>
ErrLogDisable.bas - Disable error logging.
ErrLogGetCellInfo.bas - Get cell information for error log entry.
ErrLogGetCellName.bas - Get cell name for error log entry.
ErrLogGetDisplay.bas - Get msgBox error messaging on/off status.
ErrLogGetRecording.bas - Get error recording status from error log globals
ErrLogGetSheet.bas - Get sheet index from error log globals.
ErrLogMakeEntry.bas - Make entry into error log sheet.
ErrLogSetCellInfo.bas - Set cell information for error log entry.
ErrLogSetDisplay.bas - Set msgBox error messaging on/off.
ErrLogSetModule.bas - Set module name for error log entry.
ErrLogSetRecording.bas - Set error log recording status.
ErrLogSetSheet.bas - Set sheet index in error log globals..
ErrLogSetup.bas - Set up error logging to ERRLOGSHEET..
</code></pre>
<p>Within the BadAss module header, ERRLOGSHEET is a constant set to the string
"ErrorLog". This is the sheet to which error log messages will be written. The
messages appear in reverse chronological order, with the latest messages
occurring first.</p>
<p>Following is the minimum sequence of calls for issuing an error message to the
message log:</p>
<pre><code>
dim Doc As Object
dim oSel As Object
dim oRange As Object
Doc = ThisComponent
oSel = Doc.getCurrentSelection() 'apos;// get current cell selection(s) info
oRange = oSel.RangeAddress 'apos;// extract range information
Call ErrLogSetup(oRange, "< macro name >")
Call LogError("TESTERROR", "Test sub E - error.")
Call ErrLogDisable
</code></pre>
<p>Explanation: var oRange is set to the current cell selection, which contains the
sheet index and selected cells information. "TESTERROR" is the error type name.
The second parameters within quotes are the sub/function name, and the error
message text to be issued to the ErrLog sheet.
<br><a href="#IX">Index</a></p>