HALCON Reference Manual 10.0.2
Table of Contents / Graphics / Text ClassesClassesClasses | | | Operators

read_stringread_stringread_stringReadStringReadString (Operator)

Name

read_stringread_stringread_stringReadStringReadString — Read a string in a text window.

Signature

read_string( : : WindowHandle, InString, Length : OutString)

Herror read_string(const Hlong WindowHandle, const char* InString, const Hlong Length, char* OutString)

Herror T_read_string(const Htuple WindowHandle, const Htuple InString, const Htuple Length, Htuple* OutString)

Herror read_string(const HTuple& WindowHandle, const HTuple& InString, const HTuple& Length, char* OutString)

HTuple HWindow::ReadString(const HTuple& InString, const HTuple& Length) const

void HOperatorSetX.ReadString(
[in] VARIANT WindowHandle, [in] VARIANT InString, [in] VARIANT Length, [out] VARIANT* OutString)

BSTR HWindowX.ReadString(
[in] BSTR InString, [in] Hlong Length)

static void HOperatorSet.ReadString(HTuple windowHandle, HTuple inString, HTuple length, out HTuple outString)

string HWindow.ReadString(string inString, int length)

Description

read_stringread_stringread_stringReadStringReadString reads a string with a predetermined maximum size (LengthLengthLengthLengthlength) from the keyboard in the input window (= output window). The string is read from the current position of the text cursor using the current font. The maximum size has to be small enough to keep the string within the right window boundary. A default string which can be edited or simply accepted by the user may be provided. After text input the text cursor is positioned at the end of the edited string. Commands for editing:

RETURN

finish input

BACKSPACE

delete the character on the left side of the cursor and move the cursor to this position.

Parallelization

Parameters

WindowHandleWindowHandleWindowHandleWindowHandlewindowHandle (input_control)  window HWindow, HTupleHTupleHWindowX, VARIANTHtuple (integer) (IntPtr) (Hlong) (Hlong) (Hlong)

Window identifier.

InStringInStringInStringInStringinString (input_control)  string HTupleHTupleVARIANTHtuple (string) (string) (char*) (BSTR) (char*)

Default string (visible before input).

Default value: '' "" "" "" ""

LengthLengthLengthLengthlength (input_control)  integer HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

Maximum number of characters.

Default value: 32

Restriction: (Length > 0) && (Length <= 1024)

OutStringOutStringOutStringOutStringoutString (output_control)  string HTupleHTupleVARIANTHtuple (string) (string) (char*) (BSTR) (char*)

Read string.

Result

read_stringread_stringread_stringReadStringReadString returns 2 (H_MSG_TRUE) if the text window is valid and a string of maximal length fits within the right window boundary. Otherwise an exception is raised.

Possible Predecessors

open_textwindowopen_textwindowopen_textwindowOpenTextwindowOpenTextwindow, set_fontset_fontset_fontSetFontSetFont

Alternatives

read_charread_charread_charReadCharReadChar, fread_stringfread_stringfread_stringFreadStringFreadString, fread_charfread_charfread_charFreadCharFreadChar

See also

set_tpositionset_tpositionset_tpositionSetTpositionSetTposition, new_linenew_linenew_lineNewLineNewLine, open_textwindowopen_textwindowopen_textwindowOpenTextwindowOpenTextwindow, set_fontset_fontset_fontSetFontSetFont, set_colorset_colorset_colorSetColorSetColor

Module

Foundation


Table of Contents / Graphics / Text ClassesClassesClasses | | | Operators
HALCON Reference Manual 10.0.2 Copyright © 1996-2011 MVTec Software GmbH