>I want create my own function. >I used Set Procedure To , but I can't >call it from report. >How I can do this?
It's pretty straightforward. You need to create a .PRG file that contains your function; the value returned by your function will be displayed by the report.
For example, suppose I want a function that returns the area of a circle of a radius specified by some field value. I could create a .PRG as follows:
Within my report, I could then use the function CircleArea anywhere I wanted to put a numeric expression, as long as VFP could find CircleArea.PRG. If the function is a .PRG in and of itself, there's no need for SET PROCEDURE TO. SET PROCEDURE TO is only needed if the procedure is one of several procedures or functions within a single .PRG file - SET PROCEDURE TO makes VFP search the .PRG for PROCEDURE and FUNCTION names matching unresolved function names. For example, you might have a procedure library MyProcLib.PRG: