Good resources for writing console style applications for Windows? - windows

For certain programs nothing beats the command line. Unfortunately, I have never seen good documentation or examples on how to write console applications that go beyond "Hello World". I'm interested in making console apps like Vim or Emacs. Well not exactly like Vim or Emacs but one that takes over the entire command prompt while it is in use and then after you exit it leaves no trace behind. I know that on Unix there is the curses library but for Windows? ...

PDCurses works on Win32.

I found List of Console Functions on msdn, PDCurses, and The Console Module.

You can certainly write that kind of application with Delphi, which has reasonable commandline support. People often overlook that Delphi can build any kind of Windows executable, not just GUI apps.
I don't know off-hand if the free 'Turbo' edition of Delphi has anything cobbled into it to PREVENT you from using it to build console apps - I would have thought it would be fine for this kind of thing.

There is a small but good tutorial on using C++ for the Windows console at www.benryves.com/tutorials/?t=winconsole&c=all going as far as coding a simple painting program.

You could also try Free Pascal. It is a free ((L)GPL) Object Pascal compiler which is compatible with the Delphi-compiler. It has an console-based IDE, which proves that you can make very good console-applications with it, and which you can use as an example.
If you want to use a graphical IDE to build your console-application, you can download the Lazarus IDE.
As a bonus your application will run on Windows (32/64 bit), Linux, Mac OS X, FreeBSD, Solaris etc...

In Windows or DOS, I used the conio library from Borland. It's very old but fine enough for a beginner like me.

As Robsoft says Delphi would be a good start. There is Turbo Delphi (Pascal based) or Turbo C++ both free editions.
web site here.
http://www.turboexplorer.com/

Check out some of the mono libs. They have a great one to parse command line arguments but can't remember the namespace.
Miguel just posted some terminal code as well.

For ncurses-like library/framework on Windows, I'll highly suggest to get your hand dirty with PDCurses.
If you trying/using C#, there's Curses-Sharp.

This is the best tool for it I've ever seen!!
1) Create any application using VB6 IDE
2) Convert it to Console Application, using THIS!

Related

Delphi cross compiler for linux

I was wondering if there is any Borland cross compiler that can make my windows code work on linux without wine.I'm using winxp with delphi 7. I was always wondering if it was possible to code same tool I coded in windows , again in Linux and how is it possible to code same tool by using pascal code in linux.Thanks
The best solution is Lazarus, the delphi-like GUI for Free Pascal. If you were using "pure" vcl, without Windows internales or any special add-ons the migration will be a pice of cake :)
Take a look here: http://lazarus.freepascal.org
BTW - Lazarus and FPC are true mulitplatform - you can compile code for Linux, Windows, MacOS and more with the same codebase :)
Your only option, if you want a Borland Delphi cross-compiler, is CrossKylix. This isn't a real cross-compiler. Instead you run the Kylix compiler for Linux under an emulated Linux environment.
Note that you'll be forced to use CLX rather than VCL and that Kylix is well and truly dead nowadays. Personally I think Wine is probably an easier and better option.
First of all, it all depends on what system functions you used in your programm. In most cases, there will be no possibility to cross-compile it under linux.
But, in some cases Borland Kylix can help, but, afaik, it's almost dead now.
Delphi 10.2 Tokyo supports Linux 64-bit Native Code Compilations.
To get some preview screenshots, click this post:
https://helloacm.com/delphi-compiles-code-to-linux-64-bit-server/

Windows IDE for Unix application?

We have created C&C++ applications based on Aix 6.1 (fortran for some models).
To improve our productivity (we use emacs or vi as editor, xlc/xlC/xlf as compiler, dbx to debug, IBM Synergy as configuration management tool), we are looking for an windows IDE to allow:
to modify our source code more easily,
to compile as if we are under unix
We also are logging for a graphical debugger.
Thank you for some ideas
I think that Emacs has been ported to Windows. And also GCC and Gnu make.
I've had some success with remote developing for AIX/Unix on Windows via a couple of routes.
Eclipse has some options. You can "mount" your project via ssh/rcp, and it will run the compiler remotely capturing the output. I did't attempt debugging but I assume support is there as well, especially if you use gdb.
BVRDE is another option. Works nicely. This link is also valid.
I also worked with XBuildStudio, it has some similar features to BVRDE.
Give them a try and see if any of them work for you.
Eclipse is a good one, but personally I prefer Codeblocks with Fortran plugin.

How to make this kind of text UI?


			
				
