Programming Guide



sm_prop_name_to_id

Gets the integer ID of a Panther property

int sm_prop_name_to_id(char* jpl_prop_str);

jpl_prop_str
The JPL mnemonic for the desired property.

Returns

Description

sm_prop_name_to_id gets the integer ID for the supplied JPL property name. Access to this ID lets you call C library routines such as sm_prop_get and sm_prop_set from JPL. JPL only has direct access to its own property mnemonics, while calls to these routines require the property identifiers that are defined in Panther header files.

For example, JPL gets the number of occurrences in an array through num_occurrences, while sm_prop_get takes PR_NUM_OCCURRENCES to specify the same property. With sm_prop_name_to_id, you can translate the JPL mnemonic to the integer value of PR_NUM_OCCURRENCES and call sm_prop_get from JPL:

/* get the number of selections in group 'genre' */
vars num_selects

num_selects = sm_prop_get_int( \
sm_prop_id("genre"), \
sm_prop_name_to_id("num_occurrences"))