Welcome to the Traders Laboratory Forums.
Coding Forum Collaborate, receive help, or discuss coding related issues.

Reply
Old 05-18-2009, 06:41 PM   #1

Tams's Avatar

Join Date: Sep 2008
Location: Geelong
Posts: 3,589
Ignore this user

Thanks: 2,026
Thanked 1,402 Times in 862 Posts



Print (EasyLanguage)

This thread is about the PRINT keyword in EasyLanguage


Print

Sends one or more specified expressions to the PowerLanguage Editor Output Log or another output target, if specified.
Any combination of string, true/false, numerical series, or numerical expressions can be specified.


Usage

Print([OutputTarget],Expression1,Expression2, etc.)

Parameter inside the square brackets is optional



Parameters

OutputTarget - an optional parameter; specifies an output target other then the PowerLanguage Editor Output Log; the parameter must be followed by a comma.

There are two optional output targets:

Printer

Specifies the default printer as the output target.

File("PathFilename")

Where: PathFilename - a string expression specifying the path and filename

Specifies an ASCII file as the output target; if the specified file does not exist, the file will be created.

If OutputTarget is not specified, the output will be sent to the PowerLanguage Editor Output Log.



Expression - a string, true/false, numerical series, or numerical expression; any number of valid expressions, separated by commas, can be used

A string expression must be enclosed in quotation marks:

"String Expression"


A numerical expression can be formatted to specify the minimum number of characters, including the decimal point, and the number of decimal places, to be used for the output:

Expression:C: D

Where:
C - minimum number of characters
D - number of decimal places

The default output format for a numerical expression is two decimal places and a minimum of seven characters.

If the number of decimal places in the numerical expression is more than the specified number, the value will be will be rounded off to the specified number of decimal places.

If the number of characters in the output is less than the specified minimum, leading spaces will be added to bring the output to the specified minimum value.



Examples

Print(.1);
will print 0.10 in the PowerLanguage Editor Output Log, with three leading spaces inserted

Print(1.555555:6:3);
will print 1.556 in the PowerLanguage Editor Output Log, with one leading space inserted

Print(Printer,"Print Test");
will send the string expression "Print Test" to the default printer

Print(File("C: \test.txt"),CurrentDate,CurrentTime );
will save the output of CurrentDate and CurrentTime to the test.txt file in the root directory of the C: hard drive


.
Tams is offline  
Reply With Quote
The Following User Says Thank You to Tams For This Useful Post:
aaa (05-23-2009)
Old 05-18-2009, 08:25 PM   #2

BlowFish's Avatar

Join Date: Mar 2007
Location: In Da House
Posts: 3,272
Ignore this user

Thanks: 129
Thanked 1,038 Times in 694 Posts



Re: Print (EasyLanguage)

It is probably worth mentioning that Print can be very useful for debugging something that runs but does not run correctly or to check that things are consistent.

You can use print statements to output variables or to help monitor the path of the program through loops and conditional statements.
BlowFish is offline  
Reply With Quote
The Following 2 Users Say Thank You to BlowFish For This Useful Post:
aaa (06-06-2009), Tams (05-18-2009)
Old 05-23-2009, 07:29 AM   #3
aaa

aaa's Avatar

Join Date: Jun 2008
Location: Switzerland
Posts: 440
Ignore this user

Thanks: 238
Thanked 278 Times in 135 Posts



Re: Print (EasyLanguage)

Quote:
inputs:
Length( 14 ) ;

if CurrentBar > Length then
Plot1( CMO( Length ), "CMO" ) ;
Plot2( 0, "Zero" ) ;
print( plot1 ) ;
In the CMI indicators nothing is printed in the output PLE window except 53.49

print( plot1 ) = what is this for ?

For debugging ?

In case of errors it will print them ?
aaa is offline  
Reply With Quote
Old 05-24-2009, 02:13 PM   #4

Tams's Avatar

Join Date: Sep 2008
Location: Geelong
Posts: 3,589
Ignore this user

Thanks: 2,026
Thanked 1,402 Times in 862 Posts



Re: Print (EasyLanguage)

It is supposed to print out the value of "plot1" at the end of each bar.
You can use the output for debugging,
or if it is output to a text file, for record keeping.


variations you can try:

print( text(plot1) ) ;

print( NumToStr(plot1, 6) ) ;

print( BarNumber, plot1 ) ;

print( " Date=", date, " Time=", time, " CMI=", plot1 ) ;
Tams is offline  
Reply With Quote
The Following User Says Thank You to Tams For This Useful Post:
aaa (05-24-2009)
Old 05-24-2009, 04:09 PM   #5
aaa

aaa's Avatar

Join Date: Jun 2008
Location: Switzerland
Posts: 440
Ignore this user

Thanks: 238
Thanked 278 Times in 135 Posts



Re: Print (EasyLanguage)

I like this one

print(File("Dtext.asc") ,plot1);
aaa is offline  
Reply With Quote
Old 06-04-2009, 10:43 PM   #6

Tams's Avatar

Join Date: Sep 2008
Location: Geelong
Posts: 3,589
Ignore this user

Thanks: 2,026
Thanked 1,402 Times in 862 Posts



Re: Print (EasyLanguage)

How I use the Print statement to debug:

http://www.traderslaboratory.com/for...ator-6101.html
Tams is offline  
Reply With Quote
The Following User Says Thank You to Tams For This Useful Post:
aaa (06-06-2009)
Old 06-06-2009, 05:46 AM   #7
aaa

aaa's Avatar

Join Date: Jun 2008
Location: Switzerland
Posts: 440
Ignore this user

Thanks: 238
Thanked 278 Times in 135 Posts



Re: Print (EasyLanguage)

Quote:
It is probably worth mentioning that Print can be very useful for debugging something that runs but does not run correctly or to check that things are consistent.

You can use print statements to output variables or to help monitor the path of the program through loops and conditional statements.
Everything is said, specially for perfect beginners.
aaa is offline  
Reply With Quote
Old 06-20-2009, 01:24 PM   #8

Tams's Avatar

Join Date: Sep 2008
Location: Geelong
Posts: 3,589
Ignore this user

Thanks: 2,026
Thanked 1,402 Times in 862 Posts



Re: Print (EasyLanguage)

I have posted a PRINT example here:
http://www.traderslaboratory.com/for...rint-6194.html





p.s.
it also uses the keyword FILEAPPEND.
Tams is offline  
Reply With Quote

Reply

Tags
debug, easylanguage, file, output, print

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Trendline (EasyLanguage) Tams Coding Forum 43 07-09-2011 01:36 AM
ADE - All Data Everywhere (EasyLanguage) Tams Trading Indicators 22 05-01-2010 02:48 AM
Transaction Tax Buried in the Fine Print ! zdo Trading and the Markets 14 01-28-2009 01:17 AM
Some EasyLanguage Help Please jjthetrader Coding Forum 8 06-02-2008 05:20 PM
Question regarding single print tails Nextek Market Profile 1 09-03-2006 10:07 AM

All times are GMT -4. The time now is 07:25 PM.
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
CS to VB integration by DeskLancer
©2006-2011 Traders Laboratory, All Rights Reserved.