PA_OpenResFile


version 2003


PA_OpenResFile (fullPath) → short

Parameter Type Description
fullPath char* Full path of the resource file to open
Function result short File reference number of the opened file

Description

The routine PA_OpenResFile opens an Internal Resource File at location fullPath and returns its file reference number. If the file could not been opened (bad path, file in use, etc.), PA_OpenResFile returns -1.

If the file is already open in the same application, the routine returns its reference number.

If fullPath is not a valid resource file or does not refer to an existing file, PA_OpenResFile returns -1 and PA_GetLastError() returns the appropriate File Manager error.

For Windows users

4th Dimension adds the necessary .4DB file extension to the file name - simply pass the name of the new file.

Example

At startup, open a private resource file and set a global to this reference.

   // "somewhare"
   short   gMyResFile;
   // . . .
   gMyResFile = PA_OpenResFile(gMyResFileLocation);
 

See Also

PA_CreateResFile , PA_OpenResFile .

Error Handling

Use PA_GetLastError to see if an error occurred