supress characters of a bookmark

  • Thread starter Thread starter erniewyles
  • Start date Start date
E

erniewyles

is there a way to show only certain characters of a bookmark, i.e., only
displaying the first character of a bookmark, or say, the last character of a
bookmark?
 
Hi ernie,

Theoretically, yes, but practically, no. That's because there's no way to simply retrieve a character from a field. The field coding
to do this is extensive, potentially involving over 200 IF tests, because you have to test for each possible character individually.
For example to test for the letter 'a' as the first letter in the bookmark, you need a field coded as:
{IF{REF MyBookmark}= "a*" "a"}
To test for 'a' as the last character:
{IF{REF MyBookmark}= "*a" "a"}
In each case, repeat for every other possible character.

Note: The field brace pairs (ie '{ }') for the above examples are created via Ctrl-F9 - you can't simply type them or copy & paste
them from this message.
 
this is what i'm trying to do here exactly....i have a numerical value that
comes from a database, it represents a persons height. I want to format that
value with 'ft.' after the first number and 'in.' after tha last digit.
Sometimes the output will be 2 numbers i.e. 59 -- representing 5 ft 9 in. or
511 -- representing 5 ft 11 in. Is this possible?

macropod said:
Hi ernie,

Theoretically, yes, but practically, no. That's because there's no way to simply retrieve a character from a field. The field coding
to do this is extensive, potentially involving over 200 IF tests, because you have to test for each possible character individually.
For example to test for the letter 'a' as the first letter in the bookmark, you need a field coded as:
{IF{REF MyBookmark}= "a*" "a"}
To test for 'a' as the last character:
{IF{REF MyBookmark}= "*a" "a"}
In each case, repeat for every other possible character.

Note: The field brace pairs (ie '{ }') for the above examples are created via Ctrl-F9 - you can't simply type them or copy & paste
them from this message.

--
Cheers
macropod
[Microsoft MVP - Word]


is there a way to show only certain characters of a bookmark, i.e., only
displaying the first character of a bookmark, or say, the last character of a
bookmark?
 
Possible but more complicated -

{ IF { REF MyBookmark } < 100 "{ =INT({ REF MyBookmark } /10) }ft { =MOD({
Ref MyBookmark },10) }in" "{ =INT({ REF MyBookmark } /100) }ft { =MOD({ Ref
MyBookmark },100) }in" }


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>



this is what i'm trying to do here exactly....i have a numerical
value that comes from a database, it represents a persons height. I
want to format that value with 'ft.' after the first number and 'in.'
after tha last digit. Sometimes the output will be 2 numbers i.e. 59
-- representing 5 ft 9 in. or 511 -- representing 5 ft 11 in. Is
this possible?

macropod said:
Hi ernie,

Theoretically, yes, but practically, no. That's because there's no
way to simply retrieve a character from a field. The field coding to
do this is extensive, potentially involving over 200 IF tests,
because you have to test for each possible character individually.
For example to test for the letter 'a' as the first letter in the
bookmark, you need a field coded as: {IF{REF MyBookmark}= "a*" "a"}
To test for 'a' as the last character:
{IF{REF MyBookmark}= "*a" "a"}
In each case, repeat for every other possible character.

Note: The field brace pairs (ie '{ }') for the above examples are
created via Ctrl-F9 - you can't simply type them or copy & paste
them from this message.

--
Cheers
macropod
[Microsoft MVP - Word]


"(e-mail address removed)"
is there a way to show only certain characters of a bookmark, i.e.,
only displaying the first character of a bookmark, or say, the last
character of a bookmark?
 
Hi Ernie,

In that case you could simply do some math on the bookmarked value:
{QUOTE "{=INT({BkMrk}/{IF{BkMrk}> 99 100 10}) \# 0ft}, {=MOD({BkMrk}, {IF{BkMrk}> 99 100 10}) \# 0in}"}
where 'BkMrk' is the bookmark name.

Note: The field brace pairs (ie '{ }') for the above example are created via Ctrl-F9 - you can't simply type them or copy & paste
them from this message.

--
Cheers
macropod
[Microsoft MVP - Word]


this is what i'm trying to do here exactly....i have a numerical value that
comes from a database, it represents a persons height. I want to format that
value with 'ft.' after the first number and 'in.' after tha last digit.
Sometimes the output will be 2 numbers i.e. 59 -- representing 5 ft 9 in. or
511 -- representing 5 ft 11 in. Is this possible?

