Itty Bitty Rants

Infrequent posts about stuff.

Installscript Tip for the day:

While InstallShield’s Installscript does not have any String functions that can handle case sensitive comparison, the List functions do!

//////////////////////////////////////////////////////////////////////////
//	function NRS_StrCompare
//	Case-sensitive compare of 2 strings.
//	Returns 0 if the strings match, -1 if they don't.
//////////////////////////////////////////////////////////////////////////
function NUMBER NRS_StrCompare ( szStr1 , szStr2 )
	NUMBER	nReturn , nResult;
	LIST	listList;
begin
	nReturn = -1;
	listList = ListCreate ( STRINGLIST );
	ListAddString ( listList , szStr1 , AFTER );
	nResult = ListFindString ( listList , szStr2);
	ListDestroy ( listList );
	if ( nResult == 0 ) then
		nReturn = 0;
	endif;		
	return nReturn;
end;