What is the advantage to have a function or procedure created inside another function or procedure?

hidrau
hidrau used Ask the Experts™
on
Hello Guys,

This is an example:

procedure SumAllValue: Integer;
	   Function Sum_A_B(a, b : integer): Integer;
	   Begin 
	   End;
	Begin 

	  My code here calls the Sum_A_B(x,y)
	End;    

Open in new window


Is there any advantage using that way? Or would it be better to have it in a unit library or even create it for all my unit?

Is it only concept?

Thanks
Alexandre
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Senior Consultant
Most Valuable Expert 2011
Top Expert 2013
Commented:
BY having it inside the procedure, you are limiting the visibility to the function to that procedure.

You can only use it inside SumAllValue

mlmcc

Author

Commented:
thanks a lot

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial