SP_POPUPKSET

POPUPKSET()

  Short:
  ------
  POPUPKSET() Set a popup for hotkey access from a GET

  Returns:
  --------
  Nil

  Syntax:
  -------
  POPUPKSET(nKey,cProc,cVar,bPopup)

  Description:
  ------------
  When key <nKey> is pressed while in proc or function
  <cProc> and in get/variable <cVar>, the block <bPopup> will be
  evaluated.

  If <bPopup> returns a value, it will be assigned to
  the current get.

  Be sure to clear popups with POPUPKCLR() after the
  READ.

  Examples:
  ---------
   #include "inkey.ch"

   proc test
   b1 := {||msg("Character value"),"Bert"}
   b2 := {||msg("Logical value"),.t.}
   b3 := {||msg("Date value"),date()+100}
   b4 := {||msg("Number value"),123}

   v1 := space(10)
   v2 := .f.
   v3 := ctod("  /  /  ")
   v4 := 0

   POPUPKSET(K_F1,"TEST","V1",b1)
   POPUPKSET(K_F2,"TEST","V2",b2)
   POPUPKSET(K_F3,"TEST","V3",b3)
   POPUPKSET(K_F4,"TEST","V4",b4)

   @14,10 get v1      // if F1 is pressed here, b1 will be evaluated
   @15,10 get v2      // if F2 is pressed here, b2 will be evaluated
   @16,10 get v3      // if F3 is pressed here, b3 will be evaluated
   @17,10 get v4      // if F4 is pressed here, b4 will be evaluated

   read

   POPUPKCLR()

  Source:
  -------
  S_POPUPK.PRG

 

 

2 responses to “SP_POPUPKSET

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

  2. Pingback: SP Functions | 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.