Symbian3/SDK/Source/GUID-AECDAEBF-777A-579B-92F8-560FD7FF86E7.dita
changeset 13 48780e181b38
parent 12 80ef3a206772
child 14 578be2adaf3e
equal deleted inserted replaced
12:80ef3a206772 13:48780e181b38
     1 <?xml version="1.0" encoding="utf-8"?>
       
     2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
       
     3 <!-- This component and the accompanying materials are made available under the terms of the License 
       
     4 "Eclipse Public License v1.0" which accompanies this distribution, 
       
     5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
       
     6 <!-- Initial Contributors:
       
     7     Nokia Corporation - initial contribution.
       
     8 Contributors: 
       
     9 -->
       
    10 <!DOCTYPE concept
       
    11   PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
       
    12 <concept id="GUID-AECDAEBF-777A-579B-92F8-560FD7FF86E7" xml:lang="en"><title>NAME
       
    13 statement</title><prolog><metadata><keywords/></metadata></prolog><conbody>
       
    14 <codeblock xml:space="preserve">&lt;name-statement&gt;
       
    15 name-statement ::= 
       
    16 NAME &lt;short-name&gt;</codeblock>
       
    17 <p>Use this statement to ensure that the resources in the file have a unique
       
    18 ID so that an application can use multiple resource files without resource
       
    19 ID conflict.</p>
       
    20 <p>This statement must be the first non-comment statement in the file.</p>
       
    21 <p>The <varname>short-name</varname> must be between one and four alphabetic
       
    22 characters long and be unique (no other file may use the same one). For the
       
    23 sake of consistency this constant should be in upper case although lower case
       
    24 is allowed (and will be converted to upper case by the compiler). This <varname>short-name</varname> is
       
    25 then converted into a number and shifted onto the leading 20 bits of the resource
       
    26 ID, leaving the bottom 12 bits for the number of the resource in the file.
       
    27 This allows a maximum of 4095 resources to be defined in a source file.</p>
       
    28 <p>Since the <codeph>NAME</codeph> statement maps all resource IDs within
       
    29 the file onto 32-bit numbers, only <codeph>LLINK</codeph> s may be used for
       
    30 resource references in that file. Using the <codeph>NAME</codeph> statement
       
    31 in a resource file means that any attempt to use a <codeph>LINK</codeph> will
       
    32 generate an error.</p>
       
    33 <example><p>With <codeph>NAME</codeph> set to <codeph>AAAA</codeph>,
       
    34 if this resource is the first resource in the file</p><codeblock id="GUID-42436ADC-996A-5D24-BC6B-8072DF8F271F" xml:space="preserve">RESOURCE STRING one
       
    35  {
       
    36  wd=5;
       
    37  }</codeblock><p>the first entry in the generated header file will be</p><codeblock id="GUID-707F02E8-CD7D-54BB-B11D-FB3B46876DF5" xml:space="preserve">#define ONE 0x04FD8001</codeblock><p>04FD8
       
    38 is the leading 20 bits for all IDs in the file and 001 is the reference of
       
    39 that resource within the file.</p></example>
       
    40 </conbody></concept>