Jump to content

starting and skipping "sequential" numbers


digitalsig-1.com

Recommended Posts

I set a ticket file to sequentially number and break into sections of 250 while numbering from 1-250, but it didn't. It broke up the files just fine, but it only ran 249, which I still just don't get. Anyway, I need to output the missing tickets. I know I can do it with an Excel file, but I'm trying to accomplish it in a javascript. I need to start at 349 and then go in this order:

 

349, 599, 849, 1099, etc.

 

Here's my script, but when i run it, it starts at 251. I don't get it.

 

 

start="349";

LeadingZero="0000";

 

 

new_val = start-1

 

return FormatNumber(LeadingZero, 250 + CurrentRecordNumber());

Link to comment
Share on other sites

I don't write a lot of javascripts. I guess I got confused because the return string

 

return FormatNumber(LeadingZero, 250 + CurrentRecordNumber());

 

seems like it's taking the start number as the currentrecordnumber and adding 250 to it, which is what I want.

 

so if i enter return FormatNumber('0000', CurrentRecordNumber() + 348);

 

how does it know to skip 250 to the next number (599)?

Link to comment
Share on other sites

You created a variable "start" and set it equal to 349 in your OP. But then in your FormatNumber() function, you did not reference "start" and instead applied a constant (250) to add to the current record number. Assuming you compose your data with record 1, the result of your code will be "0251" (250 + 1 formatted to 4 digits).

 

In any event, the text rule alone will not generate the correct total number of records. All it does it return a number for each record, presumably to be printed in a text frame on your template. To print a quantity of 250 tickets (i.e. records) you will also need an OnJobStart callback rule:

FusionPro.Composition.composeAllRecords = false;
FusionPro.Composition.endRecordNumber = 250; // total number of tickets

 

The callback rule will determine the number of tickets while the text rule will return formatted numbers on each of those tickets beginning with (348 + 1). So using the code I wrote combined with the callback rule above, your project would yield 250 tickets numbered 349-599.

Link to comment
Share on other sites

You created a variable "start" and set it equal to 349 in your OP. But then in your FormatNumber() function, you did not reference "start" and instead applied a constant (250) to add to the current record number. Assuming you compose your data with record 1, the result of your code will be "0251" (250 + 1 formatted to 4 digits).

 

In any event, the text rule alone will not generate the correct total number of records. All it does it return a number for each record, presumably to be printed in a text frame on your template. To print a quantity of 250 tickets (i.e. records) you will also need an OnJobStart callback rule:

FusionPro.Composition.composeAllRecords = false;
FusionPro.Composition.endRecordNumber = 250; // total number of tickets

The callback rule will determine the number of tickets while the text rule will return formatted numbers on each of those tickets beginning with (348 + 1). So using the code I wrote combined with the callback rule above, your project would yield 250 tickets numbered 349-599.

You could also just leave the rule to format the number alone, not do anything in OnJobStart, and simply set the start and end record numbers on the Input tab of the Composition Settings dialog.

Link to comment
Share on other sites

I set a ticket file to sequentially number and break into sections of 250 while numbering from 1-250, but it didn't. It broke up the files just fine, but it only ran 249, which I still just don't get.

Well, if you post what you did originally, we can probably figure it out.

Anyway, I need to output the missing tickets. I know I can do it with an Excel file, but I'm trying to accomplish it in a javascript. I need to start at 349 and then go in this order:

 

349, 599, 849, 1099, etc.

So you want to start at 349, and keep adding 250, right? Until you reach what? I don't know how where you want this sequence to end, but you should be able to do this:

return FormatNumber('0000', ((CurrentRecordNumber() - 1) * 250) + 349);

You'll need to go into the Input tab of the Composition Settings dialog and set the start record number to 1 and the end record number to however many total records you want generated.

Edited by Dan Korn
Use [CODE] tags
Link to comment
Share on other sites

I get so frustrated using this forum. I can't seem to explain things in a way people understand. I appreciate the help, though. :)

 

I am trying to print replacement tickets for something that FusionPro didn't do. I am trying to print sequentially, SKIPPING 250 numbers in between each number, so instead of printing 349, 350, 351, etc. as you have derived; I am trying to print 349, 599, 849, 1099, etc. (with 250 skipped in between each number)

 

The original problem, which I am NOT looking for a solution to was that I had an all raster pdf in which I had to do the numbering in reverse type, thus negating my ability to use Freeform Masters on my Fiery. The file, being raster, was too large for our old machine to handle, so I had FusionPro Imposer impose the file 10-up on my sheet, and a stack of 25 (25 x 10 = 250). I then told FusionPro to compose to that template numbers 1-***X, starting at number 100, and print 250 records per file (see screenshot). It didn't.

 

What FusionPro did do is print 249 records, so in the first stack, I got 0100-0348 (249 records), in the second stack I got 0350-0398, and so on. I don't know why. I don't care why. All I want to do is print the missing tickets. I am trying to write a script (I don't have Excel on this machine - but I know how to do it with a .csv) that will return values of 349, skip 250 and then return 599, 849, 1099 and so on.

 

I want to be clear here (at the risk of being redundant) I only want numbers 0349, 0599, 0849, and so on. NOT 0349, 0350, 0351, 0352...

Screenshot2013-04-26at9_57_29AM.png.f2309189318a2cebb3cb156a5e854e18.png

Link to comment
Share on other sites

Well, if you post what you did originally, we can probably figure it out.

 

So you want to start at 349, and keep adding 250, right? Until you reach what? I don't know how where you want this sequence to end, but you should be able to do this:

return FormatNumber('0000', ((CurrentRecordNumber() - 1) * 250) + 349);

You'll need to go into the Input tab of the Composition Settings dialog and set the start record number to 1 and the end record number to however many total records you want generated.

THAT'S what I want... yes! I'll give this a try. Thanks!

Link to comment
Share on other sites

So you want to start at 349, and keep adding 250, right? Until you reach what? I don't know how where you want this sequence to end, but you should be able to do this:

Code:

return FormatNumber('0000', ((CurrentRecordNumber() - 1) * 250) + 349);

You'll need to go into the Input tab of the Composition Settings dialog and set the start record number to 1 and the end record number to however many total records you want generated.

 

THAT'S what I want... yes! I'll give this a try. Thanks!

 

That worked perfectly. Thanks, Dan!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...