Dear Sir,
I have Created a recursive Function called SetLevel which has two Parameter one is
Para1 ( Datatype Code) and another is
Para2 ( Datatype Integer), and Para2 is using as Pass by Reference.
I Want this function should return the Para2 as Return Value (Return Type Integer).
Is it Possible as the way I want ?
Tab.Field :=SetLevel (Value1,Value2)
Tab.Modify;
Function SetLevel(HierarchyNo,Level)
Level +=1;
Cust2.SETRANGE("Hierarchy No.",HierarchyNo);
IF Cust2.FINDFIRST THEN
BEGIN
HLine2.SETRANGE("Customer No.",Cust2."No.");
IF HLine2.FINDFIRST THEN
BEGIN
SetLevel(HLine2."Hierarchy No.",Level);
END
ELSE
EXIT(Level);
END;
Here SetLevel does not give the value where value2 gives.
What is the reason ?
Kindly reply.
Thank you.