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 popupvalid() http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 FUNCTION POPUPVALID()

  Short:
  ------
  POPUPVALID() Allows use of a popup for a GET VALID clause

  Returns:
  --------
  <lValid> => valid condition, get post-validation

  Syntax:
  -------
  POPUPVALID(bPopup,[bValid])

  Description:
  ------------
  This sets up a popup in <bPopup> for use in a GET
  VALID clause. (the post validation block). If a value is returned
  from the popup, it is assigned to the get.The popup function will pop
  up upon exit from the GET field.

  <bPopup> is a codeblock that is evaluated. It is
  passed the current value in the get as a parameter.

  [bValid]  - If you pass a validation codeblock, it
  will be checked first. If the GET is already valid, according to
  the codeblock, the popup will not be popped up. The codeblock
  must return a logical value.

  Examples:
  ---------

   // these are codeblocks that do a popup (in this case, a  simple
   //call to msg, and a return of a value)

   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

   // these are added in as valid clauses to the gets. The <bValid>
   // param is a codeblock that checks for the value being empty.

   @14,10 get v1 valid POPUPVALID(b1,{||!empty(v1)})
   @15,10 get v2 valid POPUPVALID(b2,{||!empty(v2)})
   @16,10 get v3 valid POPUPVALID(b3,{||!empty(v3)})
   @17,10 get v4 valid POPUPVALID(b4,{||!empty(v4)})

   read

  Source:
  -------
  S_POPVW.PRG


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