forked from livecode/livecode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgetResource.lcdoc
More file actions
38 lines (24 loc) · 1.42 KB
/
getResource.lcdoc
File metadata and controls
38 lines (24 loc) · 1.42 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
Name: getResource
Type: function
Syntax: getResource(<filePath>, <resourceType>,{<resourceName> | <resourceID>})
Summary: <return|Returns> the data in a <Mac OS> <resource>.
Introduced: 1.1
OS: mac
Platforms: desktop,server,web
Security: disk
Example:
getResource("/Hard Drive/Stuff","DLOG",128)
getResource(it,"BNDL","Application")
Parameters:
filePath: The location and name of the file that holds the resource you want. If you specify a name but not a location, LiveCode assumes the file is in the defaultFolder.
resourceType: The 4-character type of the resource you want.
resourceName (string):
resourceID (integer):
The result: If the <filePath> does not exist, the <result> is set to "can't find file". If the <filePath> exists, but the <file> has no <resource fork>, the <result> is set to "can't open resource fork". If the filePath contains a <resource fork> but does not contain the specified resource, the result is set to "can't find specified resource<a/>".
Returns:
The <getResource> <function> <return|returns> the text or binary data in the specified <resource>.
If the specified resource does not exist, the <getResource> <function> returns empty.
Description:
Use the <getResource> <function> to get the contents of a resource.
References: file (keyword), result (function), setResource (function), resource fork (glossary), resource (glossary), Mac OS (glossary), return (glossary), function (control_st)
Tags: file system