Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Some new and pure DOS solutions

10 views
Skip to first unread message

Benny Pedersen

unread,
Nov 3, 1999, 3:00:00 AM11/3/99
to
@Echo off
:: (If, then place the RAM drive letter here.) E:
If exist # Del # /p
Cls

:: My today's development: (Pure DOS solutions but, maybe not special.?)

:: 1. Type a high number using CHOICE.
:: 2. Prevent the 'ECHO is OFF'.
:: 3. A time-PAUSE that don't freeze.
:: 4. Repeat a loop. For example 256 times.

::-----------------------------------------------------------

:: 1
Set v=
:Choose
Echo Type a number between 0 and what ever. Then press [+] to continue.
:: 2 (The dot in the following line prevent the message ECHO is OFF):
Echo.%v%
Choice /c1234567890+ /n > nul
If errorlevel 11 Goto Continue | Cls
For %%v in (1 2 3 4 5 6 7 8 9) do If errorlevel %%v If not errorlevel 10 Set v=%v%%%v
If errorlevel 10 Set v=%v%0
Goto Choose | Cls
:: 3
:Escape (The following CHOICE syntax don't freeze because of 'pressing the wrong key':
Rem|Choice/c /n/t ,01Escaped< nul
For %%v in (Cls Exit) do %%v
:Continue.
If errorlevel 12 Goto Escape
Echo The number is (%v%)
For %%v in (Echo. Pause Cls) do %%v
Set v=
:End

:: 4
Cls
For %%v in (n# e# e## e###) do Set %%v=
:Ask#
Echo Repeat a loop X times:
Echo Type a number between 0 and 999. Then press [+] to continue.
Echo.
Echo.-%e#%-%e##%-%e###%-
Choice/c1234567890+ /n>nul
If errorlevel 11 Goto End_Ask#
Set n#=%n#%#
Set e%n#%=#
If errorlevel 02 Set e%n#%=##
If errorlevel 03 Set e%n#%=###
If errorlevel 04 Set e%n#%=####
If errorlevel 05 Set e%n#%=#####
If errorlevel 06 Set e%n#%=######
If errorlevel 07 Set e%n#%=#######
If errorlevel 08 Set e%n#%=########
If errorlevel 09 Set e%n#%=#########
If errorlevel 10 Set e%n#%=
Goto Ask# |Cls
::OR: If not %n#%==### Goto Ask# |Cls
:End_Ask#
:: If errorlevel 12 Goto End#Loop
If %e#%#==# Goto End#Loop
Set c#=%e#%
If %n#%#==#### Set c#=%e###%
If %n#%#==### Set c#=%e##%
Set e%n#%=%e#%
Set e#=%c#%
Set n#=
For %%v in (# ## ###) do set c%%v=
:: For %%v in (. . .) do Echo%%v
Echo.-%e###%-%e##%-%e#%- (2 seconds to lift off:)
Rem|Choice/c /n/t ,02< nul
Cd %temp%\
:Loop#
Set c#=%c#%#
::-------------------------------
:: Place the commands here: (...
::
:: Just 2 lines to show it:
Echo ~>>#
Find /c "~" #
:: ...)
::-------------------------------
If ########### ==#%c#% Set c##=%c##%#
If ########### ==%c#%# Set c#=
If %c##%#==########### Set c###=#%c###%
If #%c##%==########### Set c##=
If %c##%#==%e##%# If #%e#%==#%c#% If %c###%#==%e###%# Goto End#Loop
Goto Loop#

:End#Loop
For %%v in (# ## ###) do Set e%%v=
For %%v in (# ## ###) do set c%%v=
If exist # Del #
For %%v in (. .End_Program. .) do Echo%%v
For %%v in (Pause Cls) do %%v
Exit

- The above program is tested
to be used in any Batch file.


Note:

The above example may looks a
little advanced. but is not -
- only a little bit more than
Mr. T.L. can figure out.! :-)

PS.: The loop is very FAST..

:: End of pure DOS solutions.

--
Kind regards, me
http://users.cybercity.dk/~bse26236/home.html


0 new messages