Name
CATALOG -- preload a catalog for later use (V9.0)
Synopsis
@CATALOG name$[, table]
Function
This preprocessor command can be used to preload the specified catalog in the user's language. If a catalog in the user's language does not exist, this preprocessor command will not show an error. This is normal behaviour because you always have to provide default English strings for every entry you try to get from a catalog using the GetCatalogString() function. Thus, it's not a problem if @CATALOG specifies a catalog that doesn't exist. In that case, GetCatalogString() will simply fall back to the default English strings without throwing an error.

Note that there currently can only be a single catalog per application. Thus, @CATALOG should only be used once per script. Also note that name$ must not be a filename but the name of a catalog that is stored within a Hollywood catalog directory structure. See OpenCatalog for details on how such a Hollywood catalog structure is organized.

The advantage of using @CATALOG instead of OpenCatalog() is that if you use @CATALOG, the catalogs for all available languages will be linked into your executable or applet when you compile your script. This makes it easier to distribute your project because you don't have to include the catalog directory structure with your application. Also, when compiling Hollywood applets for mobile systems like Android or iOS, it's much better to have all external files linked into the applet.

In addition to the name$ parameter, @CATALOG also accepts an optional table argument. The following fields in the table argument are currently available:

Link:
Set this field to False if you do not want to have this catalog linked to your executable/applet when you compile your script. This field defaults to True which means that the catalog will be linked to your executable/applet when Hollywood is in compile mode.

To load a catalog at runtime, use the OpenCatalog() function. See OpenCatalog for details.

Inputs
name$
name of the catalog to open
table
optional: table containing further options
Example
@CATALOG "Hollywood.catalog"

; this is our default English catalog
def$ = {}
def$[0] = "Welcome to Hollywood!"
def$[1] = "Written by Andreas Falkenhahn"
def$[2] = "What do you wanna do?"

; if Hollywood.catalog is not available in the
; user's language; the English strings will be
; used
For k = 0 To 2
   c$[k] = GetCatalogString(k, def$[k])
Next
The code above opens "Hollywood.catalog" and prints the first three entries from that catalog.

Show TOC