Warnings in Servoy 6.1.2

Hi all

I have the following function and get the warning “Reference to undeclared variable or property selected”. But the variable is an param for this function. What is the Problem with this code?

/**
 * Calculate the row background color.
 *
 * @param {Number} index row index
 * @param {Boolean} selected is the row selected
 * @param {String} elementType element type
 * @param {String} dataProviderID element data provider
 * @param {Boolean} edited is the record edited
 *
 * @returns {String} row background color
 *
 * @properties={type:12,typeid:36,uuid:"140035FE-2336-48AC-9125-C229F5B20806"}
 */
function highlightImportChangesFromMapInterface(index, selected, elementType, dataProviderID, edited)
{
	var green = '#e9fce9';
	var greenSelected = '#d9f1d9';
	var blueSelected = '#b5d5ff';
	var white = '#ffffff';
	
	var query = 
		"SELECT attribute_name_internal_export, attribute_name_internal_import\
		FROM mapinfo_interfaces\
		WHERE is_station = 0\
		AND is_imported = 1\
		AND can_be_written = 1\
		AND is_saved = 1";
	/** @type {JSDataSet} */
	var dataset = databaseManager.getDataSetByQuery('trackit', query, null, -1);
	
	for (var i = 1; i <= dataset.getMaxRowIndex(); i++) {
		// Find track value
		var trackValue = mid_tracks_update_source_for_tracks.getDataProviderValue(dataset.getValue(i, 1));
		
		// Find mid track value (imported value)
		var midTrackValue = _mid_tracks_to_same_mid_tracks.getDataProviderValue(dataset.getValue(i, 2));
		
		if ((!trackValue && midTrackValue) || (trackValue && trackValue != midTrackValue)) {			
			if (selected) {
				return greenSelected;
			}
			else {
				return green;
			}
		}
	}
	if (selected) {
		return blueSelected;
	}
	else {
		return white;
	}
}

Regards, Stefan

i don’t know why you get that, you shouldn’t have but when i test it in the latest code it works fine
If you do a full build or really change and save the file is that warning still there?

The Warning stays if I change something in the file and save it.

If I make a new Build it stays too. This Function is a Calculation for the RowBGColor. Is the Problem that it is a calculation?

Regards, Stefan

yes you are right,
this is not easily fixable, because it is a calculation, and a calculation shouldn’t really have arguments (but i know our old style bg color calc had that)
For the javascript editor the function doesn’t really exists, its a variable not a function, and because of that we loose the params

Ok so changing to the new Style is the solution for this problem.

Thanks for Help

Regards, Stef