LB-Load pulldown menu

From Vectorlab
Jump to: navigation, search


Procedure to load a pull down menu from the values in a chosen LB column. By Orso B. Schmid

{ Orso ******************************************** }
{ Loads a pull-down menu from a LB }
PROCEDURE LB_LoadPull(d, LB, LBcol: LONGINT; pullID :INTEGER);
	VAR
		i, n : INTEGER;
	BEGIN
		WHILE NumChoices(pullID) > 0 DO
			DelChoice(pullID, 0);
		
		i := 0;
		n := GetNumLBItems(d, LB);
		WHILE i < n DO BEGIN
			InsertChoice(pullID, NumChoices(pullID), LB_GetStr(d, LB, i, LBcol));
			i := i + 1;
		END;
	END;