All pastes #126913 Raw Edit

Untitled

public text v1 · immutable
·published 2006-08-11 22:10 UTC
rendered paste body
function stacksize(thearray){
	for (i = 0 ; i < thearray.length; i++ ) {
		if ( (thearray[i] == "") || (thearray[i] == null) || (thearray == 'undefined') ) {
			return i;
		}
	}
	
	return thearray.length;
}



function pushstack(thearray, newval){
	arraysize = stacksize(thearray);
	thearray[arraysize] = newval;
}



function popstack(thearray){
	arraysize = stacksize(thearray);
	theval = thearray[arraysize - 1];
	delete thearray[arraysize - 1];
	return theval;
}




function closeall(){
	if (ktags[0]) {
		while (ktags[0]) {
			tagRemove = popstack(ktags)
			document.f.text.value += "[/" + tagRemove + "]";

		}
}

	ktags = new Array();
	document.f.text.focus();
}