OOoWrite: how to show variable

Asked by LarryE

After selected from menus:

  insert:fields:other...:variables:set variable:
       field1.name | file1.valu

then, in another part of document, I try to
retrieve the value of that field with:

  insert:fields:other...:variables:show variable:
       field1.name

the expected value:

       field1.value

doesn't appear. Instead I get a 0. I did specify
format of Text; however, that didn't help.

How can I get the value of a given variable to
show at the place where a show:field for that
variable was inserted?

TIA

-Larry

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu openoffice.org Edit question
Assignee:
No assignee Edit question
Solved by:
LarryE
Solved:
Last query:
Last reply:
Revision history for this message
Tony Pursell (ajpursell) said :
#1

Hi Larry

If I do this:

Insert > Fields > Other > Variables > Set Variable
With Format 'General'
Enter Name as 'F1'
Enter Value as '2'
Click Insert and Close

I get a field showing '2'

Then at another part of the document:

Insert > Fields > Other > Variables > Show Variable
With Format 'General' and Selection 'F1'
Click Insert and Close

I get a field showing '2'

Is this what you are doing? If not, try the above exactly as I have done it.

I am using OOo ver 2.4.1 in Ubuntu 8.04.

Let us know if this helps you.

Tony

Revision history for this message
LarryE (cppljevans) said :
#2

On 08/21/08 17:10, Tony Pursell wrote:
> Your question #42624 on openoffice.org in ubuntu changed:
> https://answers.launchpad.net/ubuntu/+source/openoffice.org/+question/42624
>
> Status: Open => Answered
>
> Tony Pursell proposed the following answer:
> Hi Larry
>
> If I do this:
>
> Insert > Fields > Other > Variables > Set Variable
> With Format 'General'
> Enter Name as 'F1'
> Enter Value as '2'
> Click Insert and Close
>
> I get a field showing '2'
>
> Then at another part of the document:
>
> Insert > Fields > Other > Variables > Show Variable
> With Format 'General' and Selection 'F1'
> Click Insert and Close
>
> I get a field showing '2'
>
> Is this what you are doing? If not, try the above exactly as I have done
> it.
>
> I am using OOo ver 2.4.1 in Ubuntu 8.04.
>
> Let us know if this helps you.
>
> Tony
>
>
Yes, thanks. That works for numbers; however, I want it to
work for text (I should have indicated text format. Sorry).
When I specify text format (I selected additional
formats, which had "text" as one of the categories
which I selected) the "show variable" only showedas a 0
and not the text I entered (which was field1.valu").
Obviously I'm doing something wrong w.r.t. the format
specify, but I can't figure out what.

Any help is appreciated.

-regards,
Larry

Revision history for this message
Tony Pursell (ajpursell) said :
#3

Hi Larry

It works for me OK. I created a Variable with Name 'T1' and Value 'OOo' and inserted it.

I can then do Show Variable for T1 and I get 'OOo'.

I am using the Format 'Text' which is at the top of the list in the Format box.

I agree that if you use 'Text' in 'Additional Formats ... ' the result is different. I get nothing shown at all. However, if I select a currency format, it shows in the Set and Show fields, as one would expect.

Tony

Revision history for this message
LarryE (cppljevans) said :
#4

On 08/21/08 18:23, Tony Pursell wrote:
> Your question #42624 on openoffice.org in ubuntu changed:
> https://answers.launchpad.net/ubuntu/+source/openoffice.org/+question/42624
>
> Status: Open => Answered
>
> Tony Pursell proposed the following answer:
> Hi Larry
>
> It works for me OK. I created a Variable with Name 'T1' and Value 'OOo'
> and inserted it.
>
> I can then do Show Variable for T1 and I get 'OOo'.
>
> I am using the Format 'Text' which is at the top of the list in the
> Format box.
>
'Name' is the the top of the list in my Format box.
Maybe something's wrong with my OpenOffice?

The help|about shows, at the bottom:

openoffice.org-core 1:2.4.1-1ubuntu2. Mon Jun 30 11:50:15 UTC 2008

> I agree that if you use 'Text' in 'Additional Formats ... ' the result
> is different. I get nothing shown at all. However, if I select a
> currency format, it shows in the Set and Show fields, as one would
> expect.
>
> Tony
>
>

Revision history for this message
LarryE (cppljevans) said :
#5

On 08/21/08 18:23, Tony Pursell wrote:
> Your question #42624 on openoffice.org in ubuntu changed:
> https://answers.launchpad.net/ubuntu/+source/openoffice.org/+question/42624
>
> Status: Open => Answered
>
> Tony Pursell proposed the following answer:
> Hi Larry
>
> It works for me OK. I created a Variable with Name 'T1' and Value 'OOo'
> and inserted it.
>
> I can then do Show Variable for T1 and I get 'OOo'.
>
> I am using the Format 'Text' which is at the top of the list in the
> Format box.
>
Please ignore my last response. I created another variable,
and now 'Text' does appear at the top. This seems inconsistent.
I.e. one variable has 'Text' at the top and the other variable
has 'General' at the top.

Revision history for this message
LarryE (cppljevans) said :
#6

On 08/21/08 19:09, LarryE wrote:
> Your question #42624 on openoffice.org in ubuntu changed:
> https://answers.launchpad.net/ubuntu/+source/openoffice.org/+question/42624
>
[snip]
> Please ignore my last response. I created another variable,
> and now 'Text' does appear at the top. This seems inconsistent.
> I.e. one variable has 'Text' at the top and the other variable
> has 'General' at the top.
>
>
I think I see the problem. The first time I did it,
I took the default format, 'General'. When I tried
to change the format to 'Text' by selecting the
'Additional formats...', and then selecting
'Text' under category, it didn't work, as I
described previously. I'd suggest making
it easier to change the format. I only chose
'General' initially because I was experimenting.
When I tried to experiment further by changing
the format, it didn't work.

Revision history for this message
Tony Pursell (ajpursell) said :
#7

Does this mean your problem is solved? If it is, can you mark it as solved.

Tony

Revision history for this message
LarryE (cppljevans) said :
#8

Yes. problem is solved because I know a workaround: Always specify 'Text' for
format when variable is *first* created; however, I think there's
a bug because if the workaround is not followed, i.e. 'General'
the default format, is specified for format, then the user cannot change
that to 'text'.