Skip to main content
Inspiring
September 28, 2010
Question

expression - help!

  • September 28, 2010
  • 1 reply
  • 1882 views

I have a complex file that grew to 35 conditions in the days before FM8 expressions. I used Webworks to convert to help, and had the conditions and variables for each desired output defined in a separate FM settings file, so I just needed to import those into the book and convert. Happy Happy.

Flash forward, the files are now in FM8 and I use TCS1 to convert to help, so I have to set the conditions using an expression in FM. Having to create the expression manually with so many conditions is tedious and error-prone, so I'm <finally> able to take the time to clean up the conditions to reduce them to the bare minimum required and multiple-tag paragraphs as necessary. However, I'm testing the expression first and can't get the output I want, and haven't been able to find a resource to help me (if anyone knows of such a beast, please direct me there).

Here's the setup:

Conditions:
- A, B, C, D (a para can be any or all of these, but only one can be chosen for output)

- cake or pie (mutually exclusive, and one must be chosen for output)

- apple or orange (mutually exclusive, and one must be chosen for output)

- comment (this would only be included for review output, hidden for final)

So I want output for A/cake/apple. The closest I've gotten is to say:

"A" or "cake" or "apple" andnot "B" andnot "C" andnot "D" andnot "pie" andnot "orange"

However the output still shows a paragraph that is tagged as "A and C and orange".   (it's ok to include paras tagged B,C, or D as long as they are also A, but apple/orange should be mutually exclusive).

Any guidance (or pointers to where this is more clearly documented) would be tremendously appreciated.

    This topic has been closed for replies.

    1 reply

    Van Kurtz
    Inspiring
    September 28, 2010

    From your description, I think it is as simple as:

    A or cake or apple

    Since cake/pie and apple/orange are each mutually exclusive, you do not need to specify something like cake andnot pie to show cake. When using expressions, it is not necessary to specifically hide something, especially if the conditions are mutually exclusive. Showing cake will not show pie UNLESS a para is tagged with both. I am assuming because they are mutually exclusive, you are not tagging a para with both. If you ARE then, you still want to show cake even though it is also tagged pie.

    You state:

    A, B, C, D (a para can be any or all of these, but only one can be chosen for output)

    Again, if a para is tagged A and C and you want to show A, then simply state show A. If a para is tagged A and C, then A andnot C hides the paragraph. Again, do not state andnot to hide something unless you really do not want it to show, no matter what the other tags may be.

    Also, if you want A to show but only if it is not tagged with B, C, or D, then you should try:

    A andnot B andnot C andnot D or cake or orange

    One issue that has always been unknown to me is how much of the expression does FrameMaker evaluate when determining what to show. In standard logic, the statement A or B is true if A is true, B is true, or both are true. Most computer programs stop the evaluation if A is determined to be true, because the whole statement is true no matter the value of B.

    On the other hand, A and B is true only if both A and B are true. In this case, if A is true, then the computer must also evaluate B. If this is really what FrameMaker is doing, then putting the andnot's right after the A forces FrameMaker to evaluate the expression all the way to the first or. Putting them at the end means they may not be evaluated if A is true (that is, shown). But this may just be my way of understanding how expressions work. At least, it works for me.

    By the way, I have used expressions to handle multi-conditioned text, and I had lots of problems with it, namely, FrameMaker crashed a lot. After the last project, I switched to using the AXCM plugin from West Street Consulting. It is free, but work only in structured FrameMaker.

    Hope this helps,

    Van

    Inspiring
    September 28, 2010

    Thanks for your response, Van.

    <to clarify (or maybe further mudify), one of the mutually-exclusive tags is for help vs print; so I've got provincial output (A/B/C/D etc.), one of two versions (cake/pie) and help/print output -- so I want province A, cake flavour, print output>

    I did try the simple way first ("A" or "cake" or "apple"), but that still showed the following paragraphs tagged as:

    "A and C and orange"

    "B and apple"

    The first should be excluded because it contains "orange", the second because it does not contain "A".

    So I guess to re-state my need, ANYTHING with "pie" or "orange" should be excluded. After that, paras with "A" should be included even if other letters that are also tagged, and paras that are tagged other letters and not A should be excluded.

    I could stick with what works currently:

    - everything is single tagged with sometimes cumbersome tags (from FM7) such as cake_A_orange, cake_A, A_orange, etc.

    - I create an expression to exclude everything I don't want (that's a whole lot of ANDNOTs)

    However this is a drag and will get worse as the product supports more provinces (for each prov, PDF & help output for each of two flavours).

    Any suggestions? I wish I'd paid more attention in math class now...

    Inspiring
    September 29, 2010

    Argus,

    Far and away, the best suggestion I can think of is to ditch all of this and structure your documents. Then you can use structural metadata to manage conditions, which is considerably more manageable and flexible. All of these explanations so far are so bewildering in their complexity... I'm not sure how anyone can deal with it.

    I'm also not sure exactly when conditional text was introduced to FrameMaker, but I'd be willing to bet that we are getting close to 20 years ago. That means you are attempting to use 20-year-old technology to manage the intricacies of modern-day manufacturing and documentation. It has to be taking a big hit on the efficiency of your operations.

    Russ


    Thanks all for your time and help.

    Yes, these files have become unbelievably complicated. No one else at my company will touch them! In the beginning there was no talk of additional provinces, but over the years new provinces have been added, and there are likely more to come. I have the time now (and the client is T&M, so no budget worries) to tackle cleaning up/reorganizing the files to make them less fearsome to my coworkers! Sigh - it was so much easier with FM7/WW and I could use FM settings files to import condition settings...

    @Jeff - the files are already tagged with single conditions, that's the problem. I was hoping to reduce the number of conditions (from 35 to 11), apply multiple conditions as required, and use expressions, but that's looking like it won't work.

    @Van - thanks, but it's still not quite right. A paragraph could be unconditional or have any combination of conditions (with the aformentioned exception that cake/pie and apple/orange are mutually exclusive). So a para could be A+cake, A+B+D+cake+orange, B+apple, apple, C, A+B+D, etc.

    But I now understand that I should be including, rather than excluding, contrary to what a former coworker deduced from his experimentation a year or so ago. So for now it's easier to include eight with OR statements than to exclude 27 with ANDNOT statements.

    I will definitely look into structured FM, it sounds like the perfect solution (thank you, Michael, for the helpful document that showed how).

    Can anyone point me to a resource that will help reduce the learning curve?