Code Catalog for Access / VBA - Making Code Sharing Easy (2 Viewers)

Back in the early 2000s I documented my code with something that looked like this (or was this actually). IIRC it was supposed to be used by a program that would grab the comments and build a document for the class. Does anyone know about this thing? If it ever existed?

Option Compare Database
Option Explicit
'.=========================================================================
'.Copyright 2004 Colby Consulting. All rights reserved.
'.Phone :
'.E-mail : jcolby@colbyconsulting.com
'.=========================================================================
' DO NOT DELETE THE COMMENTS ABOVE. All other comments in this module
' may be deleted from production code, but lines above must remain.
'--------------------------------------------------------------------------
'.Description :
'.
'.Written By : John W. Colby
'.Date Created : 03/27/2004
' Rev. History :
'
' Comments :
'.-------------------------------------------------------------------------
'.
' ADDITIONAL NOTES:
'
'The process of troubleshooting unload problems requires tools to track the
'loading and unloading of the class instances. This class is a Service class
'with two collections and a bunch of methods to assist the developer in tracking
'class instance load / unload.
 
Last edited:
IIRC it was supposed to be used by a program that would grab the comments and build a document for the class. Does anyone know about this thing? If it ever existed?
I know doxygen and Natural Docs.
 
@Edgar_ :
But working with a code sharing tool like this feels different.

I'll have to see if and how I deal with it. So far I've been able to do without it.

@Isaac:
You want it to help you remember what it means once you're 3 pages down from the declarations area.

There is no 'declarations area' in my codes. I do not declare variables in the head of a procedure, but where I need them for the first time.

@jwcolby54:
I more care about "hungarian" notation. I like being able to read the variable name and know I need to place a double in a dblVariable. Or a recordset in a rstVariable.

lngMyLong
strMyString
varMyVariiant
dblMyDouble
Etc.

This is not hungarian notation, its the misunderstood hungarian notation.
This is worth reading: https://www.joelonsoftware.com/2005/05/11/making-wrong-code-look-wrong/


But that all are other topics and I don't want to spam the thread with off-topic. Sorry @Josef P. ;)
 
I'll have to see if and how I deal with it. So far I've been able to do without it.
Comfort quickly becomes the norm. ;)


Who knows this procedure:
Initial situation: A sample file (accdb) contains the required code modules.

Now you go to your application, click on Import external data, select the sample file, go to Modules, click on the required modules and import them.
Then you realize: “The function abc is missing.”, go to the sample application, check in which module this function is located and import the module into your application.

... I didn't want that, so I created an add-in and code modules that provide information about their dependencies. :)
The next step would now be to be able to use not only my repository but also different sources.
 
Last edited:
Sorry for being thick, but we already have a Code Repository and Sample DB forum. Is the suggestion to somehow cataloged this to make it more easy to find?
 
Note:
I am also expanding my existing add-in with some features that I can also use without a "catalog".

New:
Package tag: only the content of the file is read, but it is not imported
Use tag extended: you can now directly enter a GitHub reference to a code module.

Examples:

VBA-JSON package:
XML:
<codelib>
  <package>VBA-JSON</package>
  <description>JSON conversion and parsing for VBA (https://github.com/VBA-tools/VBA-JSON)</description>
  <use>%GITHUB%:VBA-tools/VBA-JSON@master/JsonConverter.bas</use>
</codelib>

VBA-MicrosoftGraph package:
XML:
<codelib>
  <package>VBA-MicrosoftGraph</package>
  <description>VBA-MicrosoftGraph makes working with the Microsoft Graph WEB API from VBA easier. (https://github.com/mbarnesatbbs/VBA-MicrosoftGraph)</description>
  <use>%GITHUB%:mbarnesatbbs/VBA-MicrosoftGraph@master/Src/AttachmentHelpers.bas</use>
  <use>%GITHUB%:mbarnesatbbs/VBA-MicrosoftGraph@master/Src/Dictionary.cls</use>
  <use>%GITHUB%:mbarnesatbbs/VBA-MicrosoftGraph@master/Src/Graph.bas</use>
  <use>%GITHUB%:mbarnesatbbs/VBA-MicrosoftGraph@master/Src/TimeZoneHelpers.bas</use>
  <use>%GITHUB%:mbarnesatbbs/VBA-MicrosoftGraph@master/Src/WebClient.cls</use>
  <use>%GITHUB%:mbarnesatbbs/VBA-MicrosoftGraph@master/Src/WebHelpers.bas</use>
  <use>%GITHUB%:mbarnesatbbs/VBA-MicrosoftGraph@master/Src/WebRequest.cls</use>
  <use>%GITHUB%:mbarnesatbbs/VBA-MicrosoftGraph@master/Src/WebResponse.cls</use>
  <use>%GITHUB%:mbarnesatbbs/VBA-MicrosoftGraph@master/authenticators/GraphAuthenticator.cls</use>
  <use>%GITHUB%:mbarnesatbbs/VBA-MicrosoftGraph@master/authenticators/IWebAuthenticator.cls</use>
  <use>%GITHUB%:mbarnesatbbs/VBA-MicrosoftGraph@master/authenticators/OAuth2Authenticator.cls</use>
  <ref><name>MSXML2</name><major>6</major><minor>0</minor><guid>{F5078F18-C551-11D3-89B9-0000F81FE221}</guid></ref>
</codelib>
<ref>..</ref> set the reference to MSXML2.

In principle, this would make it possible to test the import of a package.
 
@Edgar_ :


I'll have to see if and how I deal with it. So far I've been able to do without it.

@Isaac:


There is no 'declarations area' in my codes. I do not declare variables in the head of a procedure, but where I need them for the first time.

@jwcolby54:


This is not hungarian notation, its the misunderstood hungarian notation.
This is worth reading: https://www.joelonsoftware.com/2005/05/11/making-wrong-code-look-wrong/


But that all are other topics and I don't want to spam the thread with off-topic. Sorry @Josef P. ;)
I used to follow Joel. That article was a bunch of foo, way too long, way too rambling. And the examples all appeared to be pointed towards C which I learned and used for a couple of year project, and later c# for another couple of year project. But none of that has the least little bit of usefulness in VBA. And apparently I'd need to memorize 1000 different prefixes for what reason?

But that has always been Joel.. JMO I simply can't care about the origins of whatever Hungarian notation was, nor what it is now. Otoh you appear to and so enjoy whatever it means to you.

As for declaring variables closest to the first usage... if your functions are so long that matters then ... hmmm... It matters to you and so...
 
I was too curious about how the technical implementation of the import could work ... =>
The package import feature is now up and running. :)

Note:
Packages can be nested, which makes it easier to organize and manage detailed components in their respective repositories.

A test package repository is available: ACLibImportWizard-Packages

Here’s how the current workflow with the Import Wizard looks in action:


Example of a nested package info:
Package for VBA-MicrosoftGraph in package repository:
Code:
<codelib>
  <package>VBA-MicrosoftGraph</package>
  <description>VBA-MicrosoftGraph makes working with the Microsoft Graph WEB API from VBA easier. (https://github.com/mbarnesatbbs/VBA-MicrosoftGraph)</description>
  <use>%GITHUB%:josef-poetzl/VBA-MicrosoftGraph@master/VBA-MicrosoftGraph.package</use>
</codelib>
.. only a reference to a package file in the VBA-MicrosoftGraph repository

Package in VBA-MicrosoftGraph repository:
Code:
<codelib>
  <package>VBA-MicrosoftGraph</package>
  <description>VBA-MicrosoftGraph makes working with the Microsoft Graph WEB API from VBA easier. (https://github.com/mbarnesatbbs/VBA-MicrosoftGraph)</description>
  <use>/Src/AttachmentHelpers.bas</use>
  <use>/Src/Dictionary.cls</use>
  <use>/Src/Graph.bas</use>
  <use>/Src/TimeZoneHelpers.bas</use>
  <use>/Src/WebClient.cls</use>
  <use>/Src/WebHelpers.bas</use>
  <use>/Src/WebRequest.cls</use>
  <use>/Src/WebResponse.cls</use>
  <use>/authenticators/GraphAuthenticator.cls</use>
  <use>/authenticators/IWebAuthenticator.cls</use>
  <use>/authenticators/OAuth2Authenticator.cls</use>
  <ref><name>MSXML2</name><major>6</major><minor>0</minor><guid>{F5078F18-C551-11D3-89B9-0000F81FE221}</guid></ref>
</codelib>
Note: I created a fork to be able to add this for the test. Ideally, the package is provided by the original author.


Not yet implemented: Catalog functionality
  • Displaying package details in a list (via WebView or subform)
  • Searching for packages
  • ...

Spotted by chance:
Tim Hall (known for VBA-JSON and more) already uses a .toml file in his repositories - including a description of the file itself.


Feedback and suggestions welcome! :)
 
I think the only naming standard the group would actually need to agree to is how to name the procedures. It doesn't matter what names are used internally in the procedures since your calls will pass in YOUR variable names.

The naming style for the procedures has to be such that it would never interfere with something another developer might already have used.
 

Users who are viewing this thread

Back
Top Bottom