News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Commandline syntax

Started by jj2007, August 30, 2010, 08:40:30 AM

Previous topic - Next topic

jj2007

Quote from: sinsi on August 31, 2010, 08:16:41 AM
Well I think it's a bad idea jj. A single quote is a legitimate filename character. Look how much chaos a space can cause, now you want to add to that?

Sorry, I don't understand where the problem is. If you drag one of these exotic single quote files over get cl.exe, you do get the correct result with MasmBasic CL$(n)...

sinsi

But you are talking of using the character ' as a quote/delimiter. For me, your results in the second test are wrong at arg4.

Quote from: jj2007 on August 31, 2010, 08:02:25 AM
This line behaves marginally different:
"get cl.exe" arg1 "'Lead2" "Tail3'" 'these "quotes" are cute' "isn't it fun?" "'apo quotes'"

Results for MasmBasic CL$(n):
arg #0 = [get cl.exe]
arg #1 = [arg1]
arg #2 = ['Lead2]
arg #3 = [Tail3']
arg #4 = [these "quotes" are cute]
arg #5 = [isn't it fun?]
arg #6 = ['apo quotes']

Results for Masm32 GetCL:
arg #0 = [get cl.exe]
arg #1 = [arg1]
arg #2 = ['Lead2]
arg #3 = [Tail3']
arg #4 = ['these]
arg #5 = [quotes]
arg #6 = [are]
arg #7 = [cute']
arg #8 = [isn't it fun?]
arg #9 = ['apo quotes']

For a specific use it works, as long as you know it, but it goes against the convention of using character " to enclose single args.
Light travels faster than sound, that's why some people seem bright until you hear them.

FORTRANS

Quote from: sinsi on August 31, 2010, 07:35:46 AM
The single quote has always been a legal character, the double quote hasn't. All up to you how you want to do it, but convention says no.

Hi,

   That was what I was trying to say.  Thanks for clarifying.

Cheers,

Steve

jj2007

Four exotic files dropped over Get CL.exe, original commandline as received from GetCommandLine:
Quote"D:\masm32\RichMasm\Get CL.exe" D:\masm32\RichMasm\Tail' D:\masm32\RichMasm\'Lead "D:\masm32\RichMasm\Copy of Apo'po'.txt" D:\masm32\RichMasm\Apo'po'.txt

Results for MasmBasic CL$(n):
arg #0 = [D:\masm32\RichMasm\Get CL.exe]
arg #1 = [D:\masm32\RichMasm\Tail']
arg #2 = [D:\masm32\RichMasm\'Lead]
arg #3 = [D:\masm32\RichMasm\Copy of Apo'po'.txt]
arg #4 = [D:\masm32\RichMasm\Apo'po'.txt]


Results for Masm32 GetCL:
arg #0 = [D:\masm32\RichMasm\Get CL.exe]
arg #1 = [D:\masm32\RichMasm\Tail']
arg #2 = [D:\masm32\RichMasm\'Lead]
arg #3 = [D:\masm32\RichMasm\Copy of Apo'po'.txt]
arg #4 = [D:\masm32\RichMasm\Apo'po'.txt]