Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- SuperLib 3.50 - function popupkset() http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 FUNCTION 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


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