rem: if (tmpLine.length != 3 ||tmpLine.length != 4) { 
add: if (! (tmpLine.length == 3 ||tmpLine.length == 4)) { 
context: function read(filename){	if (arguments.length == 0) {		ReadDialog();		return;	}	if (! arguments.length) {		ejies.error(this, "read filename is missing");		return;	}	var fichier = new File(filename,"read"); 	if (fichier.isopen) {		RedrawEnable = 0;		AllowEdit = 0;		var tmpLine = LectureNextLigne(fichier);		if (tmpLine.search("ej.function format") == -1) {			ejies.error(this, "can't read this file format");						// suppression des objets opendialog...			if (OpendialogPrepend)				DeleteReadThings();			fichier.close();			return;		}						// Lecture de la premire ligne du fichier		tmpLine = LectureNextLigne(fichier);		tmpLine = tmpLine.split(" ");		var idx = 0;		var c, i;		var OldNp;				var FunctionVersionCheck = tmpLine[idx++];	// stocke le numro de version		isCurveMode = FunctionVersionCheck == 6 ? 1 : 0;		var OldNbCourbes = NbCourbes;		NbCourbes = parseFloat(tmpLine[idx++]);				while (OldNbCourbes < NbCourbes) {		// cration des courbes si ncessaire			f[OldNbCourbes] = new Courbe();			MyThings2Zoom(f[OldNbCourbes]);			pixel2machin(f[OldNbCourbes++]);		}		while (OldNbCourbes > NbCourbes) {		// suppression des courbes si ncessaire			f.splice(--OldNbCourbes, 1);			if (front >= NbCourbes)				front = 0;		}				for (c = 0; c < NbCourbes; c++) {			OldNp = f[c].np;			f[c].np = parseFloat(tmpLine[idx++]);			// cration ou suppression de points			while (OldNp < f[c].np) { f[c]["pa"][OldNp++] = new Point(); }			while (OldNp > f[c].np) { f[c]["pa"].splice(--OldNp, 1); }		}			c = 0;		while ( fichier.position < fichier.eof) {			tmpLine = LectureNextLigne(fichier);			if (tmpLine == "")				break;			tmpLine = tmpLine.split(" ");			idx = 0;			var p;			var NeedUpdate = 0;			f[c].name = tmpLine[idx++];			// some people loves to put spaces in names...			while ( isNaN(parseFloat(tmpLine[idx])) )				f[c].name += " " + tmpLine[idx++];						// depuis la version 1.52 domaine contient deux limites.			if (FunctionVersionCheck == 1)				f[c].domain[0] = 0;			else				f[c].domain[0] = parseFloat(tmpLine[idx++]);			f[c].domain[1] = parseFloat(tmpLine[idx++]);						f[c].range[0] = parseFloat(tmpLine[idx++]);			f[c].range[1] = parseFloat(tmpLine[idx++]);			MyThings2Zoom(f[c]);						if (FunctionVersionCheck != 3) {				f[c].grid_x = parseFloat(tmpLine[idx++]);				if (FunctionVersionCheck >= 4) /* in format 4 and higher, there's a horizontal grid */					f[c].grid_y = parseFloat(tmpLine[idx++]);									f[c].display = parseFloat(tmpLine[idx++]);				idx = 0;				tmpLine = LectureNextLigne(fichier);				tmpLine = tmpLine.split(" ");				for (j=0; j < 3; j++) { f[c].brgb[j] = tmpLine[idx++] / 255; }				for (j=0; j < 3; j++) { f[c].frgb[j] = tmpLine[idx++] / 255; }				for (j=0; j < 3; j++) { f[c].rgb2[j] = tmpLine[idx++] / 255; }				for (j=0; j < 3; j++) { f[c].rgb3[j] = tmpLine[idx++] / 255; }				for (j=0; j < 3; j++) { f[c].rgb4[j] = tmpLine[idx++] / 255; }				for (j=0; j < 3; j++) { f[c].rgb5[j] = tmpLine[idx++] / 255; }				for (j=0; j < 3; j++) { f[c].rgb6[j] = tmpLine[idx++] / 255; }			}			for (p = 0; p < f[c].np; p++) {				idx = 0;				tmpLine = LectureNextLigne(fichier);				tmpLine = tmpLine.split(" ");				// check the number of items: 4 when there's curve				if (tmpLine.length != 3 ||tmpLine.length != 4) {					ejies.error(this, "bad file contents");					break;				}				f[c]["pa"][p].valx = parseFloat(tmpLine[idx++]);				f[c]["pa"][p].valy = parseFloat(tmpLine[idx++]);				f[c]["pa"][p].curve = isCurveMode ? parseFloat(tmpLine[idx++]) : 0;				f[c]["pa"][p].sustain = tmpLine[idx] & 2 ? 1 : 0; // pas d'incrmentation				f[c]["pa"][p].fix = tmpLine[idx++] & 1;	// elle est faite ici.			}			c++;		}		AllPixel2Machin();		ValRecalculate();		RedrawEnable = 1;		AllowEdit = 1;		PattrInterpError.flag = 0;		calcCurves();					// added MR		UpdateDisplay();		outlet(DUMPOUT, "read", filename, 1);		fichier.close();	} else {		ejies.error(this, "could not read file: ", filename, "... don't ask why :-)\n");		outlet(DUMPOUT, "read", filename, -1);	}		// suppression des objets opendialog...	if (OpendialogPrepend)			DeleteReadThings();}
meta: 6421	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/6421/462fc5637f05a94d562d70ffccfd6cf38db5c512/ej.function.js/clean/ejies-jsui/ej.function.js