#17282

Stefan
Participant

Good example of utilizing “OutputBar”, thanks.

If you are interested, you can modify your script with some details like shown here:


// do not update the screen during our work:
	Redraw = false;
	
// get and store current cursor position:
	yPos = document.selection.GetActivePointY( eePosLogical );
	xPos = document.selection.GetActivePointX( eePosLogical );

// ask the user:
	var strAnswer = prompt( "find what ?", "\\w+" );  

// do the work; search for occurrences:
	var count=0; 
	while ( document.selection.Find( strAnswer, eeFindNext | eeFindReplaceRegExp) )
	 {   count++;  }   

// provide the result to the output bar:
	OutputBar.Clear(); 
	OutputBar.writeln( "find count for \"" + strAnswer + '\" after column ' 
	                                 + xPos + ' of  row ' + yPos + ': ' + count );
	OutputBar.Visible = true; OutputBar.SetFocus();   

// erase search highlighting:
	document.HighlightFind = false;

// go back to origin cursor position:
	document.selection.SetActivePoint( eePosLogical, xPos, yPos, false );

Keep up! 😉