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

The PTC Community email address has changed to community-mailer@ptc.com. Learn more.

New JS function for x-counters handling

New JS function for x-counters handling

Using legacy coding, it's possible to pick the x-counters from another stream.

 

For example, 

 

formatting.evaluateShowString('="@vData:Main"x(5)x(5)');

 

will transfer into cuurent stream x(5) counter the value of 'Data:Main' stream's x-counter x(5) at the begging of the current page.

 

Even if it's probably already possible using display, I think that a core fonction would be interesting, looking like this:

 

formatting.getCounters(streamName, counters, relativePage)

 

where:

  • streamName : name of the stream to import counter(s) from. If does not exist, do nothing
  • counters: un number / array of number. if null => import all. If number: import this counter. If array of numbers: import the corresponding counters, if empty array just do nothing !
  • relativePage, default : 0 : pick counters value from relative page, if 0 : current.

 

 For example, formatting.getCounters("strm0",10,1) would be similar to this:

x-counters.png

 

giving <?show ="@vstrm0"1x(10)x(10)>.

4 Comments
GarethOakes
16-Pearl

Jacques, I think you could already implement your own getCounters() function using fdStreamPos counters/stringCounters. Besides the convenience of what you suggest, is there a novel concept here that I'm missing?

jtripoz
3-Visitor

Yes of course, I could implement it quite easily but I just think that a core function would be useful for everyone !

 

 

SimonTaylor
11-Garnet
Status changed to: Under Consideration
 
SimonTaylor
11-Garnet
Status changed to: No Plans to Implement