forked from livecode/livecode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgetResource.xml
More file actions
40 lines (40 loc) · 3.02 KB
/
Copy pathgetResource.xml
File metadata and controls
40 lines (40 loc) · 3.02 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
<doc>
<legacy_id>2138</legacy_id>
<name>getResource</name>
<type>function</type>
<syntax>
<example>getResource(<i>filePath</i>,<i>resourceType</i>,{<i>resourceName </i>| <i>resourceID</i>})</example>
</syntax>
<library></library>
<objects>
</objects>
<synonyms>
</synonyms>
<classification>
<category>Files, Folders, & Resources</category>
</classification>
<references>
<function tag="setResource">setResource Function</function>
</references>
<history>
<introduced version="1.1">Added.</introduced>
</history>
<platforms>
<mac/>
</platforms>
<classes>
<desktop/>
<server/>
<web/>
</classes>
<security>
<disk access="???"/>
</security>
<summary><glossary tag="return">Returns</glossary> the data in a <glossary tag="Mac OS">Mac OS</glossary> <glossary tag="resource">resource</glossary>.</summary>
<examples>
<example>getResource("/Hard Drive/Stuff","DLOG",128)</p><p>getResource(it,"BNDL","Application")</example>
</examples>
<description>
<p>Use the <b>getResource</b> <control_st tag="function">function</control_st> to get the contents of a resource.</p><p/><p><b>Parameters:</b></p><p>The <i>filePath</i> is the location and name of the <keyword tag="file">file</keyword> that holds the <glossary tag="resource">resource</glossary> you want. If you specify a name but not a location, LiveCode assumes the <keyword tag="file">file</keyword> is in the <property tag="defaultFolder">defaultFolder</property>.</p><p/><p>The <i>resourceType</i> is the 4-character type of the <glossary tag="resource">resource</glossary> you want.</p><p/><p>The <i>resourceName</i> is a <keyword tag="string">string</keyword> or an <glossary tag="expression">expression</glossary> that <glossary tag="evaluate">evaluates</glossary> to a <keyword tag="string">string</keyword>.</p><p/><p>The <i>resourceID</i> is an <keyword tag="integer">integer</keyword> or an <glossary tag="expression">expression</glossary> that <glossary tag="evaluate">evaluates</glossary> to an <keyword tag="integer">integer</keyword>.</p><p/><p><b>Value:</b></p><p>The <b>getResource</b> <control_st tag="function">function</control_st> <glossary tag="return">returns</glossary> the text or binary data in the specified <glossary tag="resource">resource</glossary>.</p><p/><p>If the specified resource does not exist, the <b>getResource</b> <control_st tag="function">function</control_st> returns empty.</p><p/><p><b>Comments:</b></p><p>If the <i>filePath</i> does not exist, the <function tag="result">result</function> is set to "<code>can't find file</code>". If the <i>filePath</i> exists, but the <keyword tag="file">file</keyword> has no <glossary tag="resource fork">resource fork</glossary>, the <function tag="result">result</function> is set to "<code>can't open resource fork</code>". If the <i>filePath </i>contains a <glossary tag="resource fork">resource fork</glossary> but does not contain the specified resource, the result is set to "<code>can't find specified resource</code><a/>".</p>
</description>
</doc>