printf, data presentation
Cris Simpson
is813cs at pyr.gatech.EDU
Sat Dec 31 01:20:22 AEST 1988
In article <19 at xenlink.UUCP> tony at xenlink.UUCP (Tony Field) writes:
>I wonder why C i/o functions - including curses - do not provide a simple
>method of accepting 'fixed format' screen input? The following example
>The normal way of solving this problem is to develop special code to
>allow the user to traverse the screen.
>What the programmer really wants to do is say, "Here is a screen image.
>Place the user's data field responses into these variables.". I have seen
>many "data windows" packages - mostly in MSDOS - but none of them seems
>to follow the spirit of C. In spirit, all formatted display in C should
>follow the general conventions of "printf/sscanf".
>The mechanism presented above illustrates a screen presentation style
>that is familiar to IBM-3270 programmers (and dBase programmers) : i.e.
>present a screen to the user, fetch all his responses, then edit the
>data.
>
>I feel that C really needs a cleaner method of accepting screen input
>than currently provided by printf/curses. There should be a 'standard
>C library' set of functions, consistent with the style of C, that
>allow full-screen data presentation.
>
>If any one is interested in this general problem, I would appreciate
>their comments. In addition, I could provide a bunch of C code (that
>currently runs under Xenix or QNX) that implements all of the above.
To me, the best thing about C is that it is no bigger than it has be.
To say that there should be a 'standard C library' of screen data
functions conflicts with the philosophy, style and practice of C.
If you need this, there are probably better ways to get it than
to ask for it to be included in the stdlib. I have no use for it,
but say that I wanted sound functions. Should they be in the
stdlib? Naah. I could write some sound functions if my
box had sound, or I could buy a package that supported it.
But it is of limited utility to the general world and definitely
non-portable.
If this is something that dBase does so well, why not use that. Or try
a dBase compiler. The right tools make any job easier.
If you need to drive a nail, don't hit it with a crescent wrench,
it messes up the wrench and doesn't do that good a job, either.
cris
More information about the Comp.lang.c
mailing list