ClassesClassesClassesClasses | | | | Operators

read_stringread_stringReadStringread_stringReadStringReadString (Operator)


read_stringread_stringReadStringread_stringReadStringReadString — Read a string in a text window.


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 ReadString(const HTuple& WindowHandle, const HTuple& InString, const HTuple& Length, HTuple* OutString)

HString HWindow::ReadString(const HString& InString, Hlong Length) const

HString HWindow::ReadString(const char* InString, Hlong 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)


read_stringread_stringReadStringread_stringReadStringReadString reads a string with a predetermined maximum size (LengthLengthLengthLengthLengthlength) 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:


finish input


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

If the global variable 'filename_encoding'"filename_encoding""filename_encoding""filename_encoding""filename_encoding""filename_encoding" has been set to 'utf8'"utf8""utf8""utf8""utf8""utf8" with set_systemset_systemSetSystemset_systemSetSystemSetSystem, read_string expects InStringInStringInStringInStringInStringinString to be UTF-8 encoded and returns OutStringOutStringOutStringOutStringOutStringoutString UTF-8 encoded.



WindowHandleWindowHandleWindowHandleWindowHandleWindowHandlewindowHandle (input_control)  window HWindow, HTupleHTupleHTupleHWindowX, VARIANTHtuple (integer) (IntPtr) (Hlong) (Hlong) (Hlong) (Hlong)

Window handle.

InStringInStringInStringInStringInStringinString (input_control)  string HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

Default string (visible before input).

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

LengthLengthLengthLengthLengthlength (input_control)  integer HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

Maximum number of characters.

Default value: 32

Restriction: Length > 0 && Length <= 1024

OutStringOutStringOutStringOutStringOutStringoutString (output_control)  string HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

Read string.


read_stringread_stringReadStringread_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_windowopen_windowOpenWindowopen_windowOpenWindowOpenWindow, set_fontset_fontSetFontset_fontSetFontSetFont


read_charread_charReadCharread_charReadCharReadChar, fread_stringfread_stringFreadStringfread_stringFreadStringFreadString, fread_charfread_charFreadCharfread_charFreadCharFreadChar

See also

set_tpositionset_tpositionSetTpositionset_tpositionSetTpositionSetTposition, new_linenew_lineNewLinenew_lineNewLineNewLine, open_windowopen_windowOpenWindowopen_windowOpenWindowOpenWindow, set_fontset_fontSetFontset_fontSetFontSetFont, set_colorset_colorSetColorset_colorSetColorSetColor



ClassesClassesClassesClasses | | | | Operators