ConfirmIt Sum answers by pairs

Check if the sum of two open-end questions (with consistent precodes e.g 1 & 2 OR 3 & 4 OR 5 & 6) is equal to 100. Very helpful if the answers are percentages that must sum 100.

//surveyscripting.com

var precodes = f("Q1").domainValues();
var first: int = 0;
var z: int = 0;
for(var i : int = 1; i<precodes.length+1; i++) {
	var z = i + 1;
	var first = f('Q1')[i] + f('Q1')[z];
	if (first < 100) {
		RaiseError();
		SetQuestionErrorMessage(LangIDs.en, "Please verify your answers.");
		break;
	}
}