write_string ( : : WindowHandle, String : )

Print text in a window.

write_string prints String in the output window starting at the current cursor position. The output text has to fit within the right window boundary (the width of the string can be queried by get_string_extents).

The font currently assigned to the window will used. The text cursor is positioned at the end of the text.

write_string can output all three types of data used in HALCON . The conversion to a string is guided by the following rules:

      - strings are not converted.
      - integer numbers are converted without any spaces before or 
        after the number.
      - floating numbers are printed (if possible) with a floating point 
        and without an exponent.
      - the resulting strings are concatenated without spaces.
For buffering of texts see set_system with the flag 'flush_graphic'.


Attention

If clipping at the window boundary is desired, exceptions can be switched off by set_check('~text').


Parameters

WindowHandle (input_control)
window -> integer
Window identifier.

String (input_control)
string(-array) -> string / integer / real
Tuple of output values (all types).
Default value: 'hello'


Result

write_string returns 2 (H_MSG_TRUE) if the window is valid and the output text fits within the current line (see set_check). Otherwise an exception handling is raised.


Parallelization Information

write_string is reentrant, local, and processed without parallelization.


Possible Predecessors

open_window, open_textwindow, set_font, get_string_extents


Alternatives

fwrite_string


See also

set_tposition, get_string_extents, open_textwindow, set_font, set_system, set_check


Module

Foundation



Copyright © 1996-2008 MVTec Software GmbH