Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- ClipOn 3.0 Reference - c_noparm() http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 C_NOPARM()

 DESCRIPTION

 C_NOPARM() is used to evaluate parameters received by a user-
 defined function.  C_NOPARM() will determine whether a parameter
 passed to the user-defined function contains a value, has not been
 passed to the function, or was passed to the function, but is null.
 This can be used to check any type of parameter including
 character, numeric, date, logical, and array.

 SYNTAX

 C_NOPARM(expr)

 PARAMETERS

 expr (C/N/D/L/A) is the name of a parameter variable received by
 the user-defined function.  The parameter name must be passed in
 quotes ("P1").

 RETURNS

 C_NOPARM() returns true (.T.) if the parameter variable is empty (0
 for numerics, null for all other types), or false (.F.) if the
 variable contains a value.

 EXAMPLES

 s1 = "Character String"

 declare a1[10]

 && Call testfunc with different parameter types
 testfunc(s1,"",0,a1,ctod("  /  /  "))
 ...
 ...
 *----------------------------*
 FUNCTION testfunc
 parameters p1, p2, p3, p4, p5

 && The variable p1 will receive the string s1, which contains data.
 && This line says if p1 is empty or not passed, store a null string
 && to p1, else store p1 to p1.  This prevents p1 from being
 && undefined if no value was passed, without concern over the order
 && the parameters are received and allows default values to be
 && stored to a receiving parameter.
 ...
 p1 = iif(c_noparm("p1"), "", p1)  && Returns .F.

 p2 = iif(c_noparm("p2"), setcolor(), p2)  && Returns .T. Set p2 to
                                           && default color

 p3 = iif(c_noparm("p3"), 0, p3)   && Returns .F.

 p4 = iif(c_noparm("p4"), "", p4)  && Returns .T. - array a1 has no
                                   && value assigned to elements

 p5 = iif(c_noparm("p5"), date(), p5)   && Returns .T. (set p5 to
                                        && default date)
 return 0




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