macropod said:
Hi ernie,

Theoretically, yes, but practically, no. That's because there's no way to simply retrieve a character from a field. The field
coding
to do this is extensive, potentially involving over 200 IF tests, because you have to test for each possible character
individually.
For example to test for the letter 'a' as the first letter in the bookmark, you need a field coded as:
{IF{REF MyBookmark}= "a*" "a"}
To test for 'a' as the last character:
{IF{REF MyBookmark}= "*a" "a"}
In each case, repeat for every other possible character.

Note: The field brace pairs (ie '{ }') for the above examples are created via Ctrl-F9 - you can't simply type them or copy &
paste
them from this message.

--
Cheers
macropod
[Microsoft MVP - Word]


is there a way to show only certain characters of a bookmark, i.e., only
displaying the first character of a bookmark, or say, the last character of a
bookmark?
 
Oh My GOD!!!! That totally worked! Genius, man! Thank you tremendously!!!!

macropod said:
Hi Ernie,

In that case you could simply do some math on the bookmarked value:
{QUOTE "{=INT({BkMrk}/{IF{BkMrk}> 99 100 10}) \# 0ft}, {=MOD({BkMrk}, {IF{BkMrk}> 99 100 10}) \# 0in}"}
where 'BkMrk' is the bookmark name.

Note: The field brace pairs (ie '{ }') for the above example are created via Ctrl-F9 - you can't simply type them or copy & paste
them from this message.

--
Cheers
macropod
[Microsoft MVP - Word]


this is what i'm trying to do here exactly....i have a numerical value that
comes from a database, it represents a persons height. I want to format that
value with 'ft.' after the first number and 'in.' after tha last digit.
Sometimes the output will be 2 numbers i.e. 59 -- representing 5 ft 9 in. or
511 -- representing 5 ft 11 in. Is this possible?

macropod said:
Hi ernie,

Theoretically, yes, but practically, no. That's because there's no way to simply retrieve a character from a field. The field
coding
to do this is extensive, potentially involving over 200 IF tests, because you have to test for each possible character
individually.
For example to test for the letter 'a' as the first letter in the bookmark, you need a field coded as:
{IF{REF MyBookmark}= "a*" "a"}
To test for 'a' as the last character:
{IF{REF MyBookmark}= "*a" "a"}
In each case, repeat for every other possible character.

Note: The field brace pairs (ie '{ }') for the above examples are created via Ctrl-F9 - you can't simply type them or copy &
paste
them from this message.

--
Cheers
macropod
[Microsoft MVP - Word]


is there a way to show only certain characters of a bookmark, i.e., only
displaying the first character of a bookmark, or say, the last character of a
bookmark?
 
This solution also worked for me. Actually, it handled the variance of
either a two character or three character height result just fine. All
without the use of further bookmarks, only references. Incredible. Simply
incredible. Thank you very much as well.

Graham Mayor said:
Possible but more complicated -

{ IF { REF MyBookmark } < 100 "{ =INT({ REF MyBookmark } /10) }ft { =MOD({
Ref MyBookmark },10) }in" "{ =INT({ REF MyBookmark } /100) }ft { =MOD({ Ref
MyBookmark },100) }in" }


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>



this is what i'm trying to do here exactly....i have a numerical
value that comes from a database, it represents a persons height. I
want to format that value with 'ft.' after the first number and 'in.'
after tha last digit. Sometimes the output will be 2 numbers i.e. 59
-- representing 5 ft 9 in. or 511 -- representing 5 ft 11 in. Is
this possible?

macropod said:
Hi ernie,

Theoretically, yes, but practically, no. That's because there's no
way to simply retrieve a character from a field. The field coding to
do this is extensive, potentially involving over 200 IF tests,
because you have to test for each possible character individually.
For example to test for the letter 'a' as the first letter in the
bookmark, you need a field coded as: {IF{REF MyBookmark}= "a*" "a"}
To test for 'a' as the last character:
{IF{REF MyBookmark}= "*a" "a"}
In each case, repeat for every other possible character.

Note: The field brace pairs (ie '{ }') for the above examples are
created via Ctrl-F9 - you can't simply type them or copy & paste
them from this message.

--
Cheers
macropod
[Microsoft MVP - Word]


"(e-mail address removed)"
is there a way to show only certain characters of a bookmark, i.e.,
only displaying the first character of a bookmark, or say, the last
character of a bookmark?
 
