ClassesClasses | | Operators

read_stringread_stringReadStringReadString (Operator)


read_stringread_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)

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

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

string HWindow.ReadString(string inString, int length)


read_stringread_stringReadStringReadStringReadString 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:


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" has been set to 'utf8'"utf8""utf8""utf8""utf8" with set_systemset_systemSetSystemSetSystemSetSystem, read_string expects InStringInStringInStringInStringinString to be UTF-8 encoded and returns OutStringOutStringOutStringOutStringoutString UTF-8 encoded.

Execution Information


WindowHandleWindowHandleWindowHandleWindowHandlewindowHandle (input_control)  window HWindow, HTupleHTupleHtuple (integer) (IntPtr) (Hlong) (Hlong)

Window handle.

InStringInStringInStringInStringinString (input_control)  string HTupleHTupleHtuple (string) (string) (HString) (char*)

Default string (visible before input).

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

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

Maximum number of characters.

Default value: 32

Restriction: Length > 0 && Length <= 1024

OutStringOutStringOutStringOutStringoutString (output_control)  string HTupleHTupleHtuple (string) (string) (HString) (char*)

Read string.


read_stringread_stringReadStringReadStringReadString 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_windowOpenWindowOpenWindowOpenWindow, set_fontset_fontSetFontSetFontSetFont


read_charread_charReadCharReadCharReadChar, fread_stringfread_stringFreadStringFreadStringFreadString, fread_charfread_charFreadCharFreadCharFreadChar

See also

set_tpositionset_tpositionSetTpositionSetTpositionSetTposition, new_linenew_lineNewLineNewLineNewLine, open_windowopen_windowOpenWindowOpenWindowOpenWindow, set_fontset_fontSetFontSetFontSetFont, set_colorset_colorSetColorSetColorSetColor



ClassesClasses | | Operators