Jump to content

VioWrtTTY: Difference between revisions

From EDM2
the api call created
m formatting
Line 1: Line 1:
== VioWrtTTY ==
== VioWrtTTY ==
; VioWrtTTY(string, strLength, videoHndl) :
; VioWrtTTY(string, strLength, videoHndl) : Writes the string to the display, with the current cursor position as the starting point.  When the write is finished, the cursor is moved to one position past the end of the string.
Writes the string to the display, with the current cursor position as the starting point.  When the write is finished, the cursor is moved to one position past the end of the string.


=== Parameters ===
=== Parameters ===
; string - [[OS2 API:DataType:CH|CH]] - input :
; string - [[OS2 API:DataType:CH|CH]] - input : Character string to be written.
Character string to be written.
; strLength - [[OS2 API:DataType:ULONG|ULONG]] - input : Length of the character string in bytes.
; strLength - [[OS2 API:DataType:ULONG|ULONG]] - input :  
;videoHndl - [[OS2 API:DataType:HVIO|HVIO]] - input : VIO presentation-space handle.
Length of the character string in bytes.
;videoHndl - [[OS2 API:DataType:HVIO|HVIO]] - input :
VIO presentation-space handle.
This value is to be zero, unless the caller is a Presentation Manager application.  If this is the case, the value need to be from [[OS2_API:VioCreatePS|VioCreatePS]].
This value is to be zero, unless the caller is a Presentation Manager application.  If this is the case, the value need to be from [[OS2_API:VioCreatePS|VioCreatePS]].


Line 33: Line 29:


=== Example Code ===
=== Example Code ===
  [[OS2 API:DataType:CH|CH]] string;
  [[OS2 API:DataType:CH|CH]]     string;
  [[OS2 API:DataType:ULONG|ULONG]]  strLength;
  [[OS2 API:DataType:ULONG|ULONG]]  strLength;
  [[OS2 API:DataType:HVIO|HVIO]]   videoHndl;
  [[OS2 API:DataType:HVIO|HVIO]]   videoHndl;
  [[OS2 API:DataType:APIRET|APIRET]] rc;
  [[OS2 API:DataType:APIRET|APIRET]] rc;
  ...
  ...

Revision as of 05:19, 1 May 2006

VioWrtTTY

VioWrtTTY(string, strLength, videoHndl)
Writes the string to the display, with the current cursor position as the starting point. When the write is finished, the cursor is moved to one position past the end of the string.

Parameters

string - CH - input
Character string to be written.
strLength - ULONG - input
Length of the character string in bytes.
videoHndl - HVIO - input
VIO presentation-space handle.

This value is to be zero, unless the caller is a Presentation Manager application. If this is the case, the value need to be from VioCreatePS.

Constants

None

Returns

APIRET with values of:

Module

Define (C/C++)

INCL_VIO

Export name/Ordinal

Calling conversion

Cdecl32

Example Code

CH     string;
ULONG  strLength;
HVIO   videoHndl;
APIRET rc;
...
rc = WioVrtTTY(string, strLength, videoHndl);
...

Related Functions

Notes

The behavior of VioWrtTTY is: If the string is at line's end it is continued on the next line. If the string is at the screen's end; the screen is scrolled until write is completed.

These items are treated as commands and not printable characters:

  • carriage return
  • line feed
  • backspace
  • tab
  • bell

Backspaces are not destructive. Tabs are expanded into 8-byte wide fields. VioWrtTTY is the only video function affected by ANSI.


Here is some documentation, based on my hello world.

The following is a prototype, that works with OpenWatcom 1.3.

APIRET VioWrtTTY( char *string, unsigned short length, unsigned short VioHandle );

To get the prototype do:

#define INCL_VIO

#include <os2.h>

The Control Program Programming Guide and Reference (that comes with the OS/2 Tool Kit 4.52) documents string as PCH, which is unsigned char * but that does not work with OpenWatcom 1.3.

The VioHandle must be 0, unless the caller is a Presentation Manager application, and then it must have been returned by VioCreatePS.

A sample, hello world:

#define INCL_VIO

#include <os2.h>

int main( int argc, char *argv[] )
{
        APIRET rc = VioWrtTTY( "Hello, VIO\n", // string to write
                               11,             // lenght of string to write
                               0 );            // VIO handle, must be 0
        return rc;
}


OS Version Introduced