Product Site

3.8. ::RESOURCE

The ::RESOURCE directive allows to include associated data directly in the program code.

The ::RESOURCE directive allows to include lines of resource_data of almost arbitrary form directly within the source program.

The resource name must be a a literal string or a symbol that is taken as a constant. The optional resource end delimiter must be a a literal string or a symbol that is taken as a constant. If delimiter is not specified, it defaults to the string "::END".
Example 3.14. RESOURCE directive
::resource greyCat end "-"
La nuit, tous les chats sont gris
---------------------------------

::resource "brown fox"
The quick brown fox jumps over the lazy dog
::END

::resource nollop end ANONYMOUS
     The wicked peon quivered,
then gazed balefully at the judges
         who examined him.
ANONYMOUS TYPESETTER

Notes:
  1. Specifying more than one ::RESOURCE directive with the same resource name is an error.
  2. If you end the ::RESOURCE clause with a semicolon, any text following that semicolon on the same line is ignored.
  3. The terminating resource end delimiter must start in the first column and is case-sensitive. Any text following on the same line as the terminating delimiter is ignored.
  4. Although resource_data may include almost arbitrary data (including any Rexx code), it is not well-suited for inclusion of binary data. Including special characters like line-end or end-of-file may cause unwanted results.
  5. Resource data is accessible through the .RESOURCES built-in object, and the Package class methods resource and resources.