@goto A
-----------------------------------------------------------------
SFN.BTM -- CLD 5/15/16
4DOS batch (.BTM) file showing XyWrite-related uses of
  the built-in 4DOS variable @SFN (Short File Name)

Usage (at the 4DOS command prompt):
SFN.BTM ["]long_file_name["]

Results (if LFN is valid):
- The SFN is echoed to the screen
- A Xy3 XPL program to CAll the SFN is written to disk as SFN3.PM
- A Xy4 XPL program to CAll the SFN is written to disk as SFN4.PM
-----------------------------------------------------------------
:A
@echo off
for %%f in (.OUT 3.PM 4.PM) do del/e/q %@path["%0"]SFN%%f
iff "%1" eq "" then
  echo.
  echo Usage:
  echo SFN.BTM ["]long_file_name["]
  goto Z
endiff

iff exist "%1" then
  echo You entered '%1'
  echo ---
  echo The short file name (SFN) is %@SFN["%1"]
  echo Writing '%@SFN["%1"]' to %@path["%0"]SFN.OUT
  echo %@SFN["%1"] > %@path["%0"]SFN.OUT
  echo Writing Xy3 CAll program %@path["%0"]SFN3.PM
  echo ÿ�ca %@SFN["%1"]ÿ�	ÿ�ÿ€}®EX¯> %@path["%0"]SFN3.PM
  echo Writing Xy4 CAll program %@path["%0"]SFN4.PM
  echo ÿ‚«ca %@SFN["%1"]ÿ‚®EX¯> %@path["%0"]SFN4.PM
else
  echo File '%1' does not exist.
endiff
:Z
echo.
rem end of SFN.BTM
