demo: Eingabemaske entry für screen

This commit is contained in:
wkh
2026-10-11 21:54:38 +02:00
parent 32c1f2be28
commit 837a73366d
5 changed files with 56 additions and 8 deletions
+6
View File
@@ -0,0 +1,6 @@
Mail List Entry Form
Name : <Name> Company: <Company>
Street: <Street>
City : <City> State : <State> ZIP: <ZIP>
Phone : <Phone>
+5 -2
View File
@@ -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
View File
@@ -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