NthArgument() question

May 20, 2008
11,518
102
Syracuse, NY, USA
If I do this,
WCHAR szClassExpr[128] = L"*";
and later while parsing a command line,
else if ( !lstrcmpi(arg, L"/CLASS") )

NthArgument(psz, (++i) | 0x8800, szClassExpr, NULL);
and no argument was provided to the "/CLASS" option, then NthArgument() fails (not finding arg ++i) but szClassExpr gets clobbered (winds up with szClassExpr[0] == 0). This clobbering is mildly inconvenient. Can it be used to advantage? Thanks
 

rconn

Administrator
Staff member
May 14, 2008
12,404
152
vefatica wrote:

> If I do this,
>
> WCHAR szClassExpr[128] = L"*";
>
> and later while parsing a command line,
>
> else if ( !lstrcmpi(arg, L"/CLASS") )
>
> NthArgument(psz, (++i) | 0x8800, szClassExpr, NULL);
>
> and no argument was provided to the "/CLASS" option, then NthArgument()
> fails (not finding arg ++i) but szClassExpr gets clobbered (winds up
> with szClassExpr[0] == 0). This clobbering is mildly inconvenient. Can
> it be used to advantage? Thanks

WAD - the target argument is always cleared, regardless of whether
there's a matching argument. This will definitely not be changed, as it
would break most of the internals in TCC & Take Command.

Rex Conn
JP Software
 
Similar threads
Thread starter Title Forum Replies Date
vefatica NthArgument with 0x8800 and the single quote Plugins 9
vefatica Tough (?) programming question Plugins 5
vefatica Question about screen buffer handles Plugins 2
vefatica Question for someone with sysutils and Windows 10 Plugins 4
vefatica Question for Rex Plugins 1
Charles Dye SearchPaths() question Plugins 4
vefatica Question for Rex Plugins 0
Charles Dye A weirdoid plugin question Plugins 6
Charles Dye Keystroke plugins question Plugins 7
vefatica A question for Rex Plugins 5
S How to? SafeChars.dll question Plugins 4
Charles Dye Binary buffers question Plugins 0
M Just a curiosity question related to the "default" set of re-mapped characters... Plugins 2
vefatica Question about Ctrl events Plugins 2
vefatica Generic programming question Plugins 2
vefatica Compiler question Plugins 8
vefatica Plugin keyhandler observation/question Plugins 15
vefatica PLUGININFO question Plugins 9
vefatica Plugin keyhandler question Plugins 1
vefatica Pipe question Plugins 6
vefatica Code page question Plugins 2
vefatica Unicode question (revisited, question for Rex) Plugins 0
vefatica Sprintf question Plugins 1
vefatica Unicode question Plugins 13
vefatica Question about GetToken() Plugins 7
vefatica Plugin question Plugins 3
vefatica Another Sscanf question Plugins 1
vefatica Ctrl handling question Plugins 8
vefatica Message pumping question Plugins 12

Similar threads