[AccessD] Global default class instance

John Colby jwcolby at gmail.com
Fri Oct 28 21:12:48 CDT 2022


I built something like this years ago, though not for this purpose.  I used
it to build a class representation of any table, but specifically a 'flat'
one record table to hold my SysVars.  It worked but was a tad clunky.  The
problem I found was that any time the table changed, I had to rebuild the
class.

I eventually moved the opposite direction to a class for each record in a
SysVar table, with a supervisor class / collection to load all the SysVar
records.  This allowed me to just add new sysvars on the fly as a new
record in usysTblSySVars.  I could also "merge" sysvar tables to (for
example) have a default SysVar table in the framework library, then a
SysVar table in the app which, if a matching SysVar record existed, would
'override' the default value. Thus my framework had default properties but
I could easily modify the operation for each FE using the framework.

In any event, a class builder is a very useful thing.

On Fri, Oct 28, 2022 at 6:50 PM Ryan W <wrwehler at gmail.com> wrote:

> He's got a super interesting class for storing and referencing TempVars to
> ensure they're Type Safe and you can catch compile errors from
> misspellings, which you cannot with TempVars alone.
>
> He also reads all the tempvars he wants to use in from a table, creates the
> class with all the property references to those tempvars to a file and then
> imports it programmatically.  Pretty ingenious:
> https://nolongerset.com/tv-class/ and
> https://nolongerset.com/generatetvclass/
>
> I read this when he published it and I thought you'd appreciate it.
>
>
>
> On Fri, Oct 28, 2022 at 5:36 PM John Colby <jwcolby at gmail.com> wrote:
>
> > I've been manually exporting / modifying / importing classes for 25
> years.
> > I do so to allow referencing classes from a referenced library so that
> > early binding and all the good stuff is available for classes stored in
> > libraries.  However I had never investigated the PredeclaredID attribute.
> >
> > I will be studying / borrowing Mike's code for doing so programmatically
> > since I want to build code for doing that for my book(s).
> >
> > On Fri, Oct 28, 2022 at 11:34 AM Ryan W <wrwehler at gmail.com> wrote:
> >
> > > Mike Wolfe has a ton of great class articles on hidden properties and
> > > fantastic uses over on https://www.nolongerset.com
> > >
> > > He even shares code on how to export a class, insert the text you
> > mentioned
> > > and re-import it all programmatically:
> > > https://nolongerset.com/setpredeclaredid/
> > >
> > >
> > >
> > > --
> > John W. Colby
> > Colby Consulting
> > --
> > AccessD mailing list
> > AccessD at databaseadvisors.com
> > https://databaseadvisors.com/mailman/listinfo/accessd
> > Website: http://www.databaseadvisors.com
> >
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> https://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>


-- 
John W. Colby
Colby Consulting


More information about the AccessD mailing list