Class VCrt() Foundation
Class function of the VCrt class
Instances of the VCrt class provide a virtual text screen that can be used as the output device in character mode applications. It is designed for programming text mode window systems. A VCrt object is created, just like an Xbase Part, with the :new() method followed by a call to :create(), which requests resources from the operating system. Output appears on the virtual text screen after the VCrt object is defined as the output device. This is accomplished by passing the object to the SetAppWindow() function, or by its :select() method. The basic utilization of a VCrt object follows this pattern:
These two lines create a virtual text screen of 10 rows and 40 columns in size, position it at the coordinate 4, 4 on the physical screen, and define it as the output device. The most important aspect of being the output device is that the VCrt object controls keyboard, mouse and screen. All screen output is then limited to the area on the physical screen that is managed by the VCrt object. This applies to all functions performing screen output, be it QOut(), @...SAY, Browse() or MemoEdit(). When a VCrt is the output device, the origin for screen coordinates is no longer the upper left corner of the physical text screen but moved to the upper left corner of the virtual text screen. An output outside the virtual text screen is no longer possible. If a string has more characters than a VCrt object has columns, for example, the string is truncated when displayed (Function DisplOut()) or is displayed in multiple rows (Function QOut()).
A VCrt behaves just as the physical screen in text mode, except that it has its own coordinate system. All functions which retrieve information about the screen, like Row(), Col(), MaxRow() and MaxCol() for example, or those which define system settings, (SetColor() or SetCursor()), apply to the current VCrt object. When a new VCrt object is created, it uses system settings from the current one as default values and is displayed in the current window. This offers the possibility to display a VCrt object inside another one, and to program a scrollable virtual text screen that exceeds the size of the physical text screen.
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.