An open API service indexing awesome lists of open source software.

https://github.com/HALTEC/VBA-commons-lib

A collection of basic auxiliary classes and modules to complement VBA.
https://github.com/HALTEC/VBA-commons-lib

vba vba-library

Last synced: 4 months ago
JSON representation

A collection of basic auxiliary classes and modules to complement VBA.

Awesome Lists containing this project

README

        

=pod

=encoding utf8

=head1 VBA commons library

Basic auxiliary classes and modules to complement VBA

=head1 DESCRIPTION

This library is a collection of modules and classes to complement VBA. The
library is not intended as a one stop solution for everything VBA. It contains
components for IO, VBA datastructure handling, a C
replacement, testing and some more.

=head2 Constructors

The classes in this package use a uniform, but non-standard mechanism for
constructing objects. Each class is accompanied by a function in the
C module named C which returns a fully
constructed instance of the repective class. These functions may take
parameters. This approach provides a short object creation syntax:

List_create(1, 2, 3).elems ' 3

The mechanism does not primarily rely on the C event. Each
class provides one or more C methods that may take parameters. This
method is responsible for initialization of the class, but not for creating the
object instance itself.
The C function creates a class instance, calls
the C method, forwarding all parameters it got, and returns the
fully initialized instance.

=head2 Classes as Modules

Most of the modules in this library are actually implemented as Classes. The
reason is to not fill up the global function namespace with all the different
function names the modules provide. The functions can still be called without
creating a class instance first by simply writing

ClassName.functionName()

This is made possible using a VB class attribute.

Attribute VB_PredeclaredId = True

When this attribute is attached to a class, VBA automatically creates an
instance of that class on load and all method calls on the class name itself use
that instance.

=head2 Attributes

This library makes use of VB class and method attributes in several places.
These attributes are visible in the exported text files and thus also in this
repository, but the VBA editor hides them, they are simply not visible anymore.
When copying methods and classes textually in the VBA editor these attributes
can get lost. To edit them one has to export the module/class to a text file,
edit the attributes and import the module/class again. Exporting and importing
is done via right mouse button on the class/module in the Project Explorer and
then choosing I.

=head1 CONTENTS

=head2 Arrays

The C module provides functions to deal with array data structures. For
example creating empty arrays or sorting arrays.

=head2 Collections

Auxiliary functions to work with the collection classes of this library
(L, L, ...).

=head2 DevUtils

Functions to help with development of this library itself.

=head2 IO

Simple file IO with good encoding support.

=head2 List

An optionally typed 0-based list implementation.

=head2 Map

An optionally typed map implementation.

=head2 Math

Common operations on numeric values. E.g. C, C, C

=head2 Regexes

Functions to help with using the C class.

=head2 Stringx

Common operations on string values. E.g. C, C, C

=head2 Test

A minimal testing framework.

=head2 Variants

Common operations on C values. E.g. C, C,
C

=head2 XlUtils

Excel specific functions. E.g. C, C,
C

=head1 INSTALLATION

To import all the components of this library into an Excel file one can use the
C function. To use it, just import the C
class manually into the VBA project and then call
C.
This will also automatically add all the necessary references to external
libraries.

Some of these classes depend on others, but to some extent they can be used
independently. So when one only wants a single class or module the easiest way
is to only import that module, try to build and see which modules VBA is
missing.

Especially all the C modules only contain tests and need not be imported.

=head1 LICENSE

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this library except in compliance with the License.
You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

=head1 BUGS AND LIMITATIONS

Please report any bugs or feature requests through the web interface at
L.

=head1 AUTHORS

Patrick Böker C<< >>, originally based on
code by Mathieu Guindon that can be found on
L.

=cut