Hi Ernie,

An even shorter (and simpler) version is:
{QUOTE "{SET Div {=10+(BkMrk>99) *90}}{=INT(BkMrk/Div) \# 0ft}, {=MOD(BkMrk,Div) \# 0in}"}

--
Cheers
macropod
[Microsoft MVP - Word]


Oh My GOD!!!! That totally worked! Genius, man! Thank you tremendously!!!!

macropod said:
Hi Ernie,

In that case you could simply do some math on the bookmarked value:
{QUOTE "{=INT({BkMrk}/{IF{BkMrk}> 99 100 10}) \# 0ft}, {=MOD({BkMrk}, {IF{BkMrk}> 99 100 10}) \# 0in}"}
where 'BkMrk' is the bookmark name.

Note: The field brace pairs (ie '{ }') for the above example are created via Ctrl-F9 - you can't simply type them or copy & paste
them from this message.

--
Cheers
macropod
[Microsoft MVP - Word]


this is what i'm trying to do here exactly....i have a numerical value that
comes from a database, it represents a persons height. I want to format that
value with 'ft.' after the first number and 'in.' after tha last digit.
Sometimes the output will be 2 numbers i.e. 59 -- representing 5 ft 9 in. or
511 -- representing 5 ft 11 in. Is this possible?

:

Hi ernie,

Theoretically, yes, but practically, no. That's because there's no way to simply retrieve a character from a field. The field
coding
to do this is extensive, potentially involving over 200 IF tests, because you have to test for each possible character
individually.
For example to test for the letter 'a' as the first letter in the bookmark, you need a field coded as:
{IF{REF MyBookmark}= "a*" "a"}
To test for 'a' as the last character:
{IF{REF MyBookmark}= "*a" "a"}
In each case, repeat for every other possible character.

Note: The field brace pairs (ie '{ }') for the above examples are created via Ctrl-F9 - you can't simply type them or copy &
paste
them from this message.

--
Cheers
macropod
[Microsoft MVP - Word]


is there a way to show only certain characters of a bookmark, i.e., only
displaying the first character of a bookmark, or say, the last character of a
bookmark?
 
Now stop showing off ;)

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

Hi Ernie,

An even shorter (and simpler) version is:
{QUOTE "{SET Div {=10+(BkMrk>99) *90}}{=INT(BkMrk/Div) \# 0ft},
{=MOD(BkMrk,Div) \# 0in}"}

"(e-mail address removed)"
Oh My GOD!!!! That totally worked! Genius, man! Thank you
tremendously!!!! "macropod said:
Hi Ernie,

In that case you could simply do some math on the bookmarked value:
{QUOTE "{=INT({BkMrk}/{IF{BkMrk}> 99 100 10}) \# 0ft},
{=MOD({BkMrk}, {IF{BkMrk}> 99 100 10}) \# 0in}"} where 'BkMrk' is the
bookmark name.

Note: The field brace pairs (ie '{ }') for the above example are
created via Ctrl-F9 - you can't simply type them or copy & paste
them from this message. --
Cheers
macropod
[Microsoft MVP - Word]


"(e-mail address removed)"
this is what i'm trying to do here exactly....i have a numerical
value that comes from a database, it represents a persons height. I
want to format that value with 'ft.' after the first number and
'in.' after tha last digit. Sometimes the output will be 2 numbers
i.e. 59 -- representing 5 ft 9 in. or 511 -- representing 5 ft 11
in. Is this possible? "macropod" wrote:

Hi ernie,

Theoretically, yes, but practically, no. That's because there's
no way to simply retrieve a character from a field. The field
coding to do this is extensive, potentially involving over 200 IF
tests,
because you have to test for each possible character individually.
For example to test for the letter 'a' as the first letter in the
bookmark, you need a field coded as: {IF{REF MyBookmark}= "a*"
"a"} To test for 'a' as the last character:
{IF{REF MyBookmark}= "*a" "a"}
In each case, repeat for every other possible character.

Note: The field brace pairs (ie '{ }') for the above examples are
created via Ctrl-F9 - you can't simply type them or copy & paste
them from this message.

--
Cheers
macropod
[Microsoft MVP - Word]


"(e-mail address removed)"
is there a way to show only certain characters of a bookmark,
i.e., only displaying the first character of a bookmark, or say,
the last character of a bookmark?
 
Back
Top