flat assembler
Message board for the users of flat assembler.

flat assembler > Compiler Internals > [feature request] cmd> fasm C:\bin\"hello world"

Author
Thread Post new topic Reply to topic
nik



Joined: 17 Mar 2008
Posts: 7
Location: Russia, Vladivostok
fasm (WinXP, fasm v1.67.26) doesn't recognize command-line arguments which include *internal* quotation marks like
Code:
> fasm.exe c:\bin\"hello world".asm
    

it errs "source file not found"
[ UPD: i expected this to work because my own C++ app that uses <fstream> accepts it with no problems ]

[ UPD: such syntax is actually NOT standard ]

i met this inconvenience creating a batch file which takes file name as a parameter, like this:
fasmN.cmd
Code:
fasm.exe c:\bin\%1.asm
    


i know there is a workaround for it, but it's just a little inconvenient and confusing Sad
even more trouble if i have series of *.cmd which call each other with parameters

thanks in advance
-- nik


Last edited by nik on 18 Mar 2008, 05:30; edited 4 times in total
Post 17 Mar 2008, 05:11
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 16390
Location: Hippocamp
The workaround is this:
Code:
fasm.exe "c:\bin\%1.asm"    
Post 17 Mar 2008, 05:21
View user's profile Send private message Visit poster's website Reply with quote
nik



Joined: 17 Mar 2008
Posts: 7
Location: Russia, Vladivostok
no it isn't
if
Code:
%1=="hello world"
    

then
Code:
"c:\bin\%1.asm"=="c:\bin\"hello world".asm"
    

again internal quotes and error


Last edited by nik on 17 Mar 2008, 05:53; edited 1 time in total
Post 17 Mar 2008, 05:24
View user's profile Send private message Reply with quote
nik



Joined: 17 Mar 2008
Posts: 7
Location: Russia, Vladivostok
actually works this:
Code:
fasm.exe "c:\bin\%~n1.asm"
    

and it confuses
Post 17 Mar 2008, 05:30
View user's profile Send private message Reply with quote
Grom PE



Joined: 13 Mar 2008
Posts: 113
Location: i@grompe.org.ru
Code:
> fasm.exe c:\bin\"hello world".asm
    

nik, never expect this to work. It would be actually three parameters.
If you want to remove quotes, use %~1 for substitution.
It's still not clear, what are you trying to do?
Post 17 Mar 2008, 07:33
View user's profile Send private message Visit poster's website Reply with quote
nik



Joined: 17 Mar 2008
Posts: 7
Location: Russia, Vladivostok
2 Grom PE
basically i want to pass file name as a parameter to fasmN.cmd and add path and extension

if there's a space in a file name i can't do this:
> fasmN hello world
because there would be 2 params: %1==hello %2==world

so i do this:
> fasmN "hello world"
and
Code:
fasm.exe c:\bin\%1.asm    

doesn't work !

and i DO expect this would work because my own C++ app using standard header <fstream> handles such paths correctly
Post 17 Mar 2008, 08:15
View user's profile Send private message Reply with quote
nik



Joined: 17 Mar 2008
Posts: 7
Location: Russia, Vladivostok
Grom PE wrote:

use %~1 for substitution.

yeah actually i didn't now this Embarassed
but it would be better if %1 worked too though
Post 17 Mar 2008, 08:26
View user's profile Send private message Reply with quote
shoorick



Joined: 25 Feb 2005
Posts: 1604
Location: Ukraine
do not see here any problem. call your file hello.asm - this definetly will help.
Post 17 Mar 2008, 10:01
View user's profile Send private message Visit poster's website Reply with quote
nik



Joined: 17 Mar 2008
Posts: 7
Location: Russia, Vladivostok
2 shoorick
yes you're right but i want my cmd-files be more *general*
because i use them for my C-compiler (my task at university)
Post 17 Mar 2008, 10:51
View user's profile Send private message Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
nik: internal quotation marks aren't standard, neither Notepad or Notepad++ handles them. "type" from a command prompt does, though.
Post 17 Mar 2008, 14:21
View user's profile Send private message Visit poster's website Reply with quote
nik



Joined: 17 Mar 2008
Posts: 7
Location: Russia, Vladivostok
2 f0dder
Sad too bad of me -- i have really thought otherwise
thanks for the info
Post 18 Mar 2008, 05:17
View user's profile Send private message Reply with quote
sinsi



Joined: 10 Aug 2007
Posts: 687
Location: Adelaide
Have you looked at %* instead of %1 - it gives you the whole command-line parameter, including spaces (I think).
Post 18 Mar 2008, 05:47
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2019, Tomasz Grysztar.

Powered by rwasa.