Is it possible to calculate two or more number entered in the same field ?

What 'm trying to do is to caculate a book pages number for a copying them.
For example I want to copy pages from 25 to 30 , so the user will write 25-30
the number of copies will equal sum = "30 - 25 + 1"
and if the user write only a single number, the number of copies will equal "sum = sum + 1"
So, the user input will be like that "25-30,45-60,65,67"
I'm thinking of using an Array and a "," to split
var sumArray = new Array();sumArray = sum.split(",");
Are there any possible way to do this ??
Thanx

Hi, I think you could use a RegEx but I would use a split as well, something like;
var pageNumbers = TextField1.rawValue.split(",");
var sum = 0;
var isValid = true;
for (var i = 0; i < pageNumbers.length; i++)
var pages = pageNumbers[i].split("-");
// Check for all number elements
if (!pages.every(function(element) { return (element == parseInt(element, 10)); } ) )
  xfa.host.messageBox("Please enter comma separated list of pages number, with a range separated by a hyphen, e.g. 25-30,45-60,65,67");
  isValid = false;
  break;
if (pages.length > 2)
  xfa.host.messageBox("Please enter a page range separated by a hyphen, e.g. \"45-60\"");
  isValid = false;
  break; 
if (pages.length == 1)
  sum++;
else
  var start = parseInt(pages[0]);
  var end = parseInt(pages[1]);
  if (end < start)
   xfa.host.messageBox("Please enter a valid page range separated by a hyphen, with the start page first, e.g. \"45-60\"");
   isValid = false;
   break; 
  sum += (end - start + 1);
if (isValid)
app.alert(sum);
Might need some more error handling but hopefully will get you started.
Regards
Bruce

