main logo
Subject: Re: ErrorMsg Bug?
Author: Bob Archer
Posted: 2001/05/14 12:22:44
 
View Entire Thread
New Search


<i><font color="#663300">The following code is from the UTIL procedure library in CodeBook 3.0, 6.0 and 6.1:

<pre>
FUNCTION ErrorMsg(tcMessage, tnOptions, tcTitle)
LOCAL lnOptions, ;
lcTitle

IF PCOUNT() < 3
lcTitle = APPNAME_LOC
ENDIF

IF PCOUNT() < 2
lnOptions = MB_ICONEXCLAMATION
ENDIF

?? CHR(7)
MESSAGEBOX(tcMessage, lnOptions, lcTitle)
RETURN
ENDFUNC
</pre>

</font></i>

Yea, who wrote that code... you can just put elses on the if's:

<pre>
FUNCTION ErrorMsg(tcMessage, tnOptions, tcTitle)
LOCAL lnOptions, ;
lcTitle

IF PCOUNT() < 3
lcTitle = APPNAME_LOC
ELSE
lcTitle = tcTitle
ENDIF

IF PCOUNT() < 2
lnOptions = MB_ICONEXCLAMATION
ELSE
lnOptions = tcOptions
ENDIF

?? CHR(7)
MESSAGEBOX(tcMessage, lnOptions, lcTitle)
RETURN
ENDFUNC
</pre>



 
©2001 Bob Archer
<-- Prior Message New Search Next Message -->