Skip to content

write_stringWriteStringWriteStringwrite_stringT_write_stringπŸ”—

Short descriptionπŸ”—

write_stringWriteStringWriteStringwrite_stringT_write_string β€” Print text in a window.

SignatureπŸ”—

write_string( window WindowHandle, string String )void WriteString( const HTuple& WindowHandle, const HTuple& String )static void HOperatorSet.WriteString( HTuple windowHandle, HTuple stringVal )def write_string( window_handle: HHandle, string: MaybeSequence[Union[int, float, str]] ) -> None

Herror T_write_string( const Htuple WindowHandle, const Htuple String )

void HWindow::WriteString( const HTuple& String ) const

void HWindow::WriteString( const HString& String ) const

void HWindow::WriteString( const char* String ) const

void HWindow::WriteString( const wchar_t* String ) const (Windows only)

void HWindow.WriteString( HTuple stringVal )

void HWindow.WriteString( string stringVal )

DescriptionπŸ”—

write_stringWriteString prints StringstringValstring 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_extentsGetStringExtents).

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

write_stringWriteString 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_systemSetSystem with the flag β€˜flush_graphic’.

AttentionπŸ”—

If clipping at the window boundary is desired, exceptions can be switched off by texttt{set_check(β€˜~text’)}.

Execution informationπŸ”—

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

ParametersπŸ”—

WindowHandlewindowHandlewindow_handle (input_control) window β†’ (handle)HTuple (HHandle)HWindow, HTuple (IntPtr)HHandleHtuple (handle)

Window handle.

StringstringValstring (input_control) string(-array) β†’ (string / integer / real)HTuple (HString / Hlong / double)HTuple (string / int / long / double)MaybeSequence[Union[int, float, str]]Htuple (char* / Hlong / double)

Tuple of output values (all types).

Default: 'hello'"hello"

ResultπŸ”—

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

Combinations with other operatorsπŸ”—

Combinations

Possible predecessors

open_windowOpenWindow, set_fontSetFont, get_string_extentsGetStringExtents

Alternatives

fwrite_stringFwriteString

See also

set_tpositionSetTposition, get_string_extentsGetStringExtents, set_fontSetFont, set_systemSetSystem, set_checkSetCheck

ModuleπŸ”—

Foundation