@echo Bas2Asc (for ASCII file and serial transfer) is running...
@rem open console,
@rem change to directory and start batch with "bas2Asc FILENAM"
@rem FileToOpen needed: http://www.horstmuc.de/win/wfile.zip

@echo off
if not exist GetFName.cmd (
	%~d0
	cd %~dp0
)
if not exist GetFName.cmd if exist ..\GetFName.cmd cd ..
call SHARPSET
set fnamex=.BAS
set fnamedp=%BASDIR%\
set fnamen=%1
set fnamef=%fnamedp%%fnamen%%fnamex%

Rem Note: Filenames with 1-7 characters are recommended!
if not exist %fnamef% call GetFName %fnamedp% "*%fnamex%;*.PRG;*.ASC;*.SPP;*.SHA;*.shp" "%1"
if not exist %fnamef% (
             echo Error: File %fnamef% does not exist! - Ctrl+C
             goto end
)

bas2img --type=asc --pc=%SHARPC% %fnamef% --endmark %BAS2OPT%
if errorlevel 1 goto end
rem pause

echo.
echo Use a terminal software for transmission via the serial interface.
pause
start "%fnamen%" %EDITOR% %fnamedp%%fnamen%.asc
goto :EOF
:end
pause