Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Splitting local macro or string with line break

    Hi. I would like to do the following in a do file

    Code:
    local list `"  "worldwide", "argentina",  "australia", "austria", "belgium", "brazil", "canada", ///
    "chile", "china", "colombia", "denmark", "finland", "france", "germany", "greece", ///
    "hong kong", "india", "ireland", "israel", "italy", "japan" , "luxembourg",        ///
    "malaysia", "mexico", "netherlands", "new zealand", "norway", "peru", "us", "eu",  ///
    "philippines", "portugal", "russian federation", "south africa", "south korea",   ///
    "spain", "sweden", "switzerland", "thailand", "turkey", "uk", "usa", "venezuela"  "'
    So I would like to split the string over multiple lines using the line-join operator. However it does not seem to work. Neither does trying to change the delimiter (#delimit ; ). Could someone please explain the correct method of splitting a long local string over multiple lines?

  • #2
    This works for me; how does your situation differ?
    Code:
    #delim ;
    local list `"  "worldwide", "argentina",  "australia", "austria", "belgium", "brazil", "canada", 
    "chile", "china", "colombia", "denmark", "finland", "france", "germany", "greece", 
    "hong kong", "india", "ireland", "israel", "italy", "japan" , "luxembourg", 
    "malaysia", "mexico", "netherlands", "new zealand", "norway", "peru", "us", "eu", 
    "philippines", "portugal", "russian federation", "south africa", "south korea", 
    "spain", "sweden", "switzerland", "thailand", "turkey", "uk", "usa", "venezuela"  "';
    #delim cr
    macro list _list
    Code:
    . #delim ;
    delimiter now ;
    . local list `"  "worldwide", "argentina",  "australia", "austria", "belgium", "brazil", "canada
    > ", 
    > "chile", "china", "colombia", "denmark", "finland", "france", "germany", "greece", 
    > "hong kong", "india", "ireland", "israel", "italy", "japan" , "luxembourg", 
    > "malaysia", "mexico", "netherlands", "new zealand", "norway", "peru", "us", "eu", 
    > "philippines", "portugal", "russian federation", "south africa", "south korea", 
    > "spain", "sweden", "switzerland", "thailand", "turkey", "uk", "usa", "venezuela"  "';
    
    . #delim cr
    delimiter now cr
    . macro list _list
    _list:           "worldwide", "argentina", "australia", "austria", "belgium", "brazil",
                    "canada", "chile", "china", "colombia", "denmark", "finland", "france",
                    "germany", "greece", "hong kong", "india", "ireland", "israel", "italy", "japan"
                    , "luxembourg", "malaysia", "mexico", "netherlands", "new zealand", "norway",
                    "peru", "us", "eu", "philippines", "portugal", "russian federation", "south
                    africa", "south korea", "spain", "sweden", "switzerland", "thailand", "turkey",
                    "uk", "usa", "venezuela"
    
    .

    Comment

    Working...
    X