sven99
asked on
Console Application (for CGI)
Hi...
I want to develop a console application with Delphi, to use it as a CGI application. So I need to read/write from/to the standard in/output. How can I do this...?
Thanx
Sven
I want to develop a console application with Delphi, to use it as a CGI application. So I need to read/write from/to the standard in/output. How can I do this...?
Thanx
Sven
example:
program Project1;
{$APPTYPE CONSOLE}
uses
SysUtils;
{$R *.RES}
var
i: integer;
begin
Write('enter value:');
Readln(i);
Writeln('you entered: ' + inttostr(i));
Write('press ENTER to end the program');
Readln;
end.
program Project1;
{$APPTYPE CONSOLE}
uses
SysUtils;
{$R *.RES}
var
i: integer;
begin
Write('enter value:');
Readln(i);
Writeln('you entered: ' + inttostr(i));
Write('press ENTER to end the program');
Readln;
end.
ASKER
Thank you very much... do you mark the question to answered, that I can give you the Points...
Bye
Sven
Bye
Sven
Hello you two!
I know this that's the way to do a console app, and I've tried many other ways, and some kinda components, but never got it working. here is similar to what I get....When I try to run the app I get "This program can not run without Microsoft Windows", or something similar. I can't exactly see what it says because it closes it immediately and the app runs in the background. When I open the task menager by pressing Ctrl+Alt+Del and close the app so it stops running, my computer hangs up and the on;ly way to get out of that is ti press the Reset button. Any ideas on why it is doing that? or maybe what settings I need to set so it can run on my computer too...
regards,
Viktor Ivanov
I know this that's the way to do a console app, and I've tried many other ways, and some kinda components, but never got it working. here is similar to what I get....When I try to run the app I get "This program can not run without Microsoft Windows", or something similar. I can't exactly see what it says because it closes it immediately and the app runs in the background. When I open the task menager by pressing Ctrl+Alt+Del and close the app so it stops running, my computer hangs up and the on;ly way to get out of that is ti press the Reset button. Any ideas on why it is doing that? or maybe what settings I need to set so it can run on my computer too...
regards,
Viktor Ivanov
ASKER
Hmmm, I have tried it, ad it works... You can give me your EMail adress, and I will sent you my Testproject, including the EXE-File.
I use Borland Delphi 3.0 and Windows NT.
Bye
Sven
I use Borland Delphi 3.0 and Windows NT.
Bye
Sven
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanx.
ASKER
"victornet", you can reach me under sschaefer@interflex.de
{$APPTYPE CONSOLE}
in your project source
regs,
Black Death