Metropoli BBS
VIEWER: query.bat MODE: TEXT (ASCII)
@echo off
 :: solicits console response and capitializes it, and
 :: writes it formatted to a form file  Q.FRM
 :entry
 m/set n=[cap`[?Name]]
 :: esc causes errorlevel 5
 if errorlevel 5 goto esc
 m/set a=[cap`[?Address]]
 if errorlevel 5 goto esc
 m/set d=[?Date of birth]
 :: esc causes an errorlevel 5
 if not errorlevel 5 goto output
 :esc
 m/set m=[menu`Cancel`Yes`No - Re-enter]
 if %m%`==Y` goto abort
 goto entry
 :: fix the width of the first column by truncating
 :: or padding with spaces (to column 40)
 :output
 m  [tpad`Name: %n%`38` ]  Date: [date]>q.frm
 m  [tpad`Address: %a%`38` ]  DOB: %d%>>q.frm
 :: do something with q.frm here
 type q.frm
 :abort
 set a=
 set d=
 set n=

[ RETURN TO DIRECTORY ]