[comp.lang.pascal] calling MAIN from a procedure

perrone@loligo.cc.fsu.edu (Perrone Ford) (01/18/89)

Hello netters,

	I have a query about procedures in Pascal.  I am fairly new to Pascal
but am well familiar in the concepts being a native C programmer.  I am in the
middle of writing a database application but have come upon a snag that I must
circumvent to finish the program.  Here is the scenario:

	I have gone from MAIN to a procedure which displays a menu of commands
	on the screen for the user to choose from.  All of the commands call other
	procedures.  The problm is that one of the choices is "Return to main
	menu" which lies in procedure main.  Must I take this menu out of the
	main program and put it in it's own seperate procedure.  In C its's 
	...it's simply a matterer of calling MAIN again...

Thanks for your time and assistance.

   Perrone T. Ford 

mark@hpcllmr.HP.COM (Mark Rozhin) (02/04/89)

sorry, in pascal the outer block (main) is a special animal.  often there
are initializations that happen there behind your back (like opening input
and output).

create a procedure 'main' and call it from the outer block.

mr