;
; Binary_Write.shell.
; $VER: Binary_Write.shell_Version_0.00.10_Public_Domain_B.Walker_G0LCU.
;
; Start of first part...
; Clear the screen and initialise a binary file inside the T: Volume...
ECHO "*ecPlease wait, generating a 256 byte binary file..."
; Zero a file named BINARY.FILE inside the T: volume.
ECHO > T:BINARY.FILE
;
; Set the initial downwards counting loop start value at 255 decimal...
SETENV binaryfile 255
;
LAB start
; Get the first value, 255...
GETENV binaryfile
; Write this value to the binary file.
EVAL $binaryfile LFORMAT %C >> T:BINARY.FILE
; Count down the value by 1 and write to the variable.
; Use ECHO and some ANSI ~Esc~ codes to hide the countdown.
ECHO "*e[0;30;40m*e[0;0f`EVAL $binaryfile - 1 TO ENV:binaryfile`"
; If the variable equals -1 exit the loop...
IF $binaryfile EQ -1
    SKIP gotohexdump
ENDIF
SKIP BACK start
;
; Exit the start loop.
LAB gotohexdump
ECHO "*ec*e[0;31;40mHexdump of the T:BINARY.FILE...*n"
TYPE HEX T:BINARY.FILE
ECHO "*nA 2 second delay before the next part...*n"
WAIT 2
; First part finished.
;
; ========================================
;
; Start of second part.
; Create a clear screen, (CLS), BEEP and BOTH inside the C: Volume.
CD SYS:C
;
ECHO "Initialise the audio bell file to zero."
ECHO > C:BEEP
ECHO "Now create the audio bell file."
EVAL 7 LFORMAT %C > C:BEEP
ECHO "Now test it..."
TYPE C:BEEP
WAIT 1
;
ECHO "Initialise the clear display file to zero."
ECHO > C:CLS
ECHO "Now create the clear display file."
EVAL 12 LFORMAT %C > C:CLS
ECHO "Now test it..."
WAIT 2
TYPE C:CLS
;
ECHO "Initialise both combined."
ECHO > C:BOTH
ECHO "Now set the audio bell first."
EVAL 7 LFORMAT %C > C:BOTH
ECHO "Now append the clear display next."
EVAL 12 LFORMAT %C >> C:BOTH
ECHO "Now test it..."
WAIT 2
TYPE C:BOTH
;
; Remove any variables...
UNSETENV binaryfile
; Second part finished...
;
; Enjoy finding simple solutions to very often difficult problems...