InputBox Function

Esitetään kehote valintaikkunassa, johon käyttäjä voi kirjoittaa tekstiä. Syöte sijoitetaan muuttujaan.

InputBox-lause on vaivaton tapa syöttää tekstiä valintaikkunan kautta. Syöte vahvistetaan joko OK-napsautuksella tai Return-painalluksella. Syöte palautetaan funktion palautusarvona. Jos valintaikkuna suljetaan Peruuta-painikkeella, InputBox palauttaa merkkijonon, jonka pituus on nolla ("").

Syntaksi:


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

Parametrit:

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.

Paluuarvo:

merkkijono (String)

Esimerkki:


Sub ExampleInputBox
Dim sText As String
    sText = InputBox ("Ole hyvä ja kirjoita sanonta:","Hyvä käyttäjä")
    MsgBox ( sText , 64, "Sanonnan vahvistus")
End Sub

Please support us!