Loading ...
Sorry, an error occurred while loading the content.

Re: [Clip] Forming strings from separate lines

Expand Messages
  • Hugo Paulissen
    ... Hi John, If you have the table data in a separate document, with no trailing blank lines, this should work (well, it does for me). ^!ClearVariables ^!Set
    Message 1 of 2 , Sep 4, 2009
    • 0 Attachment
      > I have encountered a situation where data from from a 2-line
      > table ends up with each data element on a separate line.
      > I'd like to format them as indicated.
      >
      > Of course, sometimes it won't be N/A, but the actual value,
      > of variable length, such as 125mg. Also, there may be a
      > different number of elements, though I haven't seen any examples
      > of that yet.
      >
      > Ideas?

      Hi John,

      If you have the table data in a separate document, with no trailing blank lines, this should work (well, it does for me).

      ^!ClearVariables
      ^!Set %StopAt%=^$Calc(^$GetLineCount$/2)$
      ^!Jump 1
      ^!Set %NewLine%=^$getLine$: ^$getLine(+^%StopAt%)$
      ^!Jump +1
      ^!Append %Recipe%=^%NewLine%^%NL%
      ^!If ^$GetRow$>^%StopAt% INSERT
      ^!Goto Skip_-4
      :INSERT
      ^!Select All
      ^%Recipe%

      Hugo




      [Non-text portions of this message have been removed]
    Your message has been successfully submitted and would be delivered to recipients shortly.