Error getting tags :
error 404Error getting tags :
error 404 copyResource | revDocs | RunRev
Welcome Guest (Log in)
Product Edition
Version
copyResource
Basics
Expander triangle
Type
Function
Syntax
copyResource(file,destinationFile,resType,{resID | resName}[,newID])
Introduced
1.0
Environment
Desktop,Web
Platform Support
MacOS,Mac OS X
Security
Disk
Summary
Copies a resource from one Mac OS file to another.
Examples

get copyResource("Template","New Build","vers",1,1)
put copyResource(theFile,anotherFile,"XCMD","SetPort") into trashVar
get copyResource(field "Source",currentFile,nextResource,200)

Additional Comments
Expander triangle

Use the copyResource function to copy resources (such as icons, externals, and version resources) from one file to another.

Parameters:

The file is the name and location of the file containing the resource. If you specify a name but not a location, Revolution assumes the file is in the defaultFolder.

The destinationFile is the name and location of the file you want to copy the resource to.

The resType is the 4-character type of the resource you want to move.

The resID is an integer that specifies the resource ID of the resource you want to copy.

The resName is the name of the resource you want to copy.

The newID is an integer that specifies the resource ID for the newly-copied resource.

Value:

The copyResource function always returns empty.

Comments:

If the file does not exist, the result is set to "can't find file".

If the destinationFile does not exist, the copyResource function creates the file, but the result is set to "can't create resource fork for destination file". If the destinationFile exists but has no resource fork. the copyResource function creates the resource fork and copies the resource to it.

If the destinationFile is open, the result is set to "Can't open resource fork".

If you don't specify a newID, the new resource has the same ID as the original resource. Specifying a newID does not change the resource ID of the original resource in the file; it only affects the copy in the destinationFile.

User Comments
Expander triangle