Difference between revisions of "PCOUNT()"

From Lianjapedia
Jump to: navigation, search
 
(One intermediate revision by the same user not shown)
Line 6: Line 6:
  
 
==See Also==
 
==See Also==
[[FUNCTION]], [[PARAMETERS]], [[PROCEDURE]], [[RETURN]], [[SET PROCEDURE]]
+
[[FUNCTION]], [[GETPARAMETER()]], [[PARAMETERS]], [[PROCEDURE]], [[RETURN]], [[SET PROCEDURE]]
  
 
==Description==
 
==Description==
Line 26: Line 26:
 
</code>
 
</code>
  
==Products==
 
Lianja, Lianja Server
 
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Functions]]
 
[[Category:Functions]]

Latest revision as of 10:00, 19 May 2014

Purpose

Function to return number of parameters passed

Syntax

PCOUNT()

See Also

FUNCTION, GETPARAMETER(), PARAMETERS, PROCEDURE, RETURN, SET PROCEDURE

Description

The PCOUNT() function is synonymous with the PARAMETERS() function. The PCOUNT() function returns the number of parameters passed to a procedure or function. These functions are useful for checking that the correct number of parameters has been passed to a procedure or function.

Example

function print
parameter m_file,m_filter,m_options
if pcount() <>3
    set message to "3 parameters must be passed."
    return .F.
else
    set filter to &m_filter
    report form &m_file &m_options to print
    set filter to
endif
return .T.