Non Pritaable Character found

After installing the new version 6.42.0 i've been getting this error "Non Printable error found "
non print error

Is there some way that I can rectify this. This code was originally posted by fxshrat over here.

_SECTION_BEGIN("Relative Performance_modified");
/// Code source:
/// @link https://www.amibroker.com/kb/2015/08/29/how-to-add-symbol-labels-to-relative-performance-chart/
/// Added sorting in Chart title and Exploration output:
/// @link https://forum.amibroker.com/t/customize-title-chart/22313/4
/// by AmiBroker.com and fxshrat@gmail.com
/// !!! INSERT FILLED WATCHLIST IN PARAM WINDOW !!! PARAM  WINDOW -> CTRL+R
//SetChartOptions( 0, chartShowDates | chartShowArrows | chartDisableTooltips );
WatchlistName = ParamStr("Insert WatchList Name", "List 0");
fontsize = Param("Label font size", 10, 4, 30, 1 );
max_num = 200;// change at your own risk.
cat = categoryWatchlist;
wlnumber = CategoryFind(WatchlistName, cat); 
tickerlist = Name() + "," + CategoryGetSymbols(cat, wlnumber);
bi = BarIndex();
fvb = Status("firstvisiblebar");
sym_num = StrCount(tickerlist, ",")+1;
mat = Matrix(Min(sym_num, max_num), 2);
rownum = MxGetSize(mat, 0);
last_bar = BarCount-1;

for ( i = 0; ( symbol = StrExtract(TickerList, i ) ) != "" AND i < max_num; i++ ) {
	fc = Foreign( symbol, "C" ); 
	idx = Max(Min(NullCount(fc),last_bar), fvb);
	if (! IsNull(fc[ idx ])) {
		relP = 100 * (fc - fc[ idx ]) / fc[ idx ]; 		
		mat[i][0] = SelectedValue(relP); 
		mat[i][1] = i; 		
		x = LastValue(bi) + 1;
		y = LastValue(relP);
		VarSet("color"+i, colorBlue + ((2*i)%15));      
		AddColumn(relP, "RS-"+symbol, 1.2, color = Varget("color"+i));     
		Plot(relP, "\n"+symbol, color, styleNoLabel | styleNoTitle);        
		PlotTextSetFont(symbol, "Arial", fontsize, x, y, GetChartBkColor(), colordefault, -fontsize/2);
	}
}
//
PlotGrid( 0, colorDarkRed );
Param_dt = FirstVisibleValue(DateTime());
_N(Title = StrFormat( "WL(%g): %s, {{NAME}} - Start Date: %s, Relative Performance [%%]: {{VALUES}}", 
						wlnumber, WatchlistName, DateTimeToStr(Param_dt, 1))); 
SetChartOptions(0, chartWrapTitle | chartDisableTooltips);
//
mat = MxSortRows(mat, False, 0);
//_TRACE(MxToString(mat));
for ( i = 0; i < rownum; i++ ) {	
	val = mat[i][0];	n = mat[i][1];
	if (! IsNull(val)) {		
		sym = StrExtract(tickerlist, n);
		color = EncodeColor(Nz(Varget("color"+n)));
		Title += StrFormat("\n%s %s: %g", color,sym,val);		
	}
}
_SECTION_END();

_SECTION_BEGIN("change color");
SetChartBkGradientFill( ParamColor("BgTop", ColorRGB( 172,172,172 )),

ParamColor("BgBottom", ColorRGB( 172,172,172 )),ParamColor("titleblock",ColorRGB( 172,172,172 ))); 
_SECTION_END();

see here: AmiBroker 6.42.0 BETA released - #3 by Tomasz

1 Like

Thank you empottasch for showing me direction, I am still trying to figure out how to fix this..

Remove "\n" from the formula and replace it with something printable such as say semicolon "; "

Thank you Tomaz, yes that solved the issue, now I understand what the problem was.

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.