PRINTWSFILEFIRST

Purpose:

Prints multiple Worksheets to sequentially numbered files.

Syntax:

PRINTWSFILEFIRST("filename", "wsname")

"filename"

-

A string. The destination filename template.

"wsname"

-

Optional. A string, the Worksheet name. Defaults to the current Worksheet.

Returns:

Nothing. The Worksheets are printed to sequential files using the current printer driver.

Example:

newworksheet(4);

W1: gnorm(1000, 1/1000);

W2: integ(W1);

W3: W1 * W2;

W4: integ(W3);

 

display(w1, w2);

printwsfilefirst(getmiscpath(1, 7) + "output.prt");

 

display(w3, w4);

printwsfilenext();

 

displayall;

printwsfilenext();

 

Prints W1 and W2 of the current Worksheet to "output.001.prt" located in the user's Documents folder.

 

Prints W3 and W4 of the current Worksheet to "output.002.prt" located in the user's Documents folder.

 

Prints all windows of the current Worksheet to "output.003.prt" located in the user's Documents folder.

Example:

newworksheet(2);

 

W1: gnorm(1000, 1/1000);

W2: integ(w1);

 

exportworksheet(getmiscpath(1, 7) + "Test1.dwk");

 

W1: gsin(1000, 1/1000);

W2: integ(w1);

 

exportworksheet(getmiscpath(1, 7) + "Test2.dwk");

 

W1: gsqr(1000, 1/1000);

W2: integ(w1);

 

exportworksheet(getmiscpath(1, 7) + "Test3.dwk");

 

printwsfilefirst(getmiscpath(1, 7) + "test.prt", getmiscpath(1, 7) + "Test1.dwk");

printwsfilenext(getmiscpath(1, 7) + "Test2.dwk");

printwsfilenext(getmiscpath(1, 7) + "Test3.dwk");

 

Creates three DWK Worksheet named "Test1.dwk", "Test2.dwk" and "Test3.dwk" in the user's Documents folder. The Worksheets are printed to the files "test.001.prt", "test.002.prt" and "test.003.prt" located in the user's Documents folder.

Remarks:

PRINTWSFILEFIRST and PRINTWSFILENEXT print multiple worksheets to sequentially numbered files based on a file template name. The resulting output files are of the form:

 

fname.ddd.ext

 

where fname is the path and file name portion of filename, ddd is a sequential integer value (e.g. 008) and ext is the extension portion of filename.

 

PRINTWSFILEFIRST and PRINTWSFILENEXT print the worksheet to sequential  files using the currently selected printer. Use File -> Print Setup to change the current printer.

 

Both internal Worksheets and external DWK Worksheets can be printed to a file.

 

If wsname is specified, the Worksheet is loaded prior to printing.

See Also:

DISPLAY

PRINT

PRINTALL

PRINTING AND PLOTTING FUNCTIONS

PRINTWS

PRINTWSFILE

PRINTWSFILENEXT