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

Re: making sure each file ends with return

Expand Messages
  • thefrankwmx
    Hi Don, If I understand your requirement correctly I think the following will suffice. I tested using a doc with no line return at end, and a doc with several
    Message 1 of 2 , Dec 22, 2001
    • 0 Attachment
      Hi Don,

      If I understand your requirement correctly I think the following will
      suffice. I tested using a doc with no line return at end, and a doc
      with several line returns after last char, with the same result: when
      finished the doc will have one line return after the last char.

      The first exercise demonstrates the method one iteration at a
      time...just keep calling the clip.

      ^!Jump DOC_END
      ^!Set %LastChar%=^$GetChar(-1)$
      ^!Info LastChar = ^%LastChar%
      ^!IfTrue ^$IsEmpty(^%LastChar%)$ Next else AddReturn
      ^!Keyboard Backspace
      ^!Goto End
      :AddReturn
      ^!Keyboard Enter
      ^!Goto End

      The second is the actual clip to use which includes the loop to allow
      a finished result with one call.

      :loop
      ^!Jump DOC_END
      ^!Set %LastChar%=^$GetChar(-1)$
      ^!IfTrue ^$IsEmpty(^%LastChar%)$ Next else AddReturn
      ^!Keyboard Backspace
      ^!Goto loop
      :AddReturn
      ^!Keyboard Enter
      ^!Goto End

      I believe the function of the clip code is fairly obvious in this
      case so I did not add comments. You can add code for whatever you
      want it to do next...

      Regards and Happy Holidays!

      tf
    Your message has been successfully submitted and would be delivered to recipients shortly.