Sw4   >   Configuration   >   App Libraries List

App Libraries List

The oConstants property method $:AppLibsList returns a list of libraries to be included in the application. By default this method returns a list of the following libraries:

  1. The main library located in the APP/libraries folder
  2. All libraries located in the APP/libraries/modules folder.
  3. All libraries located in the studioworks folder and its subfolders.

There might be libraries in the studioworks folder which you do not want included in your application. The $:AppLibsList method lets you control the libraries which are included in your application.

It is recommended that you structure your StudioWorks application as follows:

  1. Subclass oConstants to your main library.
  2. Point the main library Startup_Task variable, cn, to the oConstants subclass in the main library.
  3. Override $:AppLibsList and enter code which selects and keeps libraries to be included in your application.

    ; Build a list of open libraries used by the application in the order of: prefs, main, libraries, modules, shared. (not utilities)
    ; Return a list of all the libraries inside the APP folder and the studioworks folder . List is defined using sAppLibs_listdef.
    Do inherited Returns AppLibsList

    ; Select the libraries which are part of this application.

    ; Deselect all lines.
    Do AppLibsList.$search(kFalse)

    ; Select the main and module libraries.
    Do AppLibsList.$search($ref.ismainlib=kTrue,1,0,1,0)
    Do AppLibsList.$search($ref.isappmodulelib=kTrue,1,0,1,0)

    ; Select the SW shared libraries to include in the app.
    Do AppLibsList.$search(low($ref.libname)=low('swcSysAdmin4'),1,0,1,0)

    ; Select the SW core libraries to include in the app.
    Do AppLibsList.$search(low($ref.libname)=low('swBase4'),1,0,1,0)
    Do AppLibsList.$search(low($ref.libname)=low('swGui4'),1,0,1,0)
    Do AppLibsList.$search(low($ref.libname)=low('swIcons4'),1,0,1,0)
    Do AppLibsList.$search(low($ref.libname)=low('swRefs4'),1,0,1,0)
    Do AppLibsList.$search(low($ref.libname)=low('swReports4'),1,0,1,0)

    ; Remove the non-selected libraries.
    Do AppLibsList.$remove(kListKeepSelected)

    Quit method AppLibsList

Note

The above steps may already be setup in your application. You might just have to modify the $:AppLibsList method to suit your application.