Print routine

[Total: 0    Average: 0/5]

This file shows how to define a simple “print” routine.

Body Code:

<script language=JavaScript>
function print(){
  if (!print.arguments.length)
    document.writeln('<BR>')
  else {
    for (var i=0;i<print.arguments.length;i++) {
	  document.writeln(print.arguments[i]+'<BR>')
    }
  }
}
print()
print('This HTML file shows how to define a simple "print"');
print('routine.');
print
print('It also shows how to determine on the fly',
      'the number of arguments to a function')
</script>

Times Viewed: 2

Leave a Reply

Your email address will not be published. Required fields are marked *