hyphen in filename

Started by jbk, October 14, 2025, 04:17:50 PM

Previous topic - Next topic

jbk

🤣
Robert, that baffling first line of my batch file I found by searching the web a year or more ago, I don't understand it but it does what I want, namely to keep the console open

Robert

Quote from: jbk on October 15, 2025, 05:27:57 PMRobert
I wrote this bat file and saved it to Desktop
if not defined in_subprocess (cmd /k set in_subprocess=y ^& %0 %*) & exit )
echo "%~dpn1"
if I drag&drop the text file ok-jj-l.txt it seems to work
QuoteC:\Users\Admin\Desktop>if not defined in_subprocess (cmd /k set in_subprocess=y & "C:\Users\Admin\Desktop\test.bat" C:\Users\Admin\Desktop\ok-jj-l.txt )  & exit )

C:\Users\Admin\Desktop>if not defined in_subprocess (cmd /k set in_subprocess=y & "C:\Users\Admin\Desktop\test.bat" C:\Users\Admin\Desktop\ok-jj-l.txt )  & exit )

C:\Users\Admin\Desktop>echo "C:\Users\Admin\Desktop\ok-jj-l"
"C:\Users\Admin\Desktop\ok-jj-l"



Hi jbk:
     🤯

MrBcx

#9
Quote from: jbk on October 15, 2025, 09:00:49 PMMrBcx
I think that your Bcx argument parser is at fault, try a filename with a -v- in the middle like foo-v-bar.bas

JB -- You're correct. 

I pinpointed the error and have corrected it.

The fix will be in 8.3.0

JB Klassen     : Reported bug involving BCX BASIC filenames with "-v" in them.  FIXED

jbk

MrBcx
I think that your Bcx argument parser is at fault, try a filename with a -v- in the middle like foo-v-bar.bas

jbk

#7
I replaced the batch files with the ones from the bed.zip archive and then edited the config files to the paths on my system, MSVC's path has a space in it so it's enclosed in quotes but mingw's path does not contain any spaces just a simple @SET MinGWFolder=D:\mingw64 and the hyphenated filename still won't work
I now suspect Bcx, not any of the batch files

jbk

Robert
I wrote this bat file and saved it to Desktop
if not defined in_subprocess (cmd /k set in_subprocess=y ^& %0 %*) & exit )
echo "%~dpn1"
if I drag&drop the text file ok-jj-l.txt it seems to work
QuoteC:\Users\Admin\Desktop>if not defined in_subprocess (cmd /k set in_subprocess=y & "C:\Users\Admin\Desktop\test.bat" C:\Users\Admin\Desktop\ok-jj-l.txt )  & exit )

C:\Users\Admin\Desktop>if not defined in_subprocess (cmd /k set in_subprocess=y & "C:\Users\Admin\Desktop\test.bat" C:\Users\Admin\Desktop\ok-jj-l.txt )  & exit )

C:\Users\Admin\Desktop>echo "C:\Users\Admin\Desktop\ok-jj-l"
"C:\Users\Admin\Desktop\ok-jj-l"


jbk


Robert

Quote from: jbk on October 14, 2025, 04:17:50 PMI tried to compile msvcrt-vs-ucrt.bas but all I got was
QuoteError: Source file "D:\Bed\BcxProgs\msvcrt-vs-ucrt.c" or "D:\Bed\BcxProgs\msvcrt-vs-ucrt.cpp" was not found. Operation aborted.
spaces instead of hyphens are ok, did I mess up my batch files or do you have the same problem?

the reason for that program was to test the performance of the respective libraries math functions, ucrt is 2 to 5 times faster
BTW, it seems that choosing MS Visual C++ is equal in performance with MS Visual C++ (ucrt)

Hi jbk:

The batch file "%~dpn1" filename regex cannot handle multiple hyphens (-) or periods (.). Underscores (_) and spaces are O.K. There may be a syntax that will work. I have attached page 17 from the Windows_Batch_Scripting manual which contains regex options for filenames. Lets us know if you get it figured out. It took me days to work out "%~dpn1".


jbk


MrBcx

Methinks thou hast screwedth something up on your end.


BCX BASIC to C/C++ Translator (c) 1999-2025 by Kevin Diggins
Version 8.3.0 (10/13/2025) Compiled using LLVM-Clang (21.1.3) for 64-bit Windows
[Lines In: 541 ] [Lines Out: 1584 ] [Statements: 423 ] [Time: 0.08 Sec's]
BCX translated [A-Filename-With-Hyphens.Bas] to [A-Filename-With-Hyphens.C] for a C Compiler
**********************************************************************
** Visual Studio 2022 Developer Command Prompt v17.0
** Copyright (c) 2022 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'
**************************************************************************
MSVC is compiling [ "C:\Temp\A-filename-with-hyphens" ] as a 64-bit GUI application.
A-filename-with-hyphens.c
Linking "C:\Temp\A-filename-with-hyphens"
**************************************************************************
SUCCESS: MSVC++ built [ "C:\Temp\A-filename-with-hyphens.exe" ]
**************************************************************************



jbk

I tried to compile msvcrt-vs-ucrt.bas but all I got was
QuoteError: Source file "D:\Bed\BcxProgs\msvcrt-vs-ucrt.c" or "D:\Bed\BcxProgs\msvcrt-vs-ucrt.cpp" was not found. Operation aborted.
spaces instead of hyphens are ok, did I mess up my batch files or do you have the same problem?

the reason for that program was to test the performance of the respective libraries math functions, ucrt is 2 to 5 times faster
BTW, it seems that choosing MS Visual C++ is equal in performance with MS Visual C++ (ucrt)