How to? Passing arg to gosub with white spaces

Oct 18, 2008
354
2
Hello --

this code is not working as I expected it wot work ... I want the subroutine out just to echo
the entire argument as text -- what did I miss?

Thanks

fpe

@echo on
set item=foo bar
set qitem=%@quote["%item"]

gosub out "This is a test %qitem"
quit

:out [ text ]

echo %text
return
 
Same result here. And same result if I pass %item and not %qitem as follows:

gosub out "This is a test "%item""

But if the goal is to get the entire string displayed, quoted, why not do this:

gosub out "This is a test %item"

Result (here, anyway):

"This is a test foo bar"
 
umm .. I get it its counting quotes and its stopping with the embedded quote in the variable -- thanks
 

Similar threads