Jump to content

Simple rule to check input


Recommended Posts

Need an expression that will check if $inputrecord or number is a multiple of 50.

if true then return "BookNumberCount" (which should go up for each booklet)

Trying to do this without using stacks.


So every 50 ouputsheets/records, i want to print BOOK# on each top sheet... already have background templates setup. My java is not strong.


new to all this thanks for help...


var certainNumber = 50;
if ("$inputrecordnumber" % "certainNumber" === 0) {
   // directWinner is a multiple of certainNumber
then return "«$inputrecordnumber»" ***OR the correct name for OUTPUT COMPOSED SHEET****

Link to comment
Share on other sites

If you want to print the book number on the first page of the book, then you aren't really trying to determine if the record is a multiple of 50. Record 1, 51, 101, etc aren't multiples of 50.


I think you want to do this:

var recsInBook = 50;
var rec = CurrentRecordNumber();
return rec % recsInBook == 1 ? 'BOOK #' + Math.ceil(rec / recsInBook) : '';

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.

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...