Rudamentary CONSOLE I/O Routines for Windows

From: Gary L. Scott (garyscott_at_ev1.net)
Date: 02/24/04


Date: Mon, 23 Feb 2004 22:38:10 -0600

I've uploaded a beta (actually more like alpha, but there isn't much to
them to go wrong) of a set of console IO routines for windows that
reduce the Windows API complexity considerably for a small subset of
functionality. I keep reading of console difficulties here and these
make it fairly easy to do the most basic things. These partially
duplicate quickwin, but are even simpler and should work with other
windows compilers. Example:

call EZConsOpen() !Open the console

call EZConsSetCurPos(5,5,RETCODE) !Set position to row 5, column 5

call EZConsWriteText('string of text',RETCODE) !Appends text at cursor
position, leaves CP at end of string. To overwrite, repeat call to
EZConsSetCurPos, else text will append. To add EOL, insert or
concatenate char(10) to the text string.

There are no long winded security attributes, startup info, and process
info structures to mess with (well there are, but they're conveniently
hidden from view) and no null character appending (ditto). It is tiny.
There are 9 total routines to set attributes, generate control-c/break,
close console, etc. and it is interoperable with some (those I tested)
implementations of READ/WRITE. It works in console, graphics, or
Windows project types (except that console project type will
automatically provide a final "close window" prompt/wait). There are
two names for each routine, one long and one F77 compatible 6-character
short (short name EZCLSE is documented incorrectly but will fix). All
arguments are range checked so it isn't possible to set an out of range
value. Return codes are not yet fully documented as the error reporting
scheme has not been decided on. It is highly likely that I will alter
the error reporting scheme, removing the return code value from each
argument list. If sufficient interest is expressed, I will release the
implemented 9 routines for free/public distribution (if not, it will
fade away in about a week).

It is available here: http://www.fortranlib.com/EZCONSOL.ZIP

-- 
Gary Scott
mailto:garyscottNOSPAM@ev1.net
Fortran Library
http://www.fortranlib.com
Support the GNU Fortran G95 Project:  http://g95.sourceforge.net


Relevant Pages

  • Re: CreateProcessAsUser - Process starts then exits
    ... Windows XP Media Center ... public Int32 dwX; ... public IntPtr lpReserved2; ... parent's console. ...
    (microsoft.public.win32.programmer.kernel)
  • Re: CreateProcessAsUser - Process starts then exits
    ... service most likely runs in a separate invisible session. ... the program I was trying to start was a windows forms app I ... public IntPtr lpReserved2; ... parent's console. ...
    (microsoft.public.win32.programmer.kernel)
  • Novell Client login form enables reading and writing from and to the clipboard of the logged-in
    ... Novell Client for Windows, ... Anyone with access to the computer's local operating system console, ... inject its own textual content into the clipboard of the currently logged-in ...
    (Bugtraq)
  • Re: New HDD Installation
    ... Right clicking on the partition or using the | Action> All Tasks menu at the top of the console should show the option, either greyed out or usable to make the partition active. ... Do the fixboot and fixmbr things in the Recovery Console then see if things change. ... There are other ways to mark the partition active, either with a Windows 98 startup disk or using the DISKPART command while in Windows XP. ...
    (microsoft.public.windowsxp.general)
  • Re: Cannot Correctly Preview Fax in Fax Console
    ... I no way do I doubt what you are saying, but until now, all known problems with previewing faxes have had one of two causes: incorrect file associations for TIF files or end user error using Windows Picture and Fax viewer. ... >>>I have used the fax printer Windows accessory many times. ... The Fax console comes>>> up. ...
    (microsoft.public.windowsxp.print_fax)