Functions and Directives

Function DispOut() Foundation

Displays a value on the screen or in the active window.

Syntax
DispOut( <Expression> [, <cColor> ] ) --> NIL
Parameters
<Expression>
<Expression> is an expression whose value is displayed.
<cColor>
The optional argument <cColor> defines the color for the display of <Expression>. If this argument is not included, <Expression>is displayed in the default color of the system colors defined with SetColor().
Return

The return value of DispOut() is always NIL.

Description

DispOut() displays the value of an individual expression at the current cursor position on the screen or in the active window. It is a simple output function which only displays values on the screen. The output device set with SET DEVICE is ignored by DispOut().

Examples
DispOut()
// The example displays a string in various colors 
// at the same position. SET DEVICE TO PRINTER is ignored. 

PROCEDURE Main 
   CLS 
   SetPos( 10, 10 ) 
   DispOut( "James Bond's BMW in red", "W+/R" ) 
   Inkey(0) 

   SetPos( 10, 10 ) 
   DispOut( "James Bond's BMW in green", "W+/G" ) 
   Inkey(0) 

   SetPos( 10, 10 ) 
   SET DEVICE TO PRINTER            // PRINTER is ignored 
   DispOut( "James Bond's BMW in blue", "W+/B" ) 

   DispOut( " DEVICE is PRINTER" ) // output occurs at 10, 33 
   SET DEVICE TO SCREEN 
RETURN 
DispOut() called from a code block
// The example outputs date and time at the lower left corner 
// of the screen. Note that the values for output are first 
// saved in an array and then displayed with AEval(). 
// The call to DispOut() occurs in a code block. 

PROCEDURE ShowTime 
   LOCAL  nRow   := Row() 
   LOCAL  nCol   := Col() 
   LOCAL  aArray := { { " Date: ", "W+ /B" }, ; 
                      {   Date()  , "GR+/B" }, ; 
                      { " Time: " , "W+ /R" }, ; 
                      {   Time()  , "GR+/R" }  } 

   SetPos( MaxRow(), 0 )             // set cursor to lower left 
                                     // display date and time 
   AEval( aArray, {|a| DispOut( a[1], a[2] ) } ) 
   SetPos( nRow, nCol )              // reset cursor to old position 
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.