I am new to Delphi programming script and I am unable to call a procedure in a procedure in my console application.
My simple application is for an inventory of items passing through a telnet server in windows. I use the old thinkpad as my running linux linux and telnet client.
Using Delphi XE I came across a chicken or egg situation.
I get an unsclared indentifier addscreen ... it is declared, but under the main screen !!! If I add an additional screen procedure on the main screen, any call to the main screen in the additional screen procedure will make me an indentifier's unhandled main screen!
In simple words, how to make a procedure call everywhere in a program?
I tried the interface and implementation, but not valid in the console application!
program Project1; {$APPTYPE CONSOLE} uses SysUtils, windows, messages, Console in 'Console.pas'; procedure mainscreen; var choice: string; begin clrscr; writeln(' ------------------------------------------------------------------------------------------------------------------------------'); writeln(' | Inventory Management 0.1 ALPHA |'); writeln(' ------------------------------------------------------------------------------------------------------------------------------'); writeln(''); writeln(''); writeln(''); writeln(''); writeln(''); writeln(' Make a choice: Add(a), Remove(r), Edit(e), Backup Database(bd), Mass Add(ma), Mass Remove(mr)'); writeln('?:'); readln(choice); if choice = 'a' then addscreen else mainscreen; end; procedure addscreen; var choice: string; begin clrscr; writeln(' ------------------------------------------------------------------------------------------------------------------------------'); writeln(' | Add an Item |'); writeln(' ------------------------------------------------------------------------------------------------------------------------------'); writeln(''); writeln(''); writeln(''); writeln(' Not yet ready!'); writeln(' Press any key to return to the main menu...'); readln(choice); mainscreen; end; begin mainscreen; textbackground(black); textcolor(lightgray); ExitProcess(0); end.
Many thanks!
procedure delphi circular-reference
ELCouz
source share