Use a text UI library. The Curses library used to be a popular option, but it is limited by copyrights.
Fortunately, there is an uncopyrighted version available.
This is called the "Console" mode.
Depending on your development environment and language of choice, it can be as simple as Ctrl+Shift+N, "Console Project" (in Visual Studio), or tweaking compiler flags (for C++). Every IDE/language provide a way to do this.
In Windows, the Console operates in two ways. Firstly, any project can create, attach to, and modify any number of console windows whenever it wants. Secondly, with a special flag in the EXE, the project will start up already attached to a console.
The latter operates subtly differently from the former. If you want a "normal" console application, I strongly suggest against creating and attaching to consoles. Just use the Console mode compiler setting.
Clipper was a popular way to do this in DOS.
I guess this is an old Clipper program. I so, there is still active support and even GUI libraries. I suggest you try xharbour. It's not DOS anymore but pure windows based. There is a free version and a pay version (visual xHarbour). With this tool you can even access SQL databases and it's 100% clipper compatible.

Coming from making Windows-only programs in C#, what steps are there for developing for Linux AND Windows?

I want to start making a little window-based program that runs on both Linux and Windows flawlessly.
It must have a GUI. What are the things I should be reading about? I'm completely in the dark regarding this.
Thank you.
If you want to leverage your C#/.NET knowledge (IronPython,...), you should go with Mono. Its IDE is called MonoDevelop and works in Linux, Mac and Windows. You can keep using WinForms or switch to Gtk#, which is a nice wrapper around gtk+.
Also, make sure you read the application portability guidelines which covers different strategies and common pitfalls.
Enjoy!
You could try Java and run the same compiled bytecode in both places. Or try C++ with Qt or wxWidgets. With C++ though you will have to compile for each platform. Another possibility is Tcl/Tk
As a C# developer, I'd suggest Java with the Swing toolkit. NetBeans helps you get started easily, like Visual Studio.
Download, install, create a new prject, and there you have it; a form in front of you to drop controls and hook up to the code just like in VS + C#, except it's cross-platform (write once, run anywhere). And the language is very similar to C# (which was actually inspired by it). There are also countless books to help you get started with Java and GUI development in it too.
If you don't like Java for some reason, and you're willing to learn/use C++ (with extensions), have a go at Qt, and the Qt SDK, which includes a form designer as well, with a really nice IDE GUI. If you know C++, Qt should be a breeze. It's also cross-platform (write once, compile anywhere).
Good luck.
If you want to utilize your C# knowledge, you might want to have a look at Mono. But there are many, many other alternatives too.

quick way to scripting or creating programs on Windows?

what's a good way to scripting or creating programs unders windows?
How about python?
You will need Notepad, and to learn JScript (not Javascript... JScript), VBScript or Batch. Then you can easily create small scripts, somewhat equivalent to bash shell scripts on Linux.
For the first two, you can read the Windows Script Host documentation.
Windows Powershell is becoming the new Windows scripting language. Being a full .NET language, it is inevitably much more powerful that the horrible old batch scripts one used to have to write (and still retains much of the syntactic sugar of scripting/shell languages).
You can do VBScript without the need to install anything.
Open notepad and enter the following text:
MsgBox "Hello"
Save it as filename.vbs
Double click the file you just created, congratulations - you just created and ran a VBScript.
I'd like to plug AutoIt. It's a free download and comes with it's own editor that can be quickly/easily installed anywhere. The language is very rich and comes with a large library of user defined functions. Integrated context-sensitive help with syntax display. There's even a GUI editor. A final plus is that it compiles to .exe so will run on any win2k/xp/vista/2k3/2k8/7 PC.
I always use Python for scripting on Windows.
A vague question usually gets a vague response.
Download a compiler or interpreter and find a tutorial.
With more information we can better point you in the right direction
I would say there are three clever choices here:
Scripting: Use JSCRIPT because much of what you learn about JSCRIPT can be used in Javascript. You can either graduate to Javascript/AJAX in the browser, or Microsoft .HTA apps.
Or, you could use Python because it has standard modules to do just about anything a sysadmin would do plus addons to access Windows .COM objects and WMI. You can then either graduate to Python on a UNIX platform, Jython (which is Python in the JVM) or IronPython which opens up the entire world of .NET for you.
And there is of course, the non-scripting choice which is about creating programs under Windows. If you choose this you probably have an end-game in mind that is beyond scripting, so start with SharpDevelop and IronPython. Then, as you gain confidence, start working with C# still using the same Sharpdevelop toolset. With this choice you can also graduate to UNIX applications using the MONO .NET environment although if you want to do GUI apps on UNIX you will need to use GTK# instead of Windows Forms.

Resources