Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date function

Status
Not open for further replies.

mok

Programmer
Joined
Feb 20, 2000
Messages
1
Location
MY
how to set a textbox for displaying today's date ?<br>

<br>


 
Hi mok,<br>
You didn't tell what programing language that you use<br>
<br>
tonni
 
Here is a routine you can use<br>
<br>
<br>
*/***************************************************************************<br>
*/Program : function MSGNWAIT<br>
*/System :<br>
*/Purpose : Places a one line window message on screen and leaves it there<br>
*/Syntax : = MsgNWait(Msg,Row,Clm,Color)<br>
*/Returns : Logical .t. if successful<br>
*/Parameter : String - Msg - Text to be displayed in the window<br>
*/ : Integer - Row - (Optional) Top left screen row of message box<br>
*/ : Integer - Clm - (Optional) Left Most Screen Column Of The Message Box<br>
*/ : Integer - Color - (Optional) Color Of Message (In case You do Not Like My Choice)<br>
*/Default : Row = C_TopRow<br>
*/ : Clm = C_TopClm<br>
*/ : Color = 5<br>
*/Requires : Nothing<br>
*/Changes : Nothing<br>
*/Calls : Nothing<br>
*/Calls :<br>
*/Version : 1.0<br>
*/Dated : 22/05/1989<br>
*/Written By: David W. Grewe<br>
*/***************************************************************************<br>
*& Message<br>
*/***************************************************************************<br>
*/ Record Of Change<br>
*/<br>
*/***************************************************************************<br>
parameters P_MSG, P_ROW, P_CLM, P_CLR<br>
private P_MSG, P_ROW, P_CLM, L_PARA, L_LEN<br>
L_PARA = parameters()<br>
if L_PARA &lt; 1 .or. type(&quot;P_Msg&quot;) # &quot;C&quot;<br>
P_MSG = &quot; &quot;<br>
release window MSGNWAIT<br>
return<br>
endif<br>
if L_PARA &lt; 2 .or. type(&quot;P_Row&quot;) # &quot;N&quot;<br>
P_ROW = srows()/2+1<br>
endif<br>
if L_PARA &lt; 3 .or. type(&quot;P_Clm&quot;) # &quot;N&quot;<br>
P_CLM = (scols()-len(P_MSG))/2<br>
endif<br>
if L_PARA &lt; 4 .or. type(&quot;P_CLR&quot;) # &quot;N&quot;<br>
P_CLR = 5<br>
endif<br>
*<br>
L_LEN = len(P_MSG)+2<br>
if (P_CLM+L_LEN) &gt; scols()<br>
P_CLM = scols()-L_LEN<br>
endif<br>
*<br>
if wexist(&quot;MSGNWAIT&quot;)<br>
release window MSGNWAIT<br>
endif<br>
*<br>
LcWINONTOP=woutput()<br>
if !empty(LcWINONTOP)<br>
define window MSGNWAIT at P_ROW,P_CLM size 3,L_LEN double color scheme P_CLR in window (LcWINONTOP)<br>
else<br>
define window MSGNWAIT at P_ROW,P_CLM size 3,L_LEN double color scheme P_CLR<br>
endif<br>
activate window MSGNWAIT top<br>
@ 1,1 say P_MSG<br>
*<br>
if !empty(LcWINONTOP)<br>
if LcWINONTOP != &quot;MSGNWAIT&quot;<br>
on error **<br>
activate window (LcWINONTOP) same<br>
on error<br>
endif<br>
endif<br>
*<br>
release P_MSG, P_ROW, P_CLM, P_CLR, L_PARA, L_LEN<br>
return &quot; &quot;<br>

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top