version 6.7
Get component resource ID (compName; resType; originalResNum) Number
Parameter | Type | Description | |
compName | String (32) | Component name referencing the resource | |
resType | String (4) | Resource type (4 characters), PICT or STR# | |
originalResNum | Number | Resource original number before component | |
installation | |||
Function result | Number | Current resource number |
Description
The Get component resource ID command allows component developers to verify that their customized PICT or STR# resource calls will be properly executed even though the resource numbers have been modified while installing the component.
Indeed, when 4D Insider installs a component requiring its own resources, the application can automatically renumber these new resources if some database resources already have the same ID.
Note: For further information on components in 4th Dimension, refer to the 4D Insider documentation.
The command Get component resource ID reveals the current (actual) number for each resource used by a component, based on its type and its original number.
In compName, you put the component name using a given resource.
In resType, you put the resource type (4 characters only). The Get component resource ID command only accepts resources of type PICT and STR#.
Note: Pictures stored in the Picture Library are NOT managed by the Get component resource ID command. To use Picture Library pictures in a 4D component, you must call the GET PICTURE FROM LIBRARY command and pass a String (picture name) as a first parameter. For more information, refer to the GET PICTURE FROM LIBRARY command description.
Put in originalResNum the original resource number, i.e. the number defined at the design stage.
The function then returns the current resource ID used by the database.
If no resource matches originalResNum, Get component resource ID returns the value entered for originalResNum.
Example
The code below does not guarantee that the resource calls will be made properly:
` If the resources are renumbered, this call will not be correct vResNumb := 15000 STRING LIST TO ARRAY(vResNumb; stringArray;resFile)
We strongly advise you to use the following portion of code:
` This call will be correct in any case vResNumb :=Get component resource ID ("Mycomp";"STR#";15000) STRING LIST TO ARRAY(vResNumb; stringArray; resFile)
See Also