demo: Eingabemaske entry für screen
This commit is contained in:
@@ -7,6 +7,9 @@ folgen [Semantic Versioning](https://semver.org/lang/de/). Die Version steht in
|
||||
|
||||
## [Unveröffentlicht]
|
||||
|
||||
### Hinzugefügt
|
||||
- `demo/entry`: beschriftete Eingabemaske für `screen` (README erklärt den Unterschied zu `form`).
|
||||
|
||||
## [0.3.0] - 2026-10-11
|
||||
|
||||
### Hinzugefügt
|
||||
|
||||
@@ -77,6 +77,15 @@ Eine Zeile mit `##` erscheint als Überschrift in der Ausgabe, eine mit `#` ist
|
||||
ein stiller Kommentar. Neue Befehle brauchen hier ein Beispiel, sonst schlägt der Test
|
||||
`test_testall_mentions_every_command` fehl.
|
||||
|
||||
## Vorlagen: `form` und `entry`
|
||||
|
||||
- `demo/form` ist eine Vorlage für `report` und `letter`: sie setzt Spaltenwerte in einen Text ein.
|
||||
Sie hat keine Beschriftungen und nennt `Name` zweimal.
|
||||
- `demo/entry` ist eine Eingabemaske für `screen`: jedes Feld kommt einmal vor und hat eine
|
||||
Beschriftung. `screen < entry > maske.sh` erzeugt das Skript. Starten:
|
||||
`CLEAR=$(clear.rdb) sh maske.sh > tabelle 2>&1`. Die Tabelle geht auf stderr (wie im Original),
|
||||
daher das `2>&1`. Mit `form` würde die Maske leer und doppelt aussehen.
|
||||
|
||||
## Befehle
|
||||
|
||||
| Gruppe | Befehle |
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
Mail List Entry Form
|
||||
|
||||
Name : <Name> Company: <Company>
|
||||
Street: <Street>
|
||||
City : <City> State : <State> ZIP: <ZIP>
|
||||
Phone : <Phone>
|
||||
+5
-2
@@ -182,8 +182,11 @@ report form < maillist
|
||||
## label prints mailing labels, letter prints form letters
|
||||
label < maillist
|
||||
letter form < maillist | head -5
|
||||
## screen turns a form into a shell script that asks for the fields
|
||||
screen < form | head -6
|
||||
## screen turns a form into a shell script that asks for the fields. Use a form with labels
|
||||
## and every column once (entry); the report template `form` would give a blank, doubled screen.
|
||||
## Run the script with: CLEAR=$(clear.rdb) sh script > table 2>&1 (the table goes to stderr)
|
||||
cat entry
|
||||
screen < entry
|
||||
## reportwriter: a sample report with page headings (the date is cut out)
|
||||
reportwriter -3 Prices < inventory | grep -v 'Report Date'
|
||||
## tabletom4 / tabletosed / tabletostruct were shown above
|
||||
|
||||
+33
-6
@@ -735,14 +735,41 @@ McDonalds
|
||||
123 Mac Attack
|
||||
Memphis, TENN 30000
|
||||
|
||||
## screen turns a form into a shell script that asks for the fields
|
||||
$ screen < form | head -6
|
||||
## screen turns a form into a shell script that asks for the fields. Use a form with labels
|
||||
## and every column once (entry); the report template `form` would give a blank, doubled screen.
|
||||
## Run the script with: CLEAR=$(clear.rdb) sh script > table 2>&1 (the table goes to stderr)
|
||||
$ cat entry
|
||||
Mail List Entry Form
|
||||
|
||||
Name : <Name> Company: <Company>
|
||||
Street: <Street>
|
||||
City : <City> State : <State> ZIP: <ZIP>
|
||||
Phone : <Phone>
|
||||
$ screen < entry
|
||||
: paint crt screen
|
||||
exec 1>/dev/tty
|
||||
cat <<SCREEN
|
||||
${CLEAR}
|
||||
|
||||
|
||||
${CLEAR} Mail List Entry Form
|
||||
|
||||
Name : Company:
|
||||
Street:
|
||||
City : State : ZIP:
|
||||
Phone :
|
||||
SCREEN
|
||||
: read user input
|
||||
cursor 3 9 ; read Name;
|
||||
cursor 3 37 ; read Company;
|
||||
cursor 4 9 ; read Street;
|
||||
cursor 5 9 ; read City;
|
||||
cursor 5 37 ; read State;
|
||||
cursor 5 56 ; read ZIP;
|
||||
cursor 6 9 ; read Phone;
|
||||
: output table head
|
||||
exec 1>&2
|
||||
echo "Name Company Street City State ZIP Phone"
|
||||
echo "---- ------- ------ ---- ----- --- -----"
|
||||
: append row
|
||||
echo "$Name $Company $Street $City $State $ZIP $Phone"
|
||||
## reportwriter: a sample report with page headings (the date is cut out)
|
||||
$ reportwriter -3 Prices < inventory | grep -v 'Report Date'
|
||||
Prices
|
||||
@@ -777,7 +804,7 @@ Item Amount Cost Value Description
|
||||
## tabletom4 / tabletosed / tabletostruct were shown above
|
||||
## ===== Help and the terminal =====
|
||||
$ rdb --version
|
||||
rdb 0.2.0
|
||||
rdb 0.3.0
|
||||
$ howmany
|
||||
134
|
||||
$ whatis row
|
||||
|
||||
Reference in New Issue
Block a user