General Rules for Resources

The following rules apply to resources in general.

  1. Resources are files (other than COBOL objects) that are included in a COBOL object library.
  2. Resources are named as if they were files, but without any directory information. A resource takes on the same base name as its source file (including suffix). For example, if you include the resource c:\mystuff\toolbar1.bmp, that resource would be called toolbar1.bmp in the COBOL object library.
  3. Resources preserve the case of their names in the object (as specified at the time they were included in the object). However, resource names are matched regardless of case. Thus, in the preceding example, a program could refer to the resource as toolbar1.bmp or ToolBar1.Bmp with identical results.
  4. A resource name with a hyphen (MY-FILE) is considered equivalent to the same resource name given with an underscore (MY_FILE).
  5. Resources are accessed by various specific COBOL subroutines or operations. Currently, there are five useful resource types. These are: bitmap, JPEG, WAV, ActiveX resource, and runtime configuration files. The library routines W$BITMAP, WIN$PLAYSOUND and C$RESOURCE can access resources. See Using the Runtime System for information about embedding a runtime configuration file in an object library.
  6. The presence of one or more resources in an object converts that object into a library. A library consists of a collection of COBOL objects and resources (either of which may be absent). COBOL objects are named in a library by their PROGRAM-IDs, while resources are named by their file names. The CALL verb ignores resources when trying to find a COBOL object, and resource processing routines (such as W$BITMAP) ignore COBOL objects when trying to find a resource.
  7. You can include a resource in an object file by using either the COPY RESOURCE statement or by using cblutil -lib.