title: How to use CALL function in DOS 6.22?
body: <p>I have written a batch file that runs fine under Windows Command Prompt, but I would like to be able to run it after POST in DOS. I have copied my code to AUTOEXEC.BAT file which gets executed automatically; however it comes up with syntax errors once it reaches the call command and the rest.</p>
  
  <pre><code>echo. This script is counting the # of POSTs.
  echo. The POST # value is saved in TEST.txt.
  echo.
  
  call:myPOSTTest
  
  for /f "tokens=* delims=" %%x in (A:\TEST.txt)  do echo POST# %%x
  
  echo. &amp;pause&amp;goto:eof
  ::--------------------------------------------------------
  ::-- Function section starts below here
  ::--------------------------------------------------------
  
  :myPOSTTest    - here starts my function identified by its label 
  
  set var=0
  
  if EXIST A:\TEST.txt (
       for /f %%x in (A:\TEST.txt) do (set /a var=%%x+1)
  )
  
  echo %var% &gt;&gt; A:\TEST.txt
  
  goto END
  
  :END
  </code></pre>
  
  <p>Thank You</p>