4D v14.3

Get indexed string

Home

 
4D v14.3
Get indexed string

Get indexed string 


 

Get indexed string ( resID ; strID {; resFile} ) -> Function result 
Parameter Type   Description
resID  Longint in Resource ID number or 'id' attribute of the 'group' element (XLIFF)
strID  Longint in String number or 'id' attribute of the 'trans-unit' element (XLIFF)
resFile  DocRef in Resource file reference number If omitted: all the XLIFF files or open resource files
Function result  String in Value of the indexed string

 The Get indexed string command returns:

  • Either one of the strings stored in the string list (“STR#”) resource whose ID is passed in resID.
  • Or a string stored in an open XLIFF file whose 'id' attribute of the 'group' element is passed in resID (see "Compatibility with XLIFF architecture" below).

You pass the number of the string in strID. The strings of a string list resource are numbered from 1 to N. To get all the strings (and their numbers) of a string list resource, use the command STRING LIST TO ARRAY.

If the resource or the string within the resource is not found, an empty string is returned and the OK variable is set to 0 (zero).

If you pass a valid resource file reference number in resFile, the resource is searched for in that file only. If you do not pass resFile, the first occurrence of the resource found in the resource files chain is returned.

Note: A string of a string list resource can contain up to 255 characters.

The Get indexed string command is compatible with the XLIFF architecture of 4D beginning with version 11: the command first looks for values corresponding to resID and strID in all the open XLIFF files (when the resFile parameter is omitted). In this case, resID specifies the id attribute of the group element and strID specifies the id attribute of the trans-unit element. If the value is not found, the command continues searching in the open resources files. For more information about XLIFF architecture in 4D, refer to the Design Reference manual.

Example  

See example for the command SET MENU BAR.

If the resource is found, OK is set to 1. Otherwise, it is set to 0 (zero).

 
PROPERTIES 

Product: 4D
Theme: Resources
Number: 510

The OK variable is changed by the command

 
HISTORY 

Modified: 4D v11 SQL

 
SEE ALSO 

Get string resource
Get text resource
STRING LIST TO ARRAY

 
ARTICLE USAGE

4D Language Reference ( 4D v12.4)
4D Language Reference ( 4D v11 SQL Release 6)
4D Language Reference ( 4D v14 R3)
4D Language Reference ( 4D v14 R2)
4D Language Reference ( 4D v13.5)
4D Language Reference ( 4D v14.3)
4D Language Reference ( 4D v14 R4)