Purpose |
Returns predefined resource data. |
Syntax |
r$ = RESOURCE$(RCDATA, ResID) s$$ = RESOURCE$(STRING, ResID%) |
Remarks |
You can embed data into your EXE or DLL with the #RESOURCE metastatement. While the data can be represented in several different data types, two are designed to be retrieved directly for your own purposes: RCDATA and STRING. In both cases, this data is returned as a variable-length string so you can manipulate it and use it as you wish. The specific resource you wish to retrieve is specified by the ResID. If the ID you request is not present, a nul (zero-length) string is returned. |
RCDATA |
This resource contains raw data of any type. It is always stored byte-by-byte, just as it was originally created at the time of compilation. Generally speaking, this type of data should be assigned to an ANSI string variable so no Unicode conversions are performed. The ResID which identifies this resource may be a numeric value between 0 and 65535, or an alphanumeric label which is passed to the function as a string expression (string literal, variable, etc.) |
STRING |
This resource contains predefined strings in a string table. Each string is identified by a resource ID number in the range of 0 to 65535. This number is used as the ResID% to determine which string will be retrieved. Because of the format in which Windows stores the strings in tables, only integral numeric ID's may be used. All resource strings are saved internally in wide Unicode format. |
See also |