Hello,

I realize there are alot of solutions out there in google for finding the length of a string using a batch file. I have tried to understand 3 different ones listed, and was unsuccessful. I have placed a copy of one of the scripts I found through google below. Could someone explain/help me understand it? Or give me a new solution that they can explain better?

here is one solution: (and listed just below is what I don't understand)
@echo off
set test_=Testing the length of a string
echo:..%test_%>tmp$$$.txt
for %%i in (1 2 3 4 5 6 7 8) do echo 1234567890>>tmp$$$.txt
dir tmp$$$|find "TMP$$$ TXT">tmp$$$2.bat
echo set lenght_=%%2>tmp$$$.bat
call tmp$$$2
echo set length_=%%%lenght_%>tmp$$$.bat
call tmp$$$
for %%f in (tmp$$$*.*) do if exist %%f del %%f
echo %test_%
echo length_=%length_%
set length_=

What I don't understand:
1. Why "$$$" is used, and what does it mean?
2. Why "%%%" is used, and what does it mean?
3. The line starting with "echo set length" (IE: what is this: "%%%lenght_%" ?).
4. The last line. (it seems like it's not finished.)

Thank you for any help!