Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Grumpfish Library 3.2 - <b>getdate()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
GETDATE()

    GETDATE() is quite useful for entry of date variables.  It utilizes
    the point-and-shoot calendar routine of POPDATE.  The syntax is
    fairly simple:

    Syntax

    GETDATE([<date>] [, <top>] [, <left>] [, <color>])

    Required Parameters

    None

    Optional Parameter

    <date> is a date representing the initial date to be highlighted. If
    you do not pass this parameter, the system date will be used as
    default message will be 'Move to the desired date and press Enter'.

    <top> is a numeric expression representing the top row for the
    calendar window.  You may pass a value between 0 and 11.  If you do
    not pass this parameter, the top of the calendar will be drawn at
    row 6.

    <left> is a numeric expression representing the leftmost column at
    which to display the calendar.  You may pass a value between 0 and
    56.  If you do not pass this parameter, the left side of the
    calendar will start at column position 28.

    <color> is a character string representing the color with which to
    display the calendar window.  If you do not pass this parameter, the
    default is white on blue.

    Return Value

    No surprise here - GETDATE() returns a date variable.

    You may use the arrow and navigation keys to point to the
    desired date.  When you press Enter, the highlighted date will
    be returned.  If you press Esc, a null date (CTOD("  /  /  ")) will
    be returned.

    Sample usage

    This demonstrates the use of GETDATE() within a VALID clause to
    grab a date variable.  Note that the GET variable is passed by
    reference to GETDATE().

    ** Clipper Summer '87                                            
    mdate = GETDATE(DATE(), 0, 0, 'W/R')                             
    @ 10, 12 GET mdate VALID IF(! EMPTY(mdate), .T., GETDATE(@mdate))
    READ                                                             

    The syntax for 5.0 is somewhat different.  Summer '87 let us get
    away with returning a date value in the VALID clause, but 5.0 will
    not. Therefore, we must chain two expressions together so as to
    return a logical value (which in this example is True):

    /* Clipper 5.0 */                                 
    mdate = GETDATE(DATE(), 0, 0, 'W/R')              
    @ 10, 12 GET mdate VALID IF(! EMPTY(mdate), .T., ;
                               (GETDATE(@mdate), .t.))
    READ                                              

See Also: POPDATE()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson