Function OutStd() Foundation

Outputs a list of expressions to the standard output device.

Syntax
OutStd( <Expression,...> ) --> NIL
Parameters
<Expression,...>
The list <Expression,...> contains expressions whose values are output. The expressions may be of any data type.
Return

The return value of OutStd() is always NIL.

Description

The output function OutStd() outputs to the operating system level and sends the values of <Expression,...> to the standard output device. It works much like the function QOut(), but does not use the common Xbase++ output routines.

Since the function OutStd() performs output on the operating system level, it can be re-directed using the re-directing operators (>, >> and |). For example, the output of an Xbase++ program may be re-directed to a file.

Instead of OutStd(), the output can be written using FWrite( FH_STDOUT, ...).

Examples
OutStd()
// The example demonstrates the use of OutStd(). 

PROCEDURE Main 
   LOCAL dDate := Date() 
   CLS 
   OutStd( "Today is", CDow(dDate)  + "," ,  CMonth(dDate),; 
              LTrim(Str(Day(dDate)))+ "," , Year(dDate) ) 
RETURN 
Redirect output to file with OutStd()

// In this example the output of the program SayDate 
// is redirected to a file. 

C:>SAYDATE.EXE > OUTPUT.ASC 
Writing to the standard output device
// The example demonstrates that FWrite() can be used instead 
// of OutStd(). No screen output is created in this example. 
// This is common practice in CGI programs. 

#include "fileio.ch" 

#define CRLF Chr(13)+Chr(10) 

PROCEDURE AppSys 
   // No application window = no screen output 
RETURN 

PROCEDURE Main 

   OutStd( "Hi Jo" ) 

   FWrite( FH_STDOUT, CRLF + "Have a good day!" ) 

RETURN 
Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.