Skip to content
Snippets Groups Projects
DDMsgReader.js 790 KiB
Newer Older
		return false;
	else if (pArray1 == null && pArray2 != null)
		return false;

	var arraysHaveSameValues = true;
	if (pArray1.length != pArray2.length)
		arraysHaveSameValues = false;
	else
	{
		for (var a1i = 0; a1i < pArray1.length && arraysHaveSameValues; ++a1i)
		{
			var seenInArray2 = false;
			for (var a2i = 0; a2i < pArray2.length && !seenInArray2; ++a2i)
				seenInArray2 = (pArray2[a2i] == pArray1[a1i]);
			arraysHaveSameValues = seenInArray2;
		}
	}
	return arraysHaveSameValues;
}

///////////////////////////////////////////////////////////////////////////////////

// For debugging: Writes some text on the screen at a given location with a given pause.
//
// Parameters:
//  pX: The column number on the screen at which to write the message
//  pY: The row number on the screen at which to write the message
//  pText: The text to write
//  pPauseMS: The pause time, in milliseconds
//  pClearLineAttrib: Optional - The color/attribute to clear the line with.
//                    If not specified or null is specified, defaults to normal attribute.
//  pClearLineAfter: Whether or not to clear the line again after the message is dispayed and
//                   the pause occurred.  This is optional.
function writeWithPause(pX, pY, pText, pPauseMS, pClearLineAttrib, pClearLineAfter)
{
	var clearLineAttrib = "\x01n";
	if ((pClearLineAttrib != null) && (typeof(pClearLineAttrib) == "string"))
		clearLineAttrib = pClearLineAttrib;
	console.gotoxy(pX, pY);
	console.cleartoeol(clearLineAttrib);
	console.print(pText);
	if (pClearLineAfter)
	{
		console.gotoxy(pX, pY);
		console.cleartoeol(clearLineAttrib);
	}