Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MESSAGEBOX question
Message
From
15/05/2002 12:31:40
 
 
To
14/05/2002 14:09:54
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00656351
Message ID:
00657007
Views:
30
I can never remember what all the number options for message box are, so i wrote a prg that i can call thus

lclreturnval = lclmsg("INFO","O","MESSAGE BOX TEXT","ALERT")

"message box text" can be a string as above or a variable constructed from other variables

for you !
if you improve it - pls send me a copy

lclmsg.prg


parameters lcltype,lclbtns,lcltext,LCLCAPTION

** lcltype = "WARN" / "ERR" / "INFO" / "QUERY"

** lclbtns = ok 0 "O"
** = ok / cancel 1 "OC"
** = abort /retry / ignore 2 "ARI"
** = yes / no / cancel 3 "YNC"
** = yes / no 4 "YN"
** = retry / cancel 5 "RC"

LCLTYPE = UPPER(LCLTYPE)
LCLBTNS = UPPER(LCLBTNS)
LCLTEXT = PROPER(LCLTEXT)
** lclcaption = box title =

* "<< ALERT >>"
* lcltext = message text

*midnum = picture / type and btns

midnum = 0

if lcltype = "WARN"
MIDNUM = MIDNUM + 16
endif
if lcltype = "ERR"
MIDNUM = MIDNUM + 48
endif
if lcltype = "INFO"
MIDNUM = MIDNUM + 64
endif
if lcltype = "QUERY"
MIDNUM = MIDNUM + 32
endif

IF LCLBTNS = "O"
MIDNUM = MIDNUM + 0
ENDIF
IF LCLBTNS = "OC"
MIDNUM = MIDNUM + 1
ENDIF
IF LCLBTNS = "ARI"
MIDNUM = MIDNUM + 2
ENDIF
IF LCLBTNS = "YNC"
MIDNUM = MIDNUM + 3
ENDIF
IF LCLBTNS = "YN"
MIDNUM = MIDNUM + 4
ENDIF
IF LCLBTNS = "RC"
MIDNUM = MIDNUM + 5
ENDIF

LCLRTN = MESSAGEBOX(LCLTEXT,MIDNUM,LCLCAPTION)

RETURN LCLRTN
Previous
Reply
Map
View

Click here to load this message in the networking platform