/*---------------------------------------------------------------------

Hit ctrl-enter to execute.

Description:

	This example script shows how one can output tables using
	tabs that look nice.  These tables are the easiest to export
	to other software packages.
	
	Copyright © 1995, Gatan Inc.
	All rights reserved.
	Written by Chris Meyer & Sidnei Paciornik, 3/23/95.

---------------------------------------------------------------------*/

/*	This method outputs n number of tabs to the results window.  */

void ResultTabs( number n )
{
	while ( n > 0 )
	{
		result( "	" )
		n = n - 1
	}
}


/* 	This method outputs the specified string and then tabs to the given 
	tabstopnumber, calling on the ResultTabs method as required. */

void StringToTabStop( string s, number tabstopnumber )
{
	Result( s )
	ResultTabs( tabstopnumber - len( s ) / 4 )
}

// Call the StringToTagStop function for a variety of demonstration outputs
StringToTabStop( "One", 6 )
StringToTabStop( "1", 2 )
Result( "End of line\n" )

StringToTabStop( "Three", 6 )
StringToTabStop( "3", 2 );
Result( "End of line\n" )

StringToTabStop( "This is a test of 6", 6 )
StringToTabStop( "6", 2 );
Result( "End of line\n" )
