Odds and evens

Hi,
How can i determine when a number is odd or even?.
Rgds,
Jose

hi,
Just divide by 2, and check the remainder.
report ztest.
data:
      rem type p decimals 2,
      val type i value 657.
rem = ( val mod 2 ).
if rem = 0.
  write:/ 'Even'.
else.
  write:/ 'Odd'.
endif.
Hope this helps !!!
Cheers
Alfred

Similar Messages

  • Odd and Even Headers in Pages 5

    I think this has been asked before, but is it possible to making different odd and even-paged headers in Pages 5? I can't figure it out.

    You can take this to be the answer for most things Pages 5…
    … No!
    Use Pages '09 instead.
    Peter

  • Different margin for odd and even pages

    Hi there,
    I am writing a book which will be printed in 2 sided paper. Therefor I will need different margin (left and right) for the odd and even pages.
    How is it possible in Pages? I am using Pages 5.2 (1860).
    Thank you.
    Sebastian.

    Indesign & Xpress are professional DTP applications. They can layout pages in any order you can imagine with custom margins. They are also complex to learn & expensive in comparison to Pages.
    There is a trial of Indesign IIRC…
    https://www.adobe.com/uk/products/indesign.html
    Quark also has a trial too…
    http://www.quark.com
    I expect there may be cheaper 'layout' software that is capable of arranging facing pages correctly (possibly from a single pages PDF export from Pages), but I just avoid apps like Pages if I need a finer level of output control.

  • Printing odd and even pages separately (manual duplex)

    Hi
    I searched the forum and found some similar problems regarding Adobe Reader 8.1.2 : Adobe Reader 8.1.2 doesn't print odd and even pages correctly
    This was posted more than a year ago. A few days ago I encountered the same problem with Adobe Acrobat 8.1.2. I suspected that it could be beacause of outdated software. I then applied incremental patches up to 8.1.5. But the problem still persists.

    The link was about Reader, but I tried it with AA8.1.5 on a 3 page document and did indeed find the same problem. The 1st page printed out, but the 3rd page was missing when printing the odd pages. When printing the even pages, the 2nd page printed out 2 times. The 3rd page never showed up. I think this is what you are talking about. Wonder if they fixed it in AA9?

  • Is it possible to have different margin settings for odd and even pages?

    Hi guys.
    I am formatting a book I want to get printed and it would be very helpful to have different margin settings on the odd and even pages so the text won't fall too close to the gutter (as happened in the proof copy I ordered!).
    It's possible to do this on Word, but I can't seem to do it on Pages? Am I missing something?
    Any help would be greatly appreciated. Thank you

    Thanks Peter. I upgraded to Pages 5 a while back. I guess my next question is.....is there any way I can downgrade to Pages 09...anywhere I can still download it from?
    Seems a bit of a backward step, but needs must

  • Odd and even rotating pages by file name

    Hi all,
    Hoping someone can help me trouble shoot my script below.
    The aim is to determined if the last two digits of the file name are odd or even and then rotate the file accordingly.
    I have been able to get the page rotation work by it's self but it seems to do nothing at all when trying to get the last two digits of the filename and use them as the variable "pgNum".
    Files will be named using the following convention....
    aa-02-02.pdf
    Thank you in advance for you help.
    =======================================================================================
    var re = /.*\/|\.pdf$/ig;
    var filename = this.path.replace(re,"");;
    var pgNum = filename.substring(-2);
    try {
        if(pgNum % 2) {
            var crtpagerotate = this.getPageRotation({nPage:i});
            this.setPageRotations({nStart: i, nEnd: i, nRotate:(270+crtpagerotate)%360});
        else {
            var crtpagerotate = this.getPageRotation({nPage:i});
            this.setPageRotations({nStart: i, nEnd: i, nRotate:(90+crtpagerotate)%360});
    catch (e)
        console.println("Batch Aborted: " + e )

    Try this:
    var re = /\.pdf$/i;
    var filename = this.documentFilename.replace(re, "");
    var pgNum = +filename.slice(-2);

  • Odd and even years with Time Windows?

    Hi All,
    Does anybody know how to implement a time window for even years / ode years?
    For example, a script A that needs to be executed every 1st January of even years and a script B that needs to be executed every 1st January of odd years.
    At last, it possible to :
    - specify hard coded dates in TW for these scripts,
    - use particular pre conditions (which script from A or B has to be executed) with a common yearly TW
    but better solutions are welcome
    Thanks a lot.
    Regards,
    Yi Jiang

    Hi Yi,
    If you need this for only one case, I'd go for the one-off setup of specific dates.
    If you have multiple cases, a simple way to achieve your goal is the following set of time windows:
    - TW_EVEN_YEARS: from 1-1-2010 to 31-12-2010, 1-1-2012 to 31-12-2012, 1-1-2014 to 31-12-2014, ...
    - TW_ODD_YEARS:  from 1-1-2009 to 31-12-2009, 1-1-2011 to 31-12-2011, 1-1-2013 to 31-12-2013, ...
    and then
    - TW_DAY1_EVEN_YEARS: day 1 enabled during TW_EVEN_YEARS
    - TW_DAY1_ODD_YEARS: day 1 enabled during TW_ODD_YEARS
    - TW_LAST_FRIDAY_EVEN_YEARS: last friday enabled during TW_EVEN_YEARS
    - TW_LAST_FRIDAY_ODD_YEARS: last friday enabled during TW_ODD_YEARS
    etc.
    This way, you do not need to specify the dates for each case, only once.
    Regards,
    Anton.

  • Odd and even pages

    Hello all, Need some help on the xdp that I am working on.
    This xdp has 1 Page Set- set to Print on Both Sides.
    The first master page is the Odd Pages (Front pages).
    The second master page is the Even Pages (Back pages).
    There isn't much logic on the Even Pages as it is only static information.
    The content on the Odd (Front) pages flow and page number grow depending on the XML data I feed into it. I have explicitly set the content to flow through the content are of the Odd (Front) page only. Problem is, when the data breaks, it still puts a record or two on the content area of the Even (Back) page.
    Also, I was hoping that whenever there is an Odd (Front) page, I would assume that it would always have an Even (Back) page, but that is not the case. Sometimes the pages end out on the Odd Page.
    I would like to share the xdp along with the xml that I am working on to this posting. Is there a way to upload this information. Thanks in advance.

    Hi,
    The trouble is that when you have repeating objects they will continue in the container as new instances are added. When the page overflows, Acrobat/Reader is creating a new instance of the page, in which the new instances of the repeating object can be rendered.
    I had an example earlier that "jumped" a section, but in reality what it was doing was when the first page was full, it started to use a similar repeating instance on page3. Here it is, but you will need to have a close look at the script, as this was not annotated: https://acrobat.com/#d=0-YvJ8UcVW7Pyc4hhg3RmQ. It is a bit of a rough workaround, based on the height of the subform (see the click event of the add button on page1).
    You might also be able to get a conditional page break to work if the height of the rows was always the same.
    Hope that helps,
    Niall

  • Selective combining between files with odd and even numbers of pages

    Hi all! First of all, i hope this is the right forum for my question. It has been asked before, but not fully answered. My problem is combining multiple pdfs with adding a blank page only to the ones that contain odd numbers of pages, the ones with even numbers should be left alone. I need a fast and automatic way of doing this so i can save huge amounts of time when faced with massive numbers of files. If this simply cannot be done, is there a way of sorting all the files so that, from the whole group, only the ones with odd numbers of pages go to a specified folder? Like this isnt enough i have the same problem when converting, lest say, multiple word files into 1 pdf file using pdf factory.
    Thanx in advance! also, any other way to go arround this problem is most welcome!
    Cheers!

    It would require knowledge of some JavaScript to determine if a particular page was landscape and if so, to rotate it. You could try asking in the JavaScript forum.

  • Detecting odd and even numbers

    How can I now when an integer is an even or an odd number?

    How can I now when an integer is an even or an odd number?Either of these will work:
    if (i % 2 == 0)
        // even
    else
        // odd
    if ((i & 1) == 0)
        // even
    else
        // odd

  • Function detect odd and even number

    Do you know a function which can detect if a number is an odd number or other.

    if ( number%2 == 1)
    But a method for this? Really doubt that..
    Do you know a function which can detect if a number is
    an odd number or other.

  • How to specify Master page depending on odd or even first page

    We've set up our books to delete empty pages and so that we have chapters starting on both odd and even pages. Also, the first pages of our chapters are formatted differently than the rest of the Left and Right Master pages. We would like to have two Master pages for the first page of the chapter, one for odd pages and the other for even, so that we can offset the margins, leaving a larger margin on the side towards the binding.
    My question is how do I set up the book so that when it generates, if the chapter starts on an odd page, it automatically applies the Master page for odd first pages and when the first page is even, it applies the Master page for even first pages?
    We have FramMaker 8 and are running it on Windows XP Professional.
    Thanks,
    Tim

    Assuming that you want this to happen automagically, I'd use the system default Right and Left Master pages as your chapter opener pages because Frame will apply those automatically depending on how the pages and chapters fall in the book. Then set up the internal chapter pages with whatever other structure you're using and apply those internal masters to the normal content that as you go.
    If you can't do that for some reason, I would look at doing it with a FrameScript that goes through the book and applies the alternating pages as a final production step.
    You could set up the first tag in the chapter to call a specific master page, but that would be manual and could quickly go south if any chapters ahead of a given chapter change the pagination. It would have to be manual because a given tag can only call one master page -- there isn't a way to apply logic to call one or the other depending on the situation.

  • How do I "Print Booklet" with just odd pages and even pages for duplexing . . options disabled

    I have InDesign CS5.5 on a Windows 7 64-bit machine hooked to a Xerox 7750 printer.  I have created a 8.5x11 portrait document and trying to create a booklet on 12x18 sheets.
    I need to print duplex manually and so I need to print just the odd spreads and then the even spreads.
    I have printed to Adobe PDF and printed from my created PDF file and have it working, but I want to know why InDesign won't let me do it.  When I click "File > Print Booklet > Print Settings" then it shows the Print Dialog box with the Pages section, which includes the Sequence that normally would allow me to do Odd Pages or Even Pages, but it is disabled.  Why?  I can define Print Presets and I can choose Odd Pages, but when I choose that in the Preset box it does not show anything, everything is still disabled.
    Anybody have any idea of why it is disabled?  Is it my printer driver?

    I too was very frustrated after upgrading to indesign cs5.5 and the latest LION OS on my new MAC.  I missed the odd/even page selection in the print dialog box within Indesign.  I tried about everything and found little of value in various forums.  But I did find a workable solution that makes since in terms of Apple's OS.
    My objective is to "impose" my document and also end up with a file that I can just print again and again without "ripping" in the InDesign Print Booklet Dialog.
    Here is the quick version of what to do.  I am not including every little step with pictures. =)  (I can if there is interest.)
    1. create your document
    2. Print Booklet
    3. At the first dialog box, just ignore the printer in print preset (you will come back to this) and go to the 2-up perfect bound option and select 16 page signatures.  This will impose 2-up on 4 physical pieces of paper printed both sides.  So 16 of your document pages printed duplex on 4 physical sheets of paper.  It would be nice to then just select the printer and scaling, etc. and the option to print even pages, flip over and then print odd pages but that ain't an option.  If you have different needs, do the math and input the correct numbers before proceeding
    4. Click on Print Settings  to pull up a second dialog box.
    5. Select for Printer PostScript File (not your printer)  Also select for PPD your printer or Adobe PDF 9 if you have that installed.  Don't obsess on this just pick your Printer for the PPD.
    6. Select 1 copy and All Pages while in the General Tab
    7. Select the Setup Tab Here is where you put in the actual physical paper size that you are going to print your document on. Don't scale to fit.  You must do this.  If you feel the need, check out all the tabs and options but for now, you are just trying to get an output file.  You probably do want to select CENTER for page position in this same setup tab.
    8. Hit OK whcih will return you to the original dialog.  Check when you return to be sure that at the top Printer is populated with PostScript File.  Click on Print and give the thing a name and a location to save at the resulting dialog.
    Breathe as you are almost home.  You have sucessfully created a file that can be called up again and again without opening InDesign. (albeit, a postscript file but not a problem)
    Now,
    1. Double click on this new file (it will have a .ps extention) or just open it in your PREVIEW (apple supplied utility)   Preview is where you accomplish the even and odd page objective.
    2. Preview will show you a short progress dialog while it rips this postscript file into a PDF.
    3. Click on PRINT
    4. Select your printer,page range, select the Paper Size (again not document size  but  the size sheet that you are printing the 2-up , imposed (booklet) document on. If not in the selection dialog, then use the custom option to create it (custom paper size) and give it a name.
    5. Click on SCALE and insert 100% in place of the weird number that it will insert for you.  You will then see your document correctly displayed in the sidebar preview window.
    6.  OK, now what you have been waiting for. Click on the box that says Preview (the active window) and select Paper Handling from the drop-down and select from Pages to Print the coveted odd or even page selection.  You can also do other things that should have been back at the InDesign print dialog but are now gone.  Explore. Enjoy.
    7.  You will have to work out your own work flow about reverse or no reverse order and how to flip, etc. But you will be working with something predictable at this point.
    8.  Since this has been ripped into a PDF , you might as well Click on the PDF button and click on save as a PDF at this point to save that postscript to PDF rip.   Also print using PREVIEW for the newly created PDF file next time as you will not have to learn a bunch of new dialogs and be frustrated all over again.
    I am now back in business printing the book blocks for my handbound journals.

  • Weired issue odd IP's can ping the VIP and even can't on the Nexus 9K switch.

    Hello experts!
    we have two nexus 9k core, attached to the HP Blade v7000 chasis and VPC configured. All Vlans are HSRP are configured. VPC is configured successfully. But the weird this is that source IP address 10.1.2.3 can ping the dest VIP (on the loadblanacer) but 10.1.2.4 can't ie all odd IP's can ping the vip and even IP's can't ping and this is happening in all other Vlans. No firewall no security applience ... windows firewalls are turned off, no ACL's on the swtiches. If I shut down the interface on nexus 1 then all IP's can ping the VIP, as soon as I unshut the interface then .4 stops pinging, and if I shutdown the interface on nexus 2 then all IP's can ping. 10 gig links are connected to Flex fabric card and vpc port channel is up. Any thoughts or help ?
                                   Nexus 1                                                                                                                        Nexus 2

    Hello experts!
    we have two nexus 9k core, attached to the HP Blade v7000 chasis and VPC configured. All Vlans are HSRP are configured. VPC is configured successfully. But the weird this is that source IP address 10.1.2.3 can ping the dest VIP (on the loadblanacer) but 10.1.2.4 can't ie all odd IP's can ping the vip and even IP's can't ping and this is happening in all other Vlans. No firewall no security applience ... windows firewalls are turned off, no ACL's on the swtiches. If I shut down the interface on nexus 1 then all IP's can ping the VIP, as soon as I unshut the interface then .4 stops pinging, and if I shutdown the interface on nexus 2 then all IP's can ping. 10 gig links are connected to Flex fabric card and vpc port channel is up. Any thoughts or help ?
                                   Nexus 1                                                                                                                        Nexus 2

  • Weired issue odd IP's can ping the VIP and even can't!

    Hello experts!
    we have two nexus 9k core, attached to the HP Blade v7000 chasis and VPC configured. All Vlans are HSRP are configured. VPC is configured successfully. But the weird this is that source IP address 10.1.2.3 can ping the dest VIP (on the loadblanacer) but 10.1.2.4 can't ie all odd IP's can ping the vip and even IP's can't ping and this is happening in all other Vlans. No firewall no security applience ... windows firewalls are turned off, no ACL's on the swtiches. If I shut down the interface on nexus 1 then all IP's can ping the VIP, as soon as I unshut the interface then .4 stops pinging, and if I shutdown the interface on nexus 2 then all IP's can ping. 10 gig links are connected to Flex fabric card and vpc port channel is up. Any thoughts or help ?
                                   Nexus 1                                                                                                                        Nexus 2

    Nexus 1
    show hsrp active brief
                         P indicates configured to preempt.
                         |
    Interface   Grp Prio P State    Active addr      Standby addr     Group addr
    Vlan99      1   120  P Active   local            10.104.0.3       10.104.0.1      (conf)
    Vlan160     5   120  P Active   local            10.104.5.3       10.104.5.1      (conf)
    Vlan200     6   120  P Active   local            10.104.6.3       10.104.6.1      (conf)
    Vlan210     7   120  P Active   local            10.104.7.3       10.104.7.1      (conf)
    Vlan310     9   120  P Active   local            10.104.9.3       10.104.9.1      (conf)
    Vlan350     11  120  P Active   local            10.104.11.3      10.104.11.1     (conf)
    Vlan450     13  120  P Active   local            10.104.13.3      10.104.13.1     (conf)
    Vlan700     14  120  P Active   local            10.104.14.6      10.104.14.4     (conf)
    Vlan750     15  120  P Active   local            10.104.15.3      10.104.15.1     (conf)
    =======================
    Nexus 2
    show hsrp active brief
                         P indicates configured to preempt.
                         |
    Interface   Grp Prio P State    Active addr      Standby addr     Group addr
    Vlan100     3   120  P Active   local            10.104.2.2       10.104.2.1
      (conf)
    Vlan150     4   120  P Active   local            10.104.4.2       10.104.4.1
      (conf)
    Vlan199     2   120  P Active   local            10.104.1.2       10.104.1.1
      (conf)
    Vlan300     8   120  P Active   local            10.104.8.2       10.104.8.1
      (conf)
    Vlan320     10  120  P Active   local            10.104.10.2      10.104.10.1
      (conf)
    Vlan400     12  120  P Active   local            10.104.12.2      10.104.12.1
      (conf)
    Vlan760     16  120  P Active   local            10.104.16.2      10.104.16.1

Maybe you are looking for

  • Security warning when searching

    33.1.1, XP, SP3 Since upgrading to 33.1.1 every time I do a Google search from my BT Home Page I get the following security warning: "Although this page is encrypted, the information you have entered is to be sent over an unencrypted connection and c

  • E-mail POP server problem

    Hello, I just rebooted 10.4. in Mail I keep getting the notice that the server at mail.comcast.net has rejected my password: yet when I log onto Comcast's site and enter my info I am able to retrieve and send everything. Any suggestions or ideas are

  • Message Packaging

    Hi all, I have a query in Message Packaging.  Is it possible to make the message packaging global or is it applicable only for individual interfaces? Thanks in advance, Geetha

  • Match Frame Audio clip to find Video?

    Hi I have an audio clip in the timeline. Is there an easy way to find the original video that corresponds to it? If I Match Frame to source it just brings up the audio clip to edit in the viewer. Doesnt give me the matching video.

  • Standard OM

    Hi, Could you please let me know whether the following points are possible in standard OM or Not? 1) Capacity (planned no. of employees) against each department: basing on this manpower planning report will be taken and it will be matched with actual