Solved

Console Application (for CGI)

Posted on 1998-09-24
8
238 Views
Last Modified: 2013-11-18
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
0
Comment
Question by:sven99
  • 4
  • 3
8 Comments
 
LVL 1

Expert Comment

by:BlackDeath
Comment Utility
try
{$APPTYPE CONSOLE}
in your project source

regs,
Black Death
0
 
LVL 1

Expert Comment

by:BlackDeath
Comment Utility
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.
0
 

Author Comment

by:sven99
Comment Utility
Thank you very much... do you mark the question to answered, that I can give you the Points...

Bye
  Sven
0
 
LVL 10

Expert Comment

by:viktornet
Comment Utility
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
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:sven99
Comment Utility
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
0
 
LVL 1

Accepted Solution

by:
BlackDeath earned 50 total points
Comment Utility
you're welcome
0
 

Author Comment

by:sven99
Comment Utility
Thanx.


0
 

Author Comment

by:sven99
Comment Utility
"victornet", you can reach me under sschaefer@interflex.de
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now