spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / experts / javascript / column108


JScript .NET, Part II: Major Features

Vice President of Risk Technology - READY TO HIRE! (NYC)
Next Step Systems
US-NY-New York

Justtechjobs.com Post A Job | Post A Resume
Developer News
News Flash: Adobe Has iPhone Workaround
Adobe's Flash 10.1 Goes Mobile (Minus iPhone)
A Salute to Visionary CEOs


Printing

Use the print() function to send a string to the console, followed by a newline character. The print statement allows you to display data from a JScript .NET application compiled with the JScript .NET command-line compiler, jsc.exe. The print statement takes a single string as a parameter and displays it to the console. For example, the line:

print("Hello World!");

will send "Hello World!" to the console. You can use escape sequences to specify actions such as carriage returns and tab movement. Escape sequences are character combinations consisting of a backslash (\) followed by a letter or by a combination of digits. The combination "\n" is new line. The combination "\t" is tab.

The print statement is enabled by default in the JScript .NET command-line compiler, jsc.exe. You can disable it by using the /print- option. When there is no console to print to (for example, Windows GUI), the print statement will silently fail. Output from the print statement can be redirected to a file from the command line. If you want to make sure redirected output is correctly formatted, include the "\r" combination at the end of each printed line. It does not affect the way lines are displayed on the console.

The following print statement:

print("Student: \t" + student + "\nGrade: \t" + grade);

will yield the following console output:

Student:     John
Grade:       98


Next: How to define classes

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Building a Banking Application Home Page with OOP · Mixing Scripting Languages · Review: phpFox, a Social Networking CMS with all the Bells and Whistles
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Enterprise 2.0: Social Networking in the Cloud · BroadSoft Marketplace Hastens Pace of Telephony Innovation · Review: HTC Hero for Sprint


Produced by Yehuda Shiran and Tomer Shiran
All Rights Reserved. Legal Notices.
Created: April 22, 2002
Revised: April 22, 2002

URL: http://www.webreference.com/js/column108/5.html