cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

specval comparisons again

cleccese
6-Contributor

specval comparisons again

Hi all,


I've been trying to test for the page number > 1, but this doesn't work:


<specval attname="foliostr[BO]" attloc="#FOSI" attval="#GT#\1"/">


while this works:
<specval attname="entryct" attloc="#FOSI" attval="#EQ#\10"/">



but this doesn't, if I initialize addnewline.txt=10 in the rsrcdesc:
<specval attname="entryct" attloc="#FOSI" attval="#EQ#addnewline.txt"/">


Is there a way to compare numbers saved to variables? Or, alternately, to test for a column break?

6 REPLIES 6

Caroline:

What formatting are you trying to support?

Suzanne Napoleon
www.FOSIexpert.com
"WYSIWYG is last-century technology!"


I don't really know anything about the rest of your FOSI, but FOSI is not very good at comparing the value of strings. The fact that you are calling your page number variable "foliostr" perhaps implies that it is a string (perhaps containing the word 'page"?). Comparing counter values, which are pure numbers, works fine while trying to compare strings does not.
cleccese
6-Contributor
(To:cleccese)

Hi Suzanne,


I needed to insert a blank line after every 10 lines of text in a 3 column table. The top of each column had to have ten entries, and there was a title above the table on the first page only, so it had less entries per column than on the following pages. That meant keeping track of rows per column on the first page and rows per column on subsequent pages, and rows before adding a blank line, or three counters.


I first tried to use specval to compare row counts saved to text variables, but comparisons only worked with constants like attval=#GT#\33\ and not attval=#GT#rowct.txt. And I didn't know how to test the folioct from the Styledesc, foliostr didn't work as the attname, either. So I counted the rows per page, and figured that after row 100 I would be on page 2. I just thought there would be a more elegant way to test for a page break or column break.

You can use a structure like this:

<specval attname="rowct.txt" attloc="#FOSI" attval="\1\">

We used to control bleedtabs (Trudy's having bad flashbacks) with stacks
and stacks of these:
<att logic="or">
<specval attname="rowct.txt" attloc="#FOSI" attval="\1\">
<specval attname="rowct.txt" attloc="#FOSI" attval="\6\">
<specval attname="rowct.txt" attloc="#FOSI" attval="\11\">
<specval attname="rowct.txt" attloc="#FOSI" attval="\16\">
...

To rotate through five different bleedtab positions. She ended up
"hardcoding" the handling of a set maximum number of chapters (before FOSI
updates would be required to support more).

In Trudy's "defense" I'm sure some silly formatting requirements of ours
prevented a more elegant handling of this issue 😉



On Mon, Jul 15, 2013 at 10:29 AM, Caroline Leccese <
caroline@thecodesource.net> wrote:

> Hi Suzanne,
>
> I needed to insert a blank line after every 10 lines of text in a 3 column
> table. The top of each column had to have ten entries, and there was a
> title above the table on the first page only, so it had less entries per
> column than on the following pages. That meant keeping track of rows per
> column on the first page and rows per column on subsequent pages, and rows
> before adding a blank line, or three counters.
>
> I first tried to use specval to compare row counts saved to text
> variables, but comparisons only worked with constants like attval=#GT#\33\
> and not attval=#GT#rowct.txt. And I didn't know how to test the folioct
> from the Styledesc, foliostr didn't work as the attname, either. So I
> counted the rows per page, and figured that after row 100 I would be on
> page 2. I just thought there would be a more elegant way to test for a page
> break or column break.
>
cleccese
6-Contributor
(To:cleccese)

Hi Paul,


Yes, I ended up using something very similar, using a constant for the attval.

The following code works without iterating multiples of ten. Note that the counter is tested, not the string.

<att>
<specval attname="rowct" attloc="#FOSI" attval="10">

<charsubset>

<reset resetlist="rowct">
...
HTH!
Suzanne


>
>
Top Tags