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

Non-Breaking Hyphen in MIF String ?

Community Expert ,
Nov 01, 2011 Nov 01, 2011

Copy link to clipboard

Copied

I'm using a spreadsheet (LibreOffice Calc) to generate the MIF for a Framemaker table: Paste in lines of tab-separated part_numbers and descriptors, copy out raw MIF that opens in Frame as a 3-column table with callout#, part_number and descriptor, each having a unique Xref Marker with marker text based on the p/n & descriptor. It works (including escaping any Frame-special chars in the descriptors), except for one extra feature I'd like to have.

I'd like to make all dashes in the part-numbers into non-breaking hyphens (\x15). Using the Calc function SUBSTITUTE, I can change any character to any arbitrary string. Part numbers may have zero or more dashes.

So for raw string 123-456A, where "-" is an NBH, I'd generate:

<ParaLine <String `123-456A'>

According to the MIF(7) reference, either of these MIFs should work:

<ParaLine <String `123\x15456A'>

<ParaLine <String `123<Char HardHyphen>456A'>

They don't.

They both throw a parsing error on open in Frame.

This doesn't work either:

<ParaLine <String `123\\x15456A'>

It ends up as a literal \x15 in the final table.

This Calc function doesn't work either (where decimal 21 is hex 15):

=SUBSTITUTE($RawData.A3;"-";"CHAR(21)")

The character doesn't survive copy and paste through a plaintext editor, even if a raw 0x15 is valid MIF (which it may not be).

This is FM7.1 Unix, so I can't use the Unicode code point for an NBH (this is the suggest route for MIF8 or later).

The following MIF is valid, but may require more parsing of my strings than I care to invest in:

<String `123'><Char HardHyphen><String `456A'>

I could use:

=SUBSTITUTE($RawData.A3;"-";"'><Char HardHyphen><String `")

If I were sure that no partnumbers began or ended with a dash.

_______

Any other ideas?

Views

825

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

correct answers 1 Correct answer

LEGEND , Nov 01, 2011 Nov 01, 2011

Error,

IIRC, the hexadecimal values need to have a space following them. It's somewhere at the start of the MIF Manual describing the various character sets that can be used in strings.

Votes

Translate

Translate
LEGEND ,
Nov 01, 2011 Nov 01, 2011

Copy link to clipboard

Copied

Error,

IIRC, the hexadecimal values need to have a space following them. It's somewhere at the start of the MIF Manual describing the various character sets that can be used in strings.

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 ,
Nov 01, 2011 Nov 01, 2011

Copy link to clipboard

Copied

LATEST

<String `123\x15456A'> parse fail

<String `123 \x15 456A'> nbh, but leading space (fail)

<String `123\x15 456A'> nbh, no spaces, works perfectly, thank you

Amusingly, if you re-save the same document as MIF, Frame(7) re-codes the nbh as:

<String `123'>

<Char HardHyphen>

<String `456A'>

... as does MIF9, saving as MIF9,

even though the MIF9 reference says that as of MIF8, HardHyphen and 9 of its pals are no longer represented by name - use the UTF-8 code points. I'm guessing that intended policy change had some unintended results.

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