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

MergeField function in Describe

Expand Messages
  • Craft-Bilt Materials Ltd.
    I am calling the following macro during a merge MACRO RefLetInsertsBLPRLparagraph IF MergeField = info@cbm.on.ca THEN GoToLinkTag BLPRL PUT ...blah blah
    Message 1 of 9 , May 8, 2002
      I am calling the following macro during a merge

      MACRO RefLetInsertsBLPRLparagraph
      IF MergeField = "info@..." THEN
      GoToLinkTag "BLPRL"
      PUT "...blah blah blah..."
      PUT "...blah blah blah..."
      PUT "...blah blah blah... "
      END IF
      END MACRO

      The text from the PUT command is placed in the original form, not the new document as it should be. Does
      anyone have experience with this function?

      Thanks.



      =================
      Bart Bremmers
      Markham, Ontario

      Member Toronto OS/2 User Group
    • Steven Levine
      In , on 05/08/02 ... I don t have an specific experience, but if I understand what Describe s capable of in a
      Message 2 of 9 , May 8, 2002
        In <200205081946.g48JkB429217@...>, on 05/08/02
        at 03:45 PM, "Craft-Bilt Materials Ltd." <cbm@...> said:

        >MACRO RefLetInsertsBLPRLparagraph
        > IF MergeField = "info@..." THEN
        > GoToLinkTag "BLPRL"
        > PUT "...blah blah blah..."
        > PUT "...blah blah blah..."
        > PUT "...blah blah blah... "
        > END IF
        >END MACRO

        I don't have an specific experience, but if I understand what Describe's
        capable of in a merge, the attempt to reposition to cursor is causing the
        problem. To test this, check if the PUT stuffs the data in the merge
        field if you omit the goto.

        You can probably achieve the effect you want by making BLRPL an merge
        field and attaching a macro to it. This macro can interrogate a global
        variable set by RefLstInsertsBLPRLparagraph and PUT as needed.

        Steven


        --
        ---------------------------------------------------------------------
        "Steven Levine" <steve53@...> MR2/ICE 2.31a #10183 Warp4/FP15/14.085_W4
        www.scoug.com irc.webbnet.org #scoug (Wed 7pm PST)
        ---------------------------------------------------------------------
      • Craft-Bilt Materials Ltd.
        ... Actually, I used the goto because the text was being placed at the cursor position of when the document was saved, near the top. Like you, I assumed that
        Message 3 of 9 , May 9, 2002
          >I don't have an specific experience, but if I understand what Describe's
          >capable of in a merge, the attempt to reposition to cursor is causing the
          >problem. To test this, check if the PUT stuffs the data in the merge
          >field if you omit the goto.
          Actually, I used the goto because the text was being placed at the cursor position of when the document was
          saved, near the top. Like you, I assumed that calling a macro from a merge field would place the text directly
          after that merge field.

          >You can probably achieve the effect you want by making BLRPL an merge
          >field and attaching a macro to it. This macro can interrogate a global
          >variable set by RefLstInsertsBLPRLparagraph and PUT as needed.
          Not sure I understand, the macro is already attached to a merge field. In fact, the help says MergeField only
          works in a macro attached to a merge field. BTW, the merge is initiated from another macro using
          MergeImmediate
          Can you ellaborate?



          ==================
          Bart Bremmers, G.M.
          Craft-Bilt Materials Ltd.
          Markham, Ontario
        • Steven Levine
          In , on 05/09/02 ... I may have misunderstood the intent of your GoTo. I though you were putting the text
          Message 4 of 9 , May 9, 2002
            In <200205091517.g49FGs419315@...>, on 05/09/02
            at 11:16 AM, "Craft-Bilt Materials Ltd." <cbm@...> said:

            >Actually, I used the goto because the text was being placed at the cursor
            >position of when the document was saved, near the top. Like you, I
            >assumed that calling a macro from a merge field would place the text
            >directly after that merge field.

            I may have misunderstood the intent of your GoTo. I though you were
            putting the text elsewhere, based on the content of the merge field. For
            example, adding a note at the bottom of an statement. If Describe is not
            positioning the cursor to the merge field before invoking the macro,
            there's something we don't understand about the process.

            >Not sure I understand, the macro is already attached to a merge field. In
            >fact, the help says MergeField only works in a macro attached to a merge
            >field. BTW, the merge is initiated from another macro using
            >MergeImmediate

            As I mentioned above, I probably misread the intent of the Goto. In my
            example there would be a macro attached to each field. The first macro
            would set a global which the second macro would query and act on. It
            would avoid the need for the GoTo.

            BTW, which version of Describe are you running?

            When I get a play-moment, I'll hunt though some of my archives for hints.

            Steven


            --
            ---------------------------------------------------------------------
            "Steven Levine" <steve53@...> MR2/ICE 2.31a #10183 Warp4/FP15/14.085_W4
            www.scoug.com irc.webbnet.org #scoug (Wed 7pm PST)
            ---------------------------------------------------------------------
          • Craft-Bilt Materials Ltd.
            ... 5.0.6 ================= Bart Bremmers Markham, Ontario Member Toronto OS/2 User Group
            Message 5 of 9 , May 9, 2002
              On Thu, 09 May 2002 09:33:32 -0700, Steven Levine wrote:

              >BTW, which version of Describe are you running?
              5.0.6



              =================
              Bart Bremmers
              Markham, Ontario

              Member Toronto OS/2 User Group
            • Steven Levine
              In , on 05/09/02 ... OK, I ve pretty much decided your problem is a Describe design defect relating to document
              Message 6 of 9 , May 9, 2002
                In <200205091744.g49Hik424274@...>, on 05/09/02
                at 01:44 PM, "Craft-Bilt Materials Ltd." <cbm@...> said:

                >>BTW, which version of Describe are you running?
                >5.0.6

                OK, I've pretty much decided your problem is a Describe design defect
                relating to document focus and selection within a merge macro. The good
                news is there is a workaround. Use the following macro as a testcase to
                see what's going on inside Describe.

                macro tmp
                put "Before"
                NewLine
                put "Selected " + SelectedDocument
                NewLine
                put "Focus " + FocusDocument
                NewLine
                NextDocument
                put "After"
                NewLine
                put "Selected " + SelectedDocument
                NewLine
                put "Focus " + FocusDocument
                NewLine
                Set CursorLineNumber to 6
                put "Here I am"
                PreviousDocument
                end macro

                I'll leave the dirty details of positioning the cursor and ensuring you
                always exit the macro with the correct document to you. You can't use
                the GoTo because the tags don't get copied to output document.

                Have fun,

                Steven

                --
                ---------------------------------------------------------------------
                "Steven Levine" <steve53@...> MR2/ICE 2.31a #10183 Warp4/FP15/14.085_W4
                www.scoug.com irc.webbnet.org #scoug (Wed 7pm PST)
                ---------------------------------------------------------------------
              • Craft-Bilt Materials Ltd.
                ... ================== Bart Bremmers, G.M. Craft-Bilt Materials Ltd. Markham, Ontario
                Message 7 of 9 , May 10, 2002
                  On Thu, 09 May 2002 11:19:53 -0700, Steven Levine wrote:

                  >In <200205091744.g49Hik424274@...>, on 05/09/02
                  > at 01:44 PM, "Craft-Bilt Materials Ltd." <cbm@...> said:
                  >
                  >>>BTW, which version of Describe are you running?
                  >>5.0.6
                  >
                  >OK, I've pretty much decided your problem is a Describe design defect
                  >relating to document focus and selection within a merge macro. The good
                  >news is there is a workaround. Use the following macro as a testcase to
                  >see what's going on inside Describe.
                  >
                  >macro tmp
                  > put "Before"
                  > NewLine
                  > put "Selected " + SelectedDocument
                  > NewLine
                  > put "Focus " + FocusDocument
                  > NewLine
                  > NextDocument
                  > put "After"
                  > NewLine
                  > put "Selected " + SelectedDocument
                  > NewLine
                  > put "Focus " + FocusDocument
                  > NewLine
                  > Set CursorLineNumber to 6
                  > put "Here I am"
                  > PreviousDocument
                  >end macro
                  >
                  >I'll leave the dirty details of positioning the cursor and ensuring you
                  >always exit the macro with the correct document to you. You can't use
                  >the GoTo because the tags don't get copied to output document.
                  >
                  >Have fun,
                  >
                  >Steven
                  >
                  >--
                  >---------------------------------------------------------------------
                  >"Steven Levine" <steve53@...> MR2/ICE 2.31a #10183 Warp4/FP15/14.085_W4
                  >www.scoug.com irc.webbnet.org #scoug (Wed 7pm PST)
                  >---------------------------------------------------------------------
                  >
                  >
                  >
                  >
                  >
                  >Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
                  >
                  >


                  ==================
                  Bart Bremmers, G.M.
                  Craft-Bilt Materials Ltd.
                  Markham, Ontario
                • Craft-Bilt Materials Ltd.
                  ... I started to play with it, then realized that the final version of the merge document is supposed to go directly to printer, not to a new document. While
                  Message 8 of 9 , May 10, 2002
                    On Thu, 09 May 2002 11:19:53 -0700, Steven Levine wrote:

                    >I'll leave the dirty details of positioning the cursor and ensuring you
                    >always exit the macro with the correct document to you. You can't use
                    >the GoTo because the tags don't get copied to output document.

                    I started to play with it, then realized that the final version of the merge document is supposed to go directly to
                    printer, not to a new document. While trying to diagnose the problem, I had set it back to "new document". I
                    suppose I could set it to "new Document" and ad a print command to my macro.

                    thanks for your efforts Steve!



                    =================
                    Bart Bremmers
                    Markham, Ontario

                    Member Toronto OS/2 User Group
                  • Steven Levine
                    In , on 05/10/02 ... That might not be required. I would suspect that when going direct to printer, Describe just
                    Message 9 of 9 , May 13, 2002
                      In <200205131218.g4DCIl425920@...>, on 05/10/02
                      at 10:18 AM, "Craft-Bilt Materials Ltd." <cbm@...> said:

                      >I started to play with it, then realized that the final version of the
                      >merge document is supposed to go directly to printer, not to a new
                      >document. While trying to diagnose the problem, I had set it back to "new
                      >document". I suppose I could set it to "new Document" and ad a print
                      >command to my macro.

                      That might not be required. I would suspect that when going direct to
                      printer, Describe just automatically deletes the merge document after
                      formatting and printing. You'll need to verify this, but the same
                      techniques should apply.

                      >thanks for your efforts Steve!

                      You're welcome. This is much more fun than jigsaw puzzles. :-)

                      Steven

                      --
                      ---------------------------------------------------------------------
                      "Steven Levine" <steve53@...> MR2/ICE 2.31a #10183 Warp4/FP15/14.085_W4
                      www.scoug.com irc.webbnet.org #scoug (Wed 7pm PST)
                      ---------------------------------------------------------------------
                    Your message has been successfully submitted and would be delivered to recipients shortly.