' CURTIME$(1.0)  Form Current Time String                  10/10/1992-07/10/2010
' ------------------------------------------------------------------------------
' Copyright (C) 1992-2010 by Vladimir Veytsel                      www.davar.net

' Type -------------------------------------------------------------------------

'    Function

' Description ------------------------------------------------------------------

'    CURTIME$ function returns formatted current time.

' Parameter --------------------------------------------------------------------

'    Pattern$  - Time formatting pattern consisting of:
'                HR  - Hour   of current day
'                MI  - Minute of current hour
'                SE  - Second of current minute
'                    - Any delimiters different from HRMISE

' Value ------------------------------------------------------------------------

'    Current time string unpacked according specified pattern.

' Notes ------------------------------------------------------------------------

'  - Empty (default) pattern is equivalent to "HR:MI".
'  - It is of paramount importance that delimiters should be different
'    from any of HRMISE characters.

' Examples ---------------------------------------------------------------------

'    CURTIME$("")        ="12:34"
'    CURTIME$("HR.MI")   ="12.34"
'    CURTIME$("HRMISE")  ="123456"
'    CURTIME$("HR:MI:SE")="12:34:56"
'    CURTIME$("HR.MI.SE")="12.34.56"
'    CURTIME$("HR-MI/SE")="12-34/56"

' External Function ------------------------------------------------------------

     #INCLUDE ONCE "TRANS"

' Start Function --------------------------------------------------------------

     FUNCTION CURTIME$(Pattern$)

' Form Pattern Default Value ---------------------------------------------------

     IF (LEN(Pattern$)=0) THEN Pattern$="HR:MI"

' Form and Return Function Value to the Point of Invocation --------------------

     CURTIME$=TRANS$(Pattern$,"HR-MI-SE",TIME$)

' Finish Function ---------------------------------------------------------------

     END FUNCTION