CALENDWHEN() Uses GETDATE() function as a GET WHEN clause

  <lWhen> => when condition


  This sets up the popup GETDATE() function for use in
  a GET WHEN clause. (the pre validation block). If a date is
  selected, it is assigned to the get. The Calendar function will
  pop up upon entry into a GET field.

  [lShowOnUp] Normally you wouldn't want this WHEN to
  occur if the user is using the up arrow, and if <lShowOnUp> is
  .f. (the default) it does not occur (the GET is just skipped)

  [lReturn] If set to False (the default) the GET is
  never actually edited, as the WHEN will always return .f., but
  it is assigned the value returned by GETDATE(). By setting it to
  True, the Calendar will pop up, and then the GET will also be
  put through the normal get editor.


   proc test

   v1 := date()
   v2 := date()+1
   v3 := date()+1
   v4 := date()+1

   @10,10 get v1
   @11,10 get v2 when calendwhen(.f.) // calendar pops up  when the
                                   // get is entered. No  direct
                                   // editing.
   @12,10 get v3 valid calendvalid( {||v3>date()} )
   @13,10 get v4


  You might want to look at CALENDVALID() and
  CALENDKSET() for other options.



3 responses to “SP_CALENDWHEN

  1. Pingback: SP Get system Functions | Viva Clipper !

  2. Pingback: SP Functions | Viva Clipper !

  3. Pingback: SP_GETDATE | Viva Clipper !

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.