D. Edward Mitchell 16:00, 14 April 2020 (UTC) Hello World! groupKOS Developer Share —usually UNDER CONSTRUCTION
Grandpa's VB6 code unique strings module
What this is
This is Microsoft Visual Basic 6.0 (VB6) source code —a BAS file (MyApp.BAS).
A public function, uStr(), serves to store strings in an array, and returns the array index to use as an index to access the stored string.
If a string exists already, the uStr() function returns the index of the first string, and discards the duplicate value.
In this way, every stored string is unique.
There are many data widgets in every modern programming language, like collections (VB6), dictionaries, keyed-arrays, and on.
The unique strings function can be upgraded to a binary-tree storage structure, and implemented as a static-array with dynamic-pointers.
This puts the humble check-everything linear search used in this function, into a big-O access machine.
A big-O device can operate on a data file of any size with little performance decrease as the file grows larger.
The improved binary tree unique strings module becomes the workhorse for categorical analysis, wherein every data value is a categorized, with a real system having perhaps millions of possible categories of numbers.
With a QAT paradigm, the big-O access over unique strings makes one of two category engines that comprise quasi axiomatic analysis by looking for categorical coincidence.
By comparing live operations with two categories found existing in a data stream over time, dynamical dependencies may be revealed as they happen between those two categories.
One category is the data measured. Other categories come from separate data that is coincidental in time with the data measurement. Should there be dynamical relationships of one category to another, then a regularity pertinent to the dynamic relationship of the category-pair is observable.
An example, learned from a Ph.D of mathematics — if categorical analysis is performed on stock-market data, the phase of the moon can be observed as a dynamical operator in the stock market (slight, but evident).
Back in the day
Grandpa used modules as quick classes, because they can have private variables, and public and private functions. No explicit instancing needed.
VB6 can do normal class definitions and instancing in a basic way, too, of course.
- Read more trivia below.
As an instancing method doesn't happen with a module, the storage method below, uStr(qStr), is auto-allocated on first use, and allocates again as needed by chunk.
VB 6 trivia
A Visual Basic 6.0 code module is saved as a BAS file. 'Code module' means a BAS file in the VB IDE (an Integrated Development Environment... it edits and debugs and compiles and phones home).
A Visual Basic 6.0 code module is scanned at start-up of the IDE, then treated like an object with scoped methods and properties. The code module is 'objectified', so to speak, by the built-in 'intelli-sense' now prevalent an any modern programmer's editor. Most any. An intelli-sense objectifies a coding project's properties and objects and such, and makes them available in the editor at the typing cursor. This is much like the smart-completion with drop-down selections in a browser's editable URL text line. Intelli-sense brought everything every already typed into a project available as a pop-up list —when the syntax needed it. Intelligent enough. It was hot stuff.
The property name given to the BAS code module can also be used in code statements to address the code module like a class.
The code module is 'instanced' per se at start-up.
A module is similar to a global singleton class instance, not creatable twice, that is auto-instanced at start-up.
The code module will support 'Property Get()' and 'Property Let()' statements. Variables can be declared 'Public' or 'Private'. Public variables are 'seen' by the entire project, usable in all code modules.
Passing class-instances and user-defined data types to a function in a module is possible. But, the IDE will not compile if a user-type or class is passed to a function in the same form module.
VB6 is responsible for reclaiming array storage.
Visual Basic 6.0 had its own magazine for, at the time, us two million suddenly marketable biz-developers. We were marketable because we were IT people mostly, that could suddenly weave apps. Our marketability was that we came with IT speak, and could understand IT people's Microsoft world of crazy.
While VB6 lacks most modern code editor necessities, a graphical form editor and seamless integration of mouse and keyboard (etc.) code events made front-end development possible, and cost effective. VB 6.0 created a season in the dot-com bubble called rapid-app-development.
If zero references to external dependencies are added to a VB 6.0 project, that project will compile and run on any Windows platform since back in the day (Before Windows XP?). This was very convenient while working with a computer scientist that needed a portable application.
Writing a program with zero external dependencies in VB 6.0 is stark. The popular Common Control shipped with VB 6.0, but even that was an external reference, and required that VB6 apps were bundled into an installer, such that VB6 could be registered to access external executables already on the local box.