PA_CreateResFile

4D - Documentation   Français   English   German   4D Plugin API, Command Theme List   4D Plugin API, Command Alphabetical List   Back   Previous   Next

version 2003


PA_CreateResFile (fullPath) short

ParameterTypeDescription
fullPathchar*Full path of a new resource file
Function resultshortFile reference number of the created file

Description

The routine PA_CreateResFile creates and opens a new Internal Resource File at location fullPath, and returns its file reference number. If the file could not been created (bad path, file open, etc.), PA_CreateResFile returns -1.

If another file of the same name exists at the same path, and if it not already open, the routine opens it and returns its file reference number.

NOTE

If the file could neither be created nor opened, it is possible that PA_GetLastError will return eER_NoErr. Thus, to check if the file has been created, it is better to check the returned value of PA_CreateResFile.

The created file has the same kind as a structure file (.4DB under Windows), and contains basic resources that 4D creates by default. It has a basic resource fork as well (for MacOS-based resources). 4th Dimension does all the necessary work in order to use the file as an internal resource file: it creates an index of resources, a bitmap, etc.

For Windows users

4th Dimension adds the necessary .4DB file extension to the file name. Pass only the name of the new file.

Example

Create a new resource file under Windows.

   resFile = PA_CreateResFile("C:\Folder1\Folder2\NewResFile");
   if(resFile # -1)
      . . .

Create a new resource file under MacOS.

   resFile = PA_CreateResFile("Disk:Folder1:Folder2:NewResFile");
   if(resFile # -1)
      . . .

See Also

PA_CloseResfile, PA_OpenResFile.

Error Handling

Use PA_GetLastError to see if an error occurred


4D - Documentation   Français   English   German   4D Plugin API, Command Theme List   4D Plugin API, Command Alphabetical List   Back   Previous   Next