|
GetText
The GetText function opens a dialog to
request a multi-line text string. If you click [OK], the entered
text is returned.
Syntax
sText, bOK = GetText()
sText, bOK = GetText( s )
sText, bOK = GetText( s, sPrompt )
sText, bOK = GetText( s, sPrompt,
sTitle )
s is the initial text string and may contain new
lines separated using \r\n pairs, If
nil, a blank string is used.
sPrompt is the message above the text field. If
nil, a default prompt is used.
sTitle is the window title. If
nil, a default title is used.
If
[OK] is clicked,
the function returns the text and bOK=true.
If the dialog
is canceled, "",false is returned.
Remarks
All arguments are optional and assume default
values beyond the last argument you specify. In order to use a
default argument but follow it with a specified argument, use a
nil in its place.
If the string uses
multiple lines, the string should be formatting using the
\r\n escape sequence (the so-called
carriage return / line feed pair) to separate the lines.
Example
The window shown above was created using the
following code. The last argument, the window title, was omitted
and left to the default:
|
sText, bOK = GetText(
|
|
|
"It is a tale
told by an idiot\r\n" ..
|
|
|
"full of
sound and fury\r\n" ..
|
|
|
"signifying
nothing...",
|
|
|
"Enter some
Shakespeare :" )
|
|
Related Topics
GetString
Mira Pro x64 Script User's Guide, v.8.76 Copyright Ⓒ 2024
Mirametrics, Inc. All Rights Reserved.
|