if (0 <= index && index < count) { gotoIndex = index; OS.PtListSelectPos (handle, index + 1); }
gotoIndex = index; OS.PtListSelectPos (handle, index + 1);
public void select (int start, int end) {	checkWidget();	if (start > end) return;	int [] args = new int [] {OS.Pt_ARG_LIST_ITEM_COUNT, 0, 0};	OS.PtGetResources (handle, args.length / 3, args);	int count = args [1];	if ((style & SWT.SINGLE) != 0) {		int index = Math.min (count - 1, end);		if (index >= start) select (index);		return;	}	int gotoIndex = -1;	for (int index=end; index>=start; index--) {		if (0 <= index && index < count) {			gotoIndex = index;			OS.PtListSelectPos (handle, index + 1);		}	}	if (gotoIndex != -1) OS.PtListGotoPos (handle, gotoIndex + 1);}