1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to? Passing arg to gosub with white spaces

Discussion in 'Support' started by fpefpe, Oct 21, 2014.

  1. fpefpe

    Joined:
    Oct 18, 2008
    Messages:
    238
    Likes Received:
    1
    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
     
  2. mikea

    Joined:
    Dec 7, 2009
    Messages:
    210
    Likes Received:
    2
    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"
     
  3. fpefpe

    Joined:
    Oct 18, 2008
    Messages:
    238
    Likes Received:
    1
    umm .. I get it its counting quotes and its stopping with the embedded quote in the variable -- thanks
     

Share This Page