Функція InputBox

Відображає запрошення, за яким користувач може ввести текст. Введене значення присвоюється змінній.

Інструкція InputBox є зручним методом введення тексту через діалогове вікно. Підтвердіть його, натиснувши кнопку "Гаразд" або клавішу ENTER. Результат передається як обчислене значення функції. Якщо це діалогове вікно можна закрити за допомогою кнопки "Скасувати", InputBox повертає рядок нульової довжини ("").

Синтаксис:


InputBox (Prompt As String[, Title As String[, Default As String[, xpostwips As Integer, ypostwips As Integer]]]) As String

Параметри:

prompt: String expression displayed as the message in the dialog box.

title: String expression displayed in the title bar of the dialog box.

default: String expression displayed in the text box as default if no other input is given.

xpostwips: Integer expression that specifies the horizontal position of the dialog. The position is an absolute coordinate and does not refer to the window of LibreOffice.

ypostwips: Integer expression that specifies the vertical position of the dialog. The position is an absolute coordinate and does not refer to the window of LibreOffice.

If xpostwips and ypostwips are omitted, the dialog is centered on the screen. The position is specified in twips.

Повертає значення:

Рядок

Приклад:


Sub ExampleInputBox
Dim sText As String
    sText = InputBox ("Введіть фразу:","Шановний користувач")
    MsgBox ( sText , 64, "Підтвердження фрази")
End Sub

Будь ласка, підтримайте нас!