Alaska Software Inc. - Upgraded to xBase 2.0 but now command line parameter in quotes puts the final " in the character string, though it drops the first "
Username: Password:
AuthorTopic: Upgraded to xBase 2.0 but now command line parameter in quotes puts the final " in the character string, though it drops the first "
Robert MarksUpgraded to xBase 2.0 but now command line parameter in quotes puts the final " in the character string, though it drops the first "
on Fri, 12 Dec 2014 16:37:19 -0800
I pass a directory to my program as follows:
PROG.EXE "\\Server Name\c\Dir Name\"

The program procedure is simply:
PROCEDURE Main(cCommand)

This worked fine in xbase++ 1.9, but when I upgraded to 2.0, the cCommand 
string loaded as follows:
\\Server Name\c\Dir Name\"
with the first quote properly dropped, but the last quote placed in the 
string.

My program is a large hybrid program (I know, I know... I promise someday I 
will get it converted). However, when I try to recreate the error in small 
test programs everything works fine.Obiously, the simple work around is to 
strip the quotation mark, but I thought maybe someone at Alaska would like 
to know that 2.0 has a bug, albeit a very low priority one..
Wilbert SiebringRe: Upgraded to xBase 2.0 but now command line parameter in quotes puts the final " in the character string, though it drops the first "
on Thu, 07 May 2015 11:10:05 +0200
Currently we experience the same kind of problem...
If a parameter with a backslash followed by double quotes is passed as an argument of the 
main function, then the backslash character seems to be used as an escape character for the 
double quotes character in xbase++ 2.0.
In xbase++ 1.9 the backslash character is correctly passed.

Attached is a very simple demo program.

Example program output:
xbase++ 1.9: 
    command: argtest "test\" 
    output: test\
xbase++ 2.0: 
    command: argtest "test\"
    output: test"

Are there any plans to fix this possible bug, or is this an "undocumented" change?



Robert Marks wrote in message news:6b6eefe4$291860f4$213180@news.alaska-
software.com...
>I pass a directory to my program as follows:
>PROG.EXE "\\Server Name\c\Dir Name\"
>
>The program procedure is simply:
>PROCEDURE Main(cCommand)
>
>This worked fine in xbase++ 1.9, but when I upgraded to 2.0, the cCommand 
>string loaded as follows:
>\\Server Name\c\Dir Name\"
>with the first quote properly dropped, but the last quote placed in the 
>string.
>
>My program is a large hybrid program (I know, I know... I promise someday I 
>will get it converted). However, when I try to recreate the error in small 
>test programs everything works fine.Obiously, the simple work around is to 
>strip the quotation mark, but I thought maybe someone at Alaska would like 
>to know that 2.0 has a bug, albeit a very low priority one..



argtest.prg
Andreas HerdtRe: Upgraded to xBase 2.0 but now command line parameter in quotes puts thefinal " in the character string, though it drops the first "
on Tue, 12 May 2015 10:19:16 +0200
Robert, Wilbert,

Thanks for your efforts.

The PDR is 6645:

http://www.alaska-software.com/scripts/waa001.dll?WAA_PACKAGE=PUBLICDTS&WAA_FORM=DISPLAYPDR&PDRID=6645

We need to dig further into this issue, from my current perspective, this
seems to be intended behaviour and it is not documented.

Beside of the workaround you may consider to have a blank between the
last backslash and the double quote. However, this is dangerous because
you must not forget to trim what was passed to the application (The space
will be preserved).

Side note: Because of the new behaviour you have no trouble to pass
double quotes to the application. Try this:

"\\server \"name\share

You may also escape double quotes by another preceeding one:

"\\server ""name\share

If your backslash is the last thing in the commandline, you just can skip 
the trailing
double quote:

"\\server ""name\share\

Last thing: I know that double quotes do not make any sense in a path name 


Andreas Herdt
Alaska Software

-------------------------------------------------------------------- 

Technical Support: support@alaska-software.com

News Server: news.alaska-software.com
Homepage: http://www.alaska-software.com
WebKnowledgeBase: http://www.alaska-software.com/kbase.shtm

Fax European Office: +49 (0) 61 96 - 77 99 99 23
Fax US Office: +1 (646) 218 1281
-------------------------------------------------------------------- 


"Wilbert Siebring" schrieb im Newsbeitrag 
news:5502be73$152fb600$239fe@news.alaska-software.com...

Currently we experience the same kind of problem...
If a parameter with a backslash followed by double quotes is passed as an 
argument of the
main function, then the backslash character seems to be used as an escape 
character for the
double quotes character in xbase++ 2.0.
In xbase++ 1.9 the backslash character is correctly passed.

Attached is a very simple demo program.

Example program output:
xbase++ 1.9:
    command: argtest "test\"
    output: test\
xbase++ 2.0:
    command: argtest "test\"
    output: test"

Are there any plans to fix this possible bug, or is this an "undocumented" 
change?



Robert Marks wrote in message news:6b6eefe4$291860f4$213180@news.alaska-
software.com...
>I pass a directory to my program as follows:
>PROG.EXE "\\Server Name\c\Dir Name\"
>
>The program procedure is simply:
>PROCEDURE Main(cCommand)
>
>This worked fine in xbase++ 1.9, but when I upgraded to 2.0, the cCommand
>string loaded as follows:
>\\Server Name\c\Dir Name\"
>with the first quote properly dropped, but the last quote placed in the
>string.
>
>My program is a large hybrid program (I know, I know... I promise someday I
>will get it converted). However, when I try to recreate the error in small
>test programs everything works fine.Obiously, the simple work around is to
>strip the quotation mark, but I thought maybe someone at Alaska would like
>to know that 2.0 has a bug, albeit a very low priority one..