home *** CD-ROM | disk | FTP | other *** search
Wrap
<?xml version="1.0" encoding="utf-8"?> <html><head><title>MsgBox Function [Runtime]</title><meta name="filename" content="text/sbasic/common/03010102"/><help:css-file-link xmlns:help="http://openoffice.org/2000/help"/><!--The CSS style header method for setting styles--><style type="text/css"> p.P1{ } span.T1{ font-weight:bold;} </style></head><body> <help:to-be-embedded Eid="msgbox" xmlns:help="http://openoffice.org/2000/help"> <p class="Head1"><help:link Id="66524">MsgBox Function [Runtime]</help:link></p> <p class="Paragraph">Displays a dialog box containing a message. This function allows you to define a button used to confirm the dialog.</p> </help:to-be-embedded> <p class="Paragraph"><span class="T1">Syntax</span>:</p> <p class="Paragraph">MsgBox (Text As String [,Type As Integer [,Dialogtitle As String]]) <help:key-word value="MsgBox" tag="kw66524_1" xmlns:help="http://openoffice.org/2000/help"/></p> <p class="Paragraph"><span class="T1">Return value</span>:</p> <p class="Paragraph">Integer</p> <p class="Paragraph"><span class="T1">Parameter</span>:</p> <p class="Paragraph">Text: String expression displayed as a message in the dialog box. Line breaks can be inserted with Chr$(13). Only the first 255 characters of a string are displayed; all remaining characters are disregarded.</p> <p class="Paragraph">DialogTitle: String expression displayed in the title bar of the dialog. If omitted, the name of the respective application is displayed.</p> <p class="Paragraph">Type: Any integer expression that specifies the dialog type and defines the number and type of butons or icons displayed. <span class="T1">Type</span> represents a combination of bit patterns, i.e., dialog elements can be defined by adding the respective values:</p> <p class="Paragraph"><span class="T1">Values</span></p> <p class="Paragraph">0 : Display OK button only.</p> <p class="Paragraph">1 : Display OK and Cancel buttons.</p> <p class="Paragraph">2 : Display Cancel and Retry buttons.</p> <p class="Paragraph">3 : Display Yes, No, and Cancel buttons.</p> <p class="Paragraph">4 : Display Yes and No buttons.</p> <p class="Paragraph">5 : Display Retry and Cancel buttons.</p> <p class="Paragraph">16 : Add the Stop icon to the dialog.</p> <p class="Paragraph">32 : Add the Question icon to the dialog.</p> <p class="Paragraph">48 : Add the Explanation icon to the dialog.</p> <p class="Paragraph">64 : Add the Information icon to the dialog.</p> <p class="Paragraph">0 : First button in the dialog as default button.</p> <p class="Paragraph">256 : Second button in the dialog as default button.</p> <p class="Paragraph">512 : Third button in the dialog as default button.</p> <p class="Paragraph"><span class="T1">Return value:</span></p> <p class="Paragraph">1 : OK</p> <p class="Paragraph">2 : Cancel</p> <p class="Paragraph">4 : Retry</p> <p class="Paragraph">5 : Ignore</p> <p class="Paragraph">6 : Yes</p> <p class="Paragraph">7 : No</p> <p class="Paragraph">The MsgBox function returns a value indicating which button the user has chosen. The following return values are possible:</p> <p class="Paragraph"><span class="T1">Return value</span></p> <p class="Paragraph">1 : OK</p> <p class="Paragraph">2 : Cancel</p> <p class="Paragraph">4 : Retry</p> <p class="Paragraph">5 : Ignore</p> <p class="Paragraph">6 : Yes</p> <p class="Paragraph">7 : No</p> <p class="Paragraph"><span class="T1">Example:</span></p> <p class="PropText">Sub ExampleMsgBox</p> <p class="PropText">Dim sVar as Integer</p> <p class="PropText">sVar = MsgBox("Las Vegas")</p> <p class="PropText">sVar = MsgBox("Las Vegas",1)</p> <p class="PropText">sVar = MsgBox( "Las Vegas",256 + 16 + 2,"Dialog title")</p> <p class="PropText">end sub</p> <p class="PropText"/> </body></html>