Category : Utilities for DOS and Windows Machines
Archive   : LET12.ZIP
Filename : DEMO-5.BAT

 
Output of file : DEMO-5.BAT contained in archive : LET12.ZIP
echo Off
If `%Name%' == `' Demo
cls
echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
echo ÚÄ×ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ×Ä¿
echo ³ º String Manipulation (part 2): LENGTH, SUBSTR, POS º ³
echo ÀÄ×ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ×ÄÙ
echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
echo ÿ
let P=(ask (concat "Give me a number between 1 and " (minus (length str) 9) ": " ))
if `%P%' == `' then LET P=(minus (length Str) 10)
let S=(substr Str P 10)
echo The ten characters of your string, starting from position %P% are
echo "%S%"
LET P=(pos (lower Str) "e")
LET P2=(pos (lower Str) "e" (+ P 1))
if not %p% == 0 goto OneP
echo Um, I had hoped to find a letter E somewhere in your string,
echo just to show you I could do it, but there just doesn't seem to
echo be any in it. May I entice you to go back and enter another
LET answer=(substr (upper (ask "string? ")) 1 1)
if `%Answer%' == `N' goto NoGo
if not `%Answer%' == 'Y' echo I'll just assume that to mean Yes, %Name%.
Echo I knew I could prevail upon your sensibilities. Thank you.
DEMO-4 AskAgain
:NoGo
Echo Very Well, %Name%, if you insist. I'll have to skip the next
Echo demonstration, though.
goto EndPos
:OneP
LET Ptr=(concat (dup " " (- P 1)) "^ Here in position " P)
echo I found a letter E in the string.
echo %Str%
echo %Ptr%
if not %P2% == 0 goto TwoPs
echo That also happens to be the only letter E in this string.
goto EndPos
:TwoPs
LET Ptr=(concat (dup " " (- P2 1)) "^")
echo There is another in position %P2%, here:
echo %Str%
echo %Ptr%
:EndPos
LET Answer=(ask (concat "Well, " Name ", are we having fun yet? ") 1)
echo (Never mind--rhetorical question)
set P2=
set ptr=
pause
DEMO-6


  3 Responses to “Category : Utilities for DOS and Windows Machines
Archive   : LET12.ZIP
Filename : DEMO-5.BAT

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/