MsgFrame

User dialog function.

The MsgFrame function displays a message.

Usage

Used to provide information feedback to the user without he needs to click any Yes/No/Cancel button.

Syntax

MsgFrame(<Text>,<Id>,[<x>],[<y>],[<size>][,<color>])
or
ret=MsgFrame(<Text>,[<x>],[<y>],[<size>][,<color>])

Parameters

<Text>, string to be displayed, constant or variable. The current font and size are used to display the <text>. The <text> is automatically displayed in the middle of the frame. If the <text> is too long, it's displayed on several lines unless no spaces are included in <text>. You can force a line feed by including \n\ in your <text>. If a number has to be displayed, it must be first converted to a string using Str$ function (see the example below).

<Id>, integer, identifier of this specific message. It can be a constant or a variable.

<x>,<y>, optional coordinates of the left-top point of the rectangle containing the message; if these parameters are not specified, the message is displayed in the middle of the screen. If these parameters would cause part of the rectangle to be displayed off-screen, the rectangle is automatically displayed at the top-left.
Instead of specifying coordinates, those keywords can be used:

<size>, optional integer, size of the font used to display the message (default value : 12).

<color>, optional integer, color of the text; the default value is black. Red is: 255, green is 65280, blue is 255 x 65536, white (sum of these three colors): 255 + (255x256) + (255x65536) = 16,777,215. If red, green and blue are the index of each color from 0 to 255, <color> is:
red+(green*256) + (blue*65536).

Return value

Ret, numeric return code. When the message frame is display successfully, the function returns 0, otherwise use this return code for Error Handling.

Remarks

When the script ends, all the messages are removed.

You can also remove them by using the RemoveFrame function.

If you want to display the & character, you need to double it: msgframe("A && B")

Examples

 

MsgFrame("Please wait",1) ' Displays the text "Please wait"

MsgFrame("Please wait",1,Center,Center) ' Displays the text "Please wait" in the middle of the screen
MsgFrame("The index is: "+str$(index),1) ' Displays the text "The index is: 3" if the index value is 3