MailMergeGetText: TWPMMInsertTextContents lost members

  • Hello!

    In WpTools 4 I used TWPInsertTextContents' members
    C, Band, pMergeAttr, FloatValue, IntValue and BoolValue,
    which are now missing in TWPMMInsertTextContents.

    FloatValue, IntValue and BoolValue:
    Why were they removed? Actually, I helped me converting them to a string and assigning it to StringValue.

    C:
    I guess, this is c now.

    Band:
    How can I find out, whether a band and what band is actually processed by MailMergeGetText?

    pMergeAttr:
    I guess, this is MergeAttr, but it has fundamentally changed. Can you please give me some hints where to look into the documentation to find
    something about old TAttr and new TWPStoredCharAttrInterface?

    Thank you,
    E. Hess

    • Offizieller Beitrag
    Zitat

    In WpTools 4 I used TWPInsertTextContents' members
    C, Band, pMergeAttr, FloatValue, IntValue and BoolValue,
    which are now missing in TWPMMInsertTextContents.

    FloatValue, IntValue and BoolValue:
    Why were they removed? Actually, I helped me converting them to a string and assigning it to StringValue.

    In this version the TWPInsertTextContents is the same object as it is used by the TWPRichText event OnMailMergeGetText. This makes it much easier to copy code and upgrade projects to use WPReporter.

    In version 4 the contents object inherited from the number class of the eval engine. This was a nice idea but did not work out so well. So you need to write a utility procedure to format your string.

    >>C:
    I guess, this is c now. <<

    This is true but it does not have a meaning anymore. The merge fields in WPTools 5 are wapped by objects, nit by characters. The old 'c' is preserverd by the reader and stored in the object.

    Zitat

    Band:
    How can I find out, whether a band and what band is actually processed by MailMergeGetText?

    Using WPSuperMerge1.Stack you have access to the current TWPTextCombineStack object which is used during the reporting. You can access preceding stack objects using the Previous property. The current group is 'group' - it can be nil!

    Zitat

    pMergeAttr:
    I guess, this is MergeAttr, but it has fundamentally changed. Can you please give me some hints where to look into the documentation to find
    something about old TAttr and new TWPStoredCharAttrInterface?

    See in PDF manual, "Guide\Tasks\Set Attributes in Code" - here the 'AttrHelper' object is used which is internally also a TWPStoredCharAttrInterface.

    The TAttr in V4 was a quite big record with pMergeAttr beeing a pointer to it. That concept has been changed - each character is using 4 bytes to store the possible 16 attributes (not all are used yet). The TWPStoredCharAttrInterface is used to calculate the 3 byte value which represents a set of properties.

    Julian Ziersch