Category : Files from Magazines
Archive   : VOL11N13.ZIP
Filename : GETLNGTH.BAT

 
Output of file : GETLNGTH.BAT contained in archive : VOL11N13.ZIP
@ECHO OFF
Rem ### Get the length of Environment Variable STRING, ###
Rem ### set to the value of %1 on entry. Set the length ###
Rem ### in Environment Variable LENGTH. Lengths greater ###
Rem ### than nine characters set LENGTH equal to 9+. ###
Rem ### Variable STRING may not include the ~ character. ###
SET string=%1
IF '%string%'=='' GOTO zero
SET temp=%string%~
SET length=
:loop
SET length=+%length%
FOR %%y IN (/%temp%) DO SET temp=%%y
IF NOT %temp%==~ GOTO loop
IF %length%==+ SET length=1
IF %length%==++ SET length=2
IF %length%==+++ SET length=3
IF %length%==++++ SET length=4
IF %length%==+++++ SET length=5
IF %length%==++++++ SET length=6
IF %length%==+++++++ SET length=7
IF %length%==++++++++ SET length=8
IF %length%==+++++++++ SET length=9
FOR %%z IN (/%length%) do if %%z==+ SET length=9+
GOTO done
:zero
SET length=0
:done
SET temp=
ECHO Length of "%string%" is %length%


  3 Responses to “Category : Files from Magazines
Archive   : VOL11N13.ZIP
Filename : GETLNGTH.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/