Similar Messages

  • Can I export my sidecar files to two or more hard drives at the same time from one computer?

    Can I export my sidecar files to two or more hard drives at the same time from one computer?  How do I do this, if it is possible?

    Each image is imported into the LR Catalog from just one stated location on disk. And that is where the sidecar gets written.
    But if you want, outside of LR, you can have a file sync utility replicate all physical changes within those folders on disk, into other corresponding locations on other drives - which hold a copy of all the same images, and a copy of the sidecars too. This might happen continuously, periodically or on demand depending on the particular tool you use... for example, the Dropbox desktop app.
    If you also want to have your LR Catalog replicated, I think this can only be done when LR is not running and using that.

  • Hi can someone tell me if it is possible to have two accounts (from different countries) in the same laptop?

    Hi can someone tell me if it is possible to have two accounts (from different countries) in the same laptop?

    Hi...
    The issue is that your credit or debit card credentials must be associated with the same country where you reside to make purchases.
    "Although you can browse the iTunes Store in any country without being signed in, you can only purchase content from the iTunes Store for your own country. This is enforced via the billing address associated with your credit card or other payment method that you use with the iTunes Store, rather than your actual geographic location."
    From here >  The Complete Guide to Using the iTunes Store | iLounge Article
    Billing policy is the same for both the iTunes as well as Mac App Stores.

  • Two or more people editing at the same time

    Dear All,
    I am planning to purchase FCP Server, and I am just in a very beginning of consideration.
    Immediately, I am wondering if FCP Server can let two or more people editing on the same project at the same time.
    I know it has Check-in function, and it seems to me that it just takes the project to another computer to do editing. What if another person wants to do editing on the same project?
    Also, if it allows us many people to do editing on the same project, can we save the project at the same time on the same computer installed FCP Server?
    Please advise.
    Many thanks in advance.
    King

    In Final Cut Server (FCSvr) checking out a Final Cut Pro project (FCProj) creates a copy of the project file at a location you specify saving it to on your local computer. When you check out a FCProj, the project asset is locked and cannot be modified by other users. Additionally, every media asset that is used in the project is locked from being modified by other users.
    However in a you're trying to have multiple users work on and edit the same project, I'd suggest start by duplicating the FCProj asset within FCSvr. Maybe start with a master capture / digitize project that contains all the media needed to work on by both editor. This will allow for multiple editors to have access to the same project media assets. In any scenario where multiple editors are collaborating, I'd suggest have them also work on separate project file and maybe split / divi up the work, based on scene, act etc.
    Sequences can be easily merge between project later.
    Hope this helps.
    Nicholas Stokes
    XPlatform Consulting
    < Edited by Host >

  • Streaming two or more flv videos at the same time

    Hi,
    I am working on a site that is intended to stream two or more flv simultaneously. The slightly different header clip should renew on entry to each page.
    When I publish the fla file it plays as intended. When I upload the swf file to the web only one of the videos are playing back.
    It does not matter if I import the video to a timeline, or stream it progressively from the server. Both clips are uploaded.
    I am using CS3 and AS3.
    http://www.doctorhoover.com/marcia/test7.html
    Anyone??
    ggaarde

    Hi!!! hey dogHouseJim!! Could you please post a sample of your fourMovies.swf code to know how you do it?? It would be necessary for me to know how to do it. I'm working in an application that has got two flvPlayback components working at the same time but the main video pauses too many times because the other one is running too. Please help me!!! I post here my code (The main flv is croma_01intro ---> it doesn't work too far, I'm a beginner.. ) Thanks in advance for your help!!!!
    ---CODE---
    import com.hagane.MHU.Timer;
    var timeKeeper : Timer = new Timer();
    video_tmp="flvs/croma_01intro.flv";
    video_tmp2="flvs/presentacion720.flv";
    var conexion2:NetConnection = new NetConnection();
    var conexion:NetConnection = new NetConnection();
    conexion2.connect(null);
    conexion.connect(null);
    var stream2:NetStream = new NetStream(conexion2);
    var stream:NetStream = new NetStream(conexion);
    mi_video2.attachVideo(stream2);
    mi_video.attachVideo(stream);
    stream.play(video_tmp);
    //aseguramos 10 seg de reproduccion
    stream.setBufferTime(4);
    loadMovie("cargas.swf",cargas);
    var n_veces = 0;
    var prueba = 0;
    this.onEnterFrame = function() {
    //obtengo el porcentaje
    var valor1:Number = Math.round(stream.bytesLoaded/stream.bytesTotal*100);
    conexion1 = new LocalConnection();
    conexion1.send("conectar", "estado_carga", valor1);
    delete conexion1;
    prueba = stream.time;
    if ((valor1>=12)&&(prueba>=2)) {
      delete this.onEnterFrame;
      stream2.play(video_tmp2);
      stream2.setBufferTime(15);
      stream2.pause();
      var intervalID_mc : Number = timeKeeper.intervalCall(2000, 0, lanzaEstadisticos);
      n_veces = n_veces+1;
    //funcion para saber que el flv termino
    stream.onStatus = function(infoObject) {
        if (infoObject.code == "NetStream.Play.Stop") {
           //trace("video terminado");
        gotoAndPlay(25);
    //if((infoObject.code=="NetStream.Play.Start")&&(n_veces==0)){
      //stream2.play(video_tmp2);
      //stream2.setBufferTime(4);
      //stream2.pause();
      //var intervalID_mc : Number = timeKeeper.intervalCall(5000, 0, lanzaEstadisticos);
      //n_veces = n_veces+1;
    function lanzaEstadisticos(Void):Void {
    stream2.play(video_tmp2);
    timeKeeper.clearIntervalCall(intervalID_mc);
    stop();

  • Is it possible to have two Firefox browsers (3&20) on the same OS?

    I have been using my 3.6.28 Firefox for more than 3 years and still want to use it in the future. Some functions are not working when I visit websites so I need to install the newest as to see them. I have Google Chrome as my second browser but would like to swap it for the latest Firefox. Read on some forum that its not possible to have two Firefox browsers on the same Win OS. Is it possible to have both my old Firefox 3 and Firefox 20 installed on the same Win XP OS as teo different programs?

    Yes it is possible, but you need to create a new profile for the 2nd version.
    http://forums.mozillazine.org/viewtopic.php?f=23&t=2249039

  • TWO or more alv's on the same screen

    hi
    My requirement is to display more than one table  say ITAB AND JTAB in two different alv with their own FIELD CATALOGSon the same screeen.
    I tried code i got on SDN but its not working .
    can anyone provide me the code with function modules i need to use over here.

    hi aditya as you asid i have already written the code as shown.
    its giving me dump.
    Error : Field symbol has not yet been assigned.
    Trigger Location of Runtime Error
        Program                                 SAPLKKBL
        Include                                 LKKBLF99
        Row                                     2,796
        Module type                             (FORM)
        Module Name                             GEN_FIELD_OUT2
    My code is :
    REPORT  ZALV_2LIST.
    tables: kna1,lfa1.
    select-options : cust for kna1-kunnr,
    vendor for lfa1-lifnr.
    data : begin of itab occurs 0,
    lifnr like lfa1-lifnr,
    land1 like lfa1-land1,
    name1 like lfa1-name1,
    end of itab.
    data : begin of jtab occurs 0,
    kunnr like kna1-kunnr,
    land1 like kna1-land1,
    name1 like kna1-name1,
    end of jtab.
    type-pools : slis.
    data :kna1_b type slis_t_fieldcat_alv,
          FIELDCATALOG1 TYPE SLIS_T_FIELDCAT_ALV , "SLIS_T_FIELDCAT_ALV
          WA_FIELDCAT LIKE LINE OF FIELDCATALOG1,
          FIELDCATALOG2 TYPE SLIS_T_FIELDCAT_ALV ,"WITH HEADER LINE,
    layout type slis_layout_alv,
    layout1 type slis_layout_alv,
    layout2 type slis_layout_alv,
    events_b type slis_t_event.
    data : repid like sy-repid.
    repid = sy-repid.
    select lifnr land1 name1 from lfa1 into table itab where lifnr in vendor.
    select kunnr land1 name1 from kna1 into table jtab where kunnr in cust.
    *field catalofg for 1st alv
      WA_FIELDCAT-FIELDNAME = 'lifnr'.
      WA_FIELDCAT-SELTEXT_M = 'vendor'.
      WA_FIELDCAT-COL_POS = 1.
      WA_FIELDCAT-OUTPUTLEN = 20.
      APPEND WA_FIELDCAT  TO FIELDCATALOG1.
      CLEAR WA_FIELDCAT.
    WA_FIELDCAT-FIELDNAME = 'land1'.
    WA_FIELDCAT-SELTEXT_M = 'address'.
      WA_FIELDCAT-COL_POS = 2.
      WA_FIELDCAT-OUTPUTLEN = 20.
      APPEND WA_FIELDCAT TO FIELDCATALOG1.
      CLEAR WA_FIELDCAT.
    WA_FIELDCAT-FIELDNAME = 'name1'.
      WA_FIELDCAT-SELTEXT_M = 'name'.
      WA_FIELDCAT-COL_POS = 3.
      WA_FIELDCAT-OUTPUTLEN = 20.
      APPEND WA_FIELDCAT TO FIELDCATALOG1.
      CLEAR WA_FIELDCAT.
    *field catalog for 2nd alv
      WA_FIELDCAT-FIELDNAME = 'kunnr'.
      WA_FIELDCAT-SELTEXT_M = 'customer'.
      WA_FIELDCAT-COL_POS = 1.
      WA_FIELDCAT-OUTPUTLEN = 20.
      APPEND WA_FIELDCAT  TO FIELDCATALOG2.
      CLEAR WA_FIELDCAT.
    WA_FIELDCAT-FIELDNAME = 'land1'.
    WA_FIELDCAT-SELTEXT_M = 'address'.
      WA_FIELDCAT-COL_POS = 2.
      WA_FIELDCAT-OUTPUTLEN = 20.
      APPEND WA_FIELDCAT TO FIELDCATALOG2.
      CLEAR WA_FIELDCAT.
    WA_FIELDCAT-FIELDNAME = 'name1'.
      WA_FIELDCAT-SELTEXT_M = 'name'.
      WA_FIELDCAT-COL_POS = 3.
      WA_FIELDCAT-OUTPUTLEN = 20.
      APPEND WA_FIELDCAT TO FIELDCATALOG2.
      CLEAR WA_FIELDCAT.
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
      EXPORTING
        I_CALLBACK_PROGRAM             = sy-cprog
      I_CALLBACK_PF_STATUS_SET       = ' '
      I_CALLBACK_USER_COMMAND        = ' '
      IT_EXCLUDING                   =
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
      EXPORTING
        IS_LAYOUT                        = LAYOUT1
        IT_FIELDCAT                      = FIELDCATALOG1
        I_TABNAME                        = 'ITAB'
        IT_EVENTS                        = EVENTS_B
      IT_SORT                          =
      I_TEXT                           = ' '
      TABLES
        T_OUTTAB                         = ITAB
    EXCEPTIONS
      PROGRAM_ERROR                    = 1
      MAXIMUM_OF_APPENDS_REACHED       = 2
      OTHERS                           = 3
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
      EXPORTING
        IS_LAYOUT                        = LAYOUT1
        IT_FIELDCAT                      = FIELDCATALOG2
        I_TABNAME                        = 'jTAB'
        IT_EVENTS                        = EVENTS_B
      IT_SORT                          =
      I_TEXT                           = ' '
      TABLES
        T_OUTTAB                         = JTAB
    EXCEPTIONS
      PROGRAM_ERROR                    = 1
      MAXIMUM_OF_APPENDS_REACHED       = 2
      OTHERS                           = 3
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'.
    *WRITE:'AAA'.
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
    EXPORTING
      I_INTERFACE_CHECK             = ' '
      IS_PRINT                      = ' '
      I_SCREEN_START_COLUMN         = 5
      I_SCREEN_START_LINE           = 5
      I_SCREEN_END_COLUMN           = 0
      I_SCREEN_END_LINE             = 0
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER       =
      ES_EXIT_CAUSED_BY_USER        =
    EXCEPTIONS
       PROGRAM_ERROR                 = 1
       OTHERS                        = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    can anyone point out where the error is?

  • One SIMPLE, SIMPLE question that the answer seem to be no whre IN PLAIN ENGLISH! What do you have to do to have two of more tabs open at the same time. Just like ANY OTHER BROWSER LETS YOU DO! Ya know....so you can drag and drop things like pics etc.

    For Pete's sake. This is not rocket sience. What more details do you want. I want two tabs OPEN at the same time so I can copy from one to the other or drag and drop from one to the other.

    You can copy text and hover that selected text with the left mouse button down on another tab on the tab bar until that tab opens and drop the text in a text field in that tab. You need to make sure that that text area is visible because you can't scroll the page. You can also tear off that tab (temporarily) to a new window and resize them to see both windows. Move the tab back to the other window once you are done if you prefer that.

  • Is it possible to run two different apple tv units on the same network and play two different movies off of my iTunes library

    Is it possible to play two different movies on two seperate apple tv units on two tvs at the same time using the same itunes library

    AC is corret you can do that.  It might work a bit better for you if you use a wired connection vs a wireless one for the ATV's.

  • Its is possible to use two embedded instances of OC4J at the same time?

    Hi,
    I need to run two web apps at the same time in JDeveloper. Each on must run in its own OC4J instance, in different ports. I don't want to run a remote OC4J instance, I want two embedded instances and JDeveloper 10g comes just with one.
    Wny ideas?
    Thanks in advance,
    Brian

    Brian,
    no, there is only one embedded OC4J instance possible. The option is to install OC4J stand alone locally.
    Frank

  • Using two or more JRE's at the same time?

    Our company uses 1.4.2-b08 as default JRE, but some departments still have 1.3.1 as standard since business applications must use this version. We've tried migrating to 1.4.2 and 1.5.0 but they were not backwards compatible (or simply not JRE compliant programmed).
    What I'd like to do is deploy 1.5.0 as 'default JRE' so that every website or intranetsite through IE6/Firefox is secure, and leave old JRE's on every workstation so that non-browser applications can still run.
    Questions:
    -if some applications run through a browser, is there a possibility through commandlines or startup options in a link or batchfile to use the non-default JRE?
    -using a link that refers to the 1.4.2 or 1.3.1 java.exe (plus the other variables for the application to run of course, instead of simply java.exe without path/directory names), seems to work fine - but does it?
    -with starting an old JRE through this commandline, do the libraries of the same the new/default JRE version get called on? I'm not sure whether Windows or the JRE first look in the environment settings of Windows XP, in the current path of java.exe and higher subdirectories or in the registry?

    Our company uses 1.4.2-b08 as default JRE, but some
    departments still have 1.3.1 as standard since
    business applications must use this version. We've
    tried migrating to 1.4.2 and 1.5.0 but they were not
    backwards compatible (or simply not JRE compliant
    programmed).
    What I'd like to do is deploy 1.5.0 as 'default JRE'
    so that every website or intranetsite through
    IE6/Firefox is secure, and leave old JRE's on every
    workstation so that non-browser applications can
    still run.
    Questions:
    -if some applications run through a browser, is there
    a possibility through commandlines or startup options
    in a link or batchfile to use the non-default JRE?If you're using applets, or Java Web Start to start applications, yes. Applets use html, WS uses jnlp files. Other than these, not that I'm aware of.
    -using a link that refers to the 1.4.2 or 1.3.1
    java.exe (plus the other variables for the
    application to run of course, instead of simply
    java.exe without path/directory names), seems to work
    fine - but does it?If you're running java applications from the commandline (ie, executing java.exe) then yes, if your machine is correctly configured.
    -with starting an old JRE through this commandline,
    do the libraries of the same the new/default JRE
    version get called on? Yes - see prior reply.
    I'm not sure whether Windows
    or the JRE first look in the environment settings of
    Windows XP, in the current path of java.exe and
    higher subdirectories or in the registry?If you supply a full path to an executable that is the executable that will run. If you machine is mis-configured, other problems can subsequently occur.

  • I want to run two or more firefox processes under the same user at the same time

    My setup: A laptop running Fedora 20 and Gnome 3. I would really like to have a Firefox window on the laptop screen, and at the same time another one on the VNC client I am running on another computer. Both under the same user account.
    Closing one of the firefox windows is a very poor solution, as I would lose all the tabs I opened, in addition to the hassle.
    Is that possible at all? If yes, how? And if not, can you suggest workarounds?

    You can use the -no-remote command line switch to open another Firefox instance with its own profile and run different Firefox instances simultaneously, but do not use -no-remote to start the default browser with the default profile.
    * http://kb.mozillazine.org/Opening_a_new_instance_of_Firefox_with_another_profile
    * https://developer.mozilla.org/Mozilla/Multiple_Firefox_Profiles
    See also Remote Control:
    *https://developer.mozilla.org/Command_Line_Options

  • Is it possible to have two different input forms to edit the same underlying data schema?

    I am noting that the Input Form name value must be equivalent to the underlying schema name.
    Hence it would seem only one form per schema is possible?

    The names don't have to match, but then the form XML has to explicitly call out the schema to edit with that form, using the attribute:
    entity-schema="namespace:schemaName"
    in the form open tag, e.g. <form entity-schema="neo:product">.
    Regarding your second question, can you use multiple forms to edit the same schema, let me look into that.
    Linda

  • HT204053 Is it possible to have two (or more) different icloud mail accounts (not alias) under the same apple id? If not what is you best advice for all family members to have their own e-mail and still share the purchases under the same apple id. Thanks

    Is it possible to have two (or more) different icloud mail accounts (not alias) under the same apple id? If not what is you best advice for all family members to have their own e-mail and still share the purchases under the same apple id. Thanks

    mannyace wrote:
    Thanks for the response.
    So I basically won't run into any trouble? I
    There should be no issues. Its designed to work like that.  You don't change Apple IDs just because you get a new device.
    mannyace wrote:
    Thanks for the response.
    Is there any chance that the phones can fall out of sync?
    Unlikely. But nothing is impossible.   Though I don;t see how that would happen. As long as both are signed into the Same Apple ID / iCloud Account they will be N'Sync. (Bad Joke)
    mannyace wrote:
    Thanks for the response.
    If I get a message or buy an app or take a photo on the iPhone 5, how do I get those things onto the iPhone 6?
    If you buy an App, you have 2 ways to get it to the iPhone6: If Automatic Downloads is enabled in Settings->iTunes & App Store, it will automatically download to the iPhone 6 when you buy it on the 5 and vice versa if you buy it on the 6, it will download to the 5.
    Alternatively, you can simply go to the App Store App->Updates->Purchased and look for the App there and download it. Purchased Apps will not require payment again. i.e They'll be free to download to the iPhone 6 once purchased.
    SMS Messages will sync over using Continuity as long as they are on the same Wifi network. Otherwise, restoring the iPhone 5 backup to the iPhone 6 will transfer all messages received up until the backup was made onto the iPhone 6.
    Images, can be transferred either through Photo Stream
    My Photo Stream FAQ - Apple Support
    Or any Cloud service you want such as Dropbox, or One Drive.
    mannyace wrote:
    Also, something i forgot to ask initially: Should I update the iPhone 5 to iOS 8 first or does that not matter?
    If you want the Continuity features as explained above you need to update the iPhone 5 to iOS 8. Otherwise its not all that important.

  • Is it possible to link two or more accounts without merging?

         Is it possible to link two or more accounts without merging? For example: give access for apple id [email protected] (obviously fake and is used by John) to apple id [email protected] (also obviously fake and is used by Rose). This would only allow access from one consenting party to another, for temporary sharing.
         The accounts would be temporarily linked/paired in the same manner as a bluetooth device (device A shows the user a password to input into device B) except John receives password abc123 and Rose receives password xyz789. they exchange passwords and can use this to do multiple things, such as; pool money to buy a game, a movie, or a song album, or they could share an app or two with each other.
         Is there any feature in apple remotely like this in any way? If so please let me know how I can find or use this feature.
         If not, I would recommend implementing this in the future, if not the near future. There are a lot of people that would use it, and it could allow app designers to make more money, because people would be able to buy something by pooling their money. If you think otherwise, ask anybody who lives in an apartment with three other people, because that is the only way they can afford it.

    You cannot merge or link accounts.
    Sorry.
    You can leave feedback for Apple at:  http://www.apple.com/feedback

Maybe you are looking for

  • Apps & iBook

    I downloaded iBooks and a book as well as other apps and after syncing with iTunes, I cannot find them on my iPad although they show up in iTunes under Devices. They are not shown under my main iTunes lists. Thanks for any help.

  • Can't copy any file to/from iomega 1TB home media network CE other than through FTP

    Hi, since few days ago I can't copy any file to or from iomega using Windows Explorer on my PC or any file explorer ony my android phone. I can acces the drive but when I try to copy something to the drive, a 'copying'  window pops up  and shows "est

  • IPad touchscreen is not responding even if I did the restart procedure.

    iPad touchscreen is not responding even if I did the restart procedure.

  • I do not want to use Templates for email

    I have iPhoto 11 (9.4.2) installed on a 13" and 11" Macbook Airs. Sharing pictures using email is different on both. The older 13" transfers the pictures to Mail with only the pictures and uses the standard Mail form. Looks like the Attach version wi

  • Implement PO, FA, AP without HRMS & INVENTORY (11.5.10)

    Hi, We are implementing PO, FA & AP as part of P2P impelementation for Bank (v 11.5.10). Can you please let me know if there are any specific things to keep in mind considering there is no plan to implement HRMS & Inventory module in near future. Als