title: Write function's returning value to specified variable in Batch
body: <p>I have to write a function that returns length of the specified variable to the second one. Actually, I don't know how to do it. I had several ideas like <code>set %~2=%len%</code> or <code>set len=call :parse_to_tokens %input%</code>, but they didn't work.</p>
  
  <pre><code>:length
  set string=%~1
  set len=0
  :loop
  if defined string (
     set string=%string:~1%
     set /a len+=1
     goto loop
  )
  :: The return statement or something.
  exit /b 0
  
  set /p input=""
  call :parse_to_tokens %input% %len%
  echo %len%
  :: Prints input length.
  </code></pre>