This repository was archived by the owner on Aug 31, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 226
Expand file tree
/
Copy pathcopyResource.lcdoc
More file actions
84 lines (59 loc) · 2.38 KB
/
copyResource.lcdoc
File metadata and controls
84 lines (59 loc) · 2.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
Name: copyResource
Type: function
Syntax: copyResource(<file>, <destinationFile>, <resType>,{<resID> | <resName>}[, <newID>])
Summary:
Copies a <resource> from one <Mac OS> <file> to another.
Introduced: 1.0
Deprecated: 8.1
OS: mac
Platforms: desktop
Security: disk
Example:
get copyResource("Template","New Build","vers",1,1)
Example:
put copyResource(theFile,anotherFile,"XCMD","SetPort") into trashVar
Example:
get copyResource(field "Source",currentFile,nextResource,200)
Parameters:
file:
The name and location of the file containing the resource. If you
specify a name but not a location, LiveCode assumes the file is in the
defaultFolder.
destinationFile:
The name and location of the file you want to copy the resource to.
resType:
The 4-character type of the resource you want to move.
resID (integer):
An integer that specifies the resource ID of the resource you want to
copy.
resName:
The name of the resource you want to copy.
newID (integer):
An integer that specifies the resource ID for the newly-copied resource.
Returns:
The <copyResource> <function> always <return|returns> empty.
The result:
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".
Description:
Use the <copyResource> function to copy <resource|resources> (such as
icons, externals, and version <resource|resources>) from one <file> to
another.
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>.
Changes:
The <copyResource> function was deprecated in LiveCode 8.1, since the
versions of MacOS supported by LiveCode no longer support resource
forks. It should not be used in any new code.
References: copy (command), function (control structure),
result (function), setResource (function), resource fork (glossary),
resource (glossary), Mac OS (glossary), return (glossary), file (keyword)
Tags: file system