• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

displaying Leading Zeros for file count in a book? without hacking?

Explorer ,
Feb 24, 2022 Feb 24, 2022

Copy link to clipboard

Copied

I asked this a couple of years back and was curious as to know if this can (will) be added to potential future versions of FrameMaker?

ex: 1-001 to 1-025, 2-001 to 2-370, 3-001 to 3-500, 4-001... etc.

[where the first value is the section (or chapter) and the 3 remaining digits represent a counter of files in that section] 

Views

186

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 24, 2022 Feb 24, 2022

Copy link to clipboard

Copied

It still requires hacking. You can go to https://tracker.adobe.com and put in a feature request. If you want a scripting solution, please contact me offlist.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 25, 2022 Feb 25, 2022

Copy link to clipboard

Copied

You may have a look into my website https://www.daube.ch/docu/fmaker88.html. In the FMjsxLib there is a function FormatValue with this snippet:

 

 

 

   case "J":
      if (value > 0) {
        value = (Math.floor (value));
      } else {
        value = (Math.ceil (value));
      }
      sResult = KLD_Z.PadWith0(value, fmtSize);
      return sResult;

 

 

 

The function PadWith0 is this

 

 

 

KLD_F.PadWith0 = function (number, nPlaces) { // ================================
/*            Pad figures with leading zeroes
Arguments     number: any positive number
              nPlaces: resulting length after padding
Returns       Function value =  string: padded number: 7,2 => 07; 1234,3 => 1234
Comment       If nPlaces is insufficient, the last figure will become a ?
              Negative numbers are rejected as NaN.
Called by     FormatValue, GetTmpVarName
History       < 2019
*/
var j, jMax, sResult;

  if (number < 0) {return NaN;}
  sResult = number;
  if (typeof number == "number") {
    sResult = String(number);
  }
  jMax = nPlaces - sResult.length;
  if (jMax < 0 ) {
    sResult = sResult.substr (0, nPlaces - 1) + "?";
  } else {
    for (j = 0; j < jMax; j++) {
      sResult = '0' + sResult;
    }
  }
  return sResult;
} //--- end PadWith0 -----------------------------------------------------------------

 

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 25, 2022 Feb 25, 2022

Copy link to clipboard

Copied

That format is often used in ATA (airlines) and MIL-SPEC (govt/military) docs.

Are you trying to develop support for something like this?

Structured solutions are available commercially for many of those standards. 

-Matt

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 25, 2022 Feb 25, 2022

Copy link to clipboard

Copied

Matt, very perceptive! I would love some insight on those options!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 25, 2022 Feb 25, 2022

Copy link to clipboard

Copied

A few of us here have worked with clients with similar needs, so we tend to recognize a pattern!

 

The requirements go quite a bit past the leading zero requirement in the pageblock, and thus not many internal departments can develop the needed components on their own.


What standard(s) do you need to support?

 

-Matt

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 25, 2022 Feb 25, 2022

Copy link to clipboard

Copied

I believe we are setting up to be S1000D compliant when that stands-up for us. We're currently developing technical cards for maintenance and using FM as best as we can since we already had licenses for them. Trying to make the writers' job easier by creating templates from scratch but as it sits, I'm not code-saavy enough to hack the system.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 25, 2022 Feb 25, 2022

Copy link to clipboard

Copied

LATEST

The connections for S1000D are already in Fm, but setting up everything your writers need will be quite the project, especially if you've not done a project like this one.

It's likely much more cost effective to look at taking advantage of existing solutions.

Mekon Aerospace develops and provides S1000D support. 

See https://aerospace-defence.com/index.php/tech-pubs/solutions/adobe-plugins/ and please let Julian and Susanne know I sent you their way!

-Matt

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines