logo
Powered by QM on a Rpi server
Home
About OpenQM
  What is OpenQM?
  What is Multivalue?
  Licensing Overview
  News
  Testimonials
  Case Studies
  Presentations
Sales and Downloads
Help and Support
About
Login

KnowledgeBase 00069: Cataloguing

Last updated: 22 Jul 2016
Applies to: All versions
Search  
Top level index       Full Index Search Tips
Previous article     Next article

This article was originally published as a Tip of the Week.

Before a QMBasic subroutine, function or class module can be used in an application, it must be placed in the system catalogue. This can be thought of as a library of subroutines available to the application. Programs can also be catalogued but this is not always needed.

The CATALOGUE verb (also available with its US spelling, CATALOG) creates a catalogue entry.

   CATALOGUE {filename {catalogue.name}} program.name {options} 
The filename defaults to BP if omitted. Note that the .OUT suffix to the filename to address the object code file is supplied automatically. The catalogue name (the name used in CALLs, etc) defaults to be the same as the program name.

QM provides three distinct ways to catalogue a program. They are described below in the order in which the library search takes place at run time.


Local Cataloguing

Using the LOCAL option to the CATALOGUE verb creates a VOC record that points to the compiled object code in its original location.

It is not necessary to recatalogue the program if it is recompiled because the pointer will still be in place. If the compilation fails, the object code will be deleted and users of the application may get run time errors.


Private Cataloguing

Using the CATALOGUE verb with no mode options copies the program to the private catalogue which is normally a subdirectory named cat under the account directory. There is no VOC record associated with the catalogued program.

If the program is modified, the CATALOGUE verb must be repeated to copy the new version. If the compilation fails, the previous catalogued version is still in place.


Global Cataloguing

Using the GLOBAL option to the CATALOGUE verb copies the program to the global catalogue which is a subdirectory named gcat under the QMSYS account directory. As described in the QM Reference Manual, global cataloguing can also be forced by use of certain reserved prefix characters on the program name. There is no VOC record associated with a globally catalogued program.

Again, if the program is modified, the CATALOGUE verb must be repeated to copy the new version. If the compilation fails, the previous catalogued version is still in place.


Sharing the Private Catalogue

Sometimes it is useful for two or more accounts to share a single private catalogue. This can be done by creating a VOC record named $PRIVATE.CATALOGUE that points to an alternative location. See the QM Reference Manual for more details.


Catalogue Mapping

The MAP command produces a report of the items in the private and global catalogues. Locally catalogued items can be located with a simple query against the VOC file.


Automatic Cataloguing

The QMBasic compiler supports a $CATALOGUE directive to catalogue a program automatically after successful compilation. This can also be enabled for all programs via the $BASIC.OPTIONS record.


Related Articles

00010: Object Code Management



Please tell us if this article was helpful
Very     Slightly     Not at all
Comments
Email (optional)