• Welcome to Jose's Read Only Forum 2023.
 

FileName

Started by Pierre Bellisle, October 02, 2022, 01:18:59 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Pierre Bellisle

I got an error when I compile if the .o2bas filename include some space in it.
Either from Oxide or a batch file.
Adding double-quotes does'nt help...

Example: D:\Dev\Oxygen\o2w7\co2.exe -32 "D:\Dev\Oxygen\o2w7\~code\Caption Icon04.o2bas"

I got the error: ERROR: Include file not found d:\dev\oxygen\o2w7\~code\caption.inc

Pierre Bellisle

#1
A legal filename can begin with, let's say "-A"
Like in D:\Dev\Oxygen\o2w7\co2.exe -32 -aCaption.o2bas
In that case the "-a" is misinterpreted as a compiler swicth.
Adding double-quotes resolve the situation.
Is there a place where I can find the exacts rules for feeding a command line to the compiler?

Added:
The co2.exe messagebox help  show the switches always before the <filename>
Aka: co2.exe -64 <filename> <optional filename>
Is there any problem putting thoses swicthes after filenames, [optional filename], [filename.res]
Seems OK to me...

Thank.


Charles Pegge

Hello Pierre,

I have altered co2, oxide and peroxide to support file pathnames containing spaces. When compiling with co2 in a dos console, you now need to enclose the spacey filenames with double-quotes.

Update P10
https://github.com/Charles-Pegge/OxygenBasic/blob/master/OxygenBasic050P10.zip

Zlatko Vid

you always need to have filename with "" if you use spaces in names
simple:

chr(34) + file_name + chr(34)

Pierre Bellisle

Hi Charles,

Double-quotes for filenames with space is a good news.
I guess Microsoft sees it that way too.

Note that <co2.exe -32 -aCaption.o2bas> do not contain any space and will continue to be ambigious,
It might a rare case, still is <-a> a switch, or part of the filename?
I will always use double-quotes in my pre-compiler to avoid any misinterpretation.

By curiosity, I wanted to know if I can put the switches after filenames.
With no confirmation, I will play safe to avoid possible future problems.

Thank you very much Charles.

Charles Pegge

Yes, you will need to space the switches, and if a filename looks like a switch then put it between quotes. It is always safe to use quotes around filenames.

I think we need to keep the switches to the left of the filenames, but I will consider this issue.

Zlatko Vid

QuoteI think we need to keep the switches to the left of the filenames,

Of course that wee need to keep them from left

I really don't know any other compiler which use switch from right side or after filename.

Charles....
New request become really bizare

Charles Pegge

It is because there are optional filenames to the right: exe filenames and res filenames.

Zlatko Vid

QuoteIt is because there are optional filenames to the right: exe filenames and res filenames.

Yes ,,of course on right side are .ext -ensions