Reads JPL modules into memory and makes their procedures available to application
- Specifies the module to read into memory (if necessary), where
moduleNameis a string constant or colon-expanded variable that names a library module or memory-resident module. If Panther cannot find
moduleName, it issues an error message.
Note: If the
publiccommand is issued in a screen's unnamed procedure and
moduleNamecannot be found, no error message is issued.
publiccommand reads the procedures contained in one or more JPL modules. If the modules are not already memory-resident, public compiles them and puts them in memory, making the contents of the module available to the application as a whole. It also executes the first procedure if it is unnamed. All procedures beginning with a
procstatement are available until the application exits or you remove their module from memory with an unload statement.
publiclets you store generic procedures in library modules that are easy to edit and available to any application. For example, these procedures handle user exits:
ans = sm_message_box \
("Are you ready to quit?", "", SM_MB_YESNO, "")
if ans = SM_IDYES
msg emsg 'Program exit.'
Given that these procedures are in library module
exit_handler, you can make them available to the application by entering this public command in the opening screen's unnamed procedure (accessed through the screen's JPL Procedures property):public exit_handler
You can now call quit from any available application hook, for example, from a control string that is associated with the
You can issue the
publiccommand on a module only once. Panther ignores
publiccommands on a module that is already public.
Note: If you test an application that loads a public module, that module remains in memory until you explicitly unload it or Panther exits. If you edit the module after exiting test mode, remember in the next test session to unload the module's earlier version and reload the new one in order to see your changes.