REPLY - The tiny shell script user interface (DOS & UNIX).
Reply yields basic interaction for batch and script files, like simple menus or input lines, drawn on a colored background with random fill patterns (if desired). The program works on a line-by-line basis. See Gerolf Markup Shredder (text mode interface) for an example of usage.
Reply is copyright (c) 1991–2006 by G. D. Brettschneider (domain: www.Gerolf.orgMarkupShredder@Gerolf.org).
reply [mode] [line] [text] [hotkey] [item]
[mode]can be one of the following:
-random: Draw screen background with random pattern
[text]on the screen
-top: Draw top border of a box
[text]into a box
[text]into a box and answer to a file
-bottom: Draw bottom border of a box
-shadow: Draw a
shadowbelow the box
-stripe: Draw a
[text]colored stripe of
-background: Draw a
[text]colored background of
-clear: Overwrite a line with spaces
-sleep: Delay for one second (DOS onnly)
-time: Measure time (in seconds)
[line]: Number of a line to be drawn on the screen
[text]: Text to be shown as a menu item or question
[hotkey]: Letter to be highlighted in a menu item
[item]: Number of an item within the menu
Reply command line invocation might look like this:
reply -banner 1 "CoolProg" reply -random 2 reply -top 7 "+-------+" reply -item 8 "Your name" reply -question 9 "Gerolf B." N 3 reply -item 10 "Get money" M 2 reply -item 11 "Exit now!" XX 1 reply -bottom 12 "+-------+" reply -shadow 13 reply -stripe 1 8 36 reply -background 2 8 36 reply -clear 7
Reply must be called from a shell script, multiple times in sequence, in
order to build a menu or dialog box. If the
hotkey parameter is
doubled, Reply displays a highlighted line and waits for user input.
The answer, in terms of environment variable settings, is written to a
temporary batch or shell file, which can be executed by the
menu-building script (from within a loop). This is a work-around for the
problem that a running program cannot change its own environment.
A few additional environment variables must be defined before running Reply; so the number of parameters passed to Reply can be kept smaller:
REPLY_AFTER: Number of seconds
REPLY_BEFORE: Number of seconds
REPLY_ITEMS: Number of menu items
REPLY_OFFSET: Horizontal offset of dialog box
REPLY_SIZE: Width of dialog box, or height of background
REPLY_MODULE: Name of script to be called
REPLY_ACTION: Name of action to be executed
REPLY_HOT: Hot key pressed be the user
REPLY_COLD: Last hot key
REPLY_TEMP: Name of temporary answering script
REPLY_DESKTOP: Number of desktop color (0...7)
REPLY_PATTERN: Number of pattern color (0..15)
REPLY_BANNER: Number of banner color (0...7)
REPLY_TEXT: Number of text color (0..15)
REPLY_SHADE: Number of shadow color (0...7)
REPLY_HOTKEY: Number of hotkey color (0..15)
Reply is portable to both DOS and Unix. The source codesource code is written in ANSI C.
gcc -o reply reply.c -Lstring 2> reply.log
mk_replyscript. By default, Reply will output ANSI escape sequences for color adjust and cursor movement. The keyboard driver must be set to one character at a time mode by saying
-echobefore running Reply (and
bcc -o reply reply.c -Lstring -DCONIO
CONIOmust be defined because the
ansi.sysdriver for the command shell usually isn't installed in
config.sys; so Reply makes use of the
You can send bug reports, corrections or suggestions to: MarkupShredder(at)Gerolf.orgMarkupShredder(at)Gerolf.org, subject: GMS REPLY user interface.
Copyright (c) 1991-2006 by Gerolf Diethelm Brettschneider, Luchtbergstraße 27, D-28237 Bremen. All rights reserved. This software comes without any warranty. You may freely distribute and use it.
G. D. Brettschneider (2006) – www.Gerolf.orgMarkupShredder(at)Gerolf.org