Dlog-Get PIO parm choice index

From Vectorlab
Jump to: navigation, search


Function to return the choice index of a pulldown menu. Index returned is 1-based. You'll prefer this approach if you use the values from a CASE statement, or if you are localizing your plug-ins (which will lead you to use only the index of the strings). By Orso B. Schmid


{ Orso B. Schmid ************************************************ }
{ gets choice index and string from choice item, pull or radio }
{ this returns the index 1-based }
{ example: choiceIs := D_GetChoiceIndx(pluginName, 'Name_Of_Parameter', PName_Of_Parameter); }
FUNCTION D_GetChoiceIndx(pioName, itemName, choiceStr: STRING): INTEGER;
	BEGIN
		IF NOT GetPluginChoiceIndex(pioName, itemName, choiceStr, D_GetChoiceIndx) THEN
			D_GetChoiceIndx := 1;
	END;