home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 26
/
CD_ASCQ_26_1295.iso
/
vrac
/
batsh220.zip
/
SAMPLE1.BSH
< prev
next >
Wrap
Text File
|
1995-06-28
|
3KB
|
125 lines
REM DEMO for the 3 types of message boxes
;*******************************************
wait off
:restart
if %$VER%==>210 goto start
message Version Info
This DEMO will stop here
You should upgrade to version
2.05 or later
Please contact the Help file
for the upgrade site
.
if exist batsh.hlp winhelp batsh.hlp
exit
:start
; Hide the BATSH icon
show hide
message BATSH: WELCOME
With BATSH you can display a message on the WINDOWS screen,
and define 3 different types of prompt for user-response
The following messages will show the
CHOICE and the ASK prompt
.click here to continue,60
;*******************************************************
; new program label
label Choose an Option
message CHOICE prompt
This message box is a sample for the CHOICE prompt
A one-key INPUT field (with time-out)
The next message box will show the ASK prompt:
An INPUT field + OK button
Type C to continue (default after 20 seconds)
E to exit
or any other key to restart the DEMO
.CHOICE C,E,$A,#20
;*************************************************
if errorlevel 3 goto restart
if errorlevel 2 exit
; change icon to system defined questionmark
icon question
; new program label
label USERNAME
; show the BATSH icon
show normal
; reset variables
; $$USER stores the input as global variable
; try will be used as counter
set try=0
set $$USER=%serialno|mswindows|username%
; ************ ASK-MESSAGE ***************
:retry
; the value of TRY defines further action and
; the text for the ASK box
inc try
if %try%==3 goto continue
if %try%==2 set line1=One more try !
if %try%==1 set line1=Demo asking for user-name and presenting a message box
message ASK prompt
%line1%
Enter your name please:
(you can use upper- and lower-case letters)
.ask $$USER
; loop if the user did not enter a word ($$USER empty)
if errorlevel 1 goto retry
:continue
set $PASSWORD=
message BATSH: Hidden Input
The following input box shows all typed
characters as *
Try it:
.ask $PASSWORD
; set a default name if $$USER is empty
if '%$$USER%'=='' set $$USER=Mr. NoName
;*******************************************************
; change icon to system defined exclamation-point
icon exclamation
; new program label
label message
:redo
set cmdln=
message BATSH Commandline
Hi %$$USER%
With BATSH you can give written commands to WINDOWS.
Normally you write a file with one command per line,
In this demo you can now test the program typing a
single command.
e.g.
run icon calc (start the calculator minimized)
show icon File Manager (minimize File Manager)
icon question (make the BATSH icon a question mark)
See the BATSH help-file for a complete list of commands
Try it:
.ask cmdln
if '%cmdln%'=='' exit
%cmdln%
set cmdln=
message BATSH
This is the last message-box of the DEMO.
It's again a CHOICE prompt
Type:
C - to go back and enter another command
or
any other key - to end the DEMO (default after 30seconds)
.CHOICE $A,C,#30
if errorlevel 2 goto redo