Multiple cases per switch?

I have the following piece of code in one of my methods:
//determines the element of the animal on the chinese zodiac. Every 12 years is one cycle of the animals, then the element changes
   float caseElement = intYear % 60;  // where intYear is the year of birth provided by user
            int j = (int)caseElement;
            switch (j) {   
            case 0 11: finalElement = "Metal";break;
           case 12 23: finalElement = "Water";break;
           case 24-35: finalElement = "Wood";break;
           case 36-47: finalElement = "Fire";break;
          case 48-59: finalElement = "Earth";break;
        }I understand i could just do case 0, case 1, case 2, case 3, etc all the way to case 59 and then arrange them into five blocks, but is Is there some way to do it so i can get away with some like above, where 0-11 encompasses the range of numbers between.
As is becomng increasingly common, thanks in advance.

I was wrong with how the elements work actually (one element every two years then switch and repeat at the end) but i was able to adapt and then used j/2, which works.
Sankyu very much
Edited by: Sazazezer_Mililipili on Sep 18, 2008 2:42 PM

Similar Messages

  • How do I prevent the patch from advancing multiple times per switch press?

    I'm using Mainstage 2.1.3 with a Roland RD-300SX. I have an FS-5U foot switch that I'd like to use to advance patches plugged into the Roland's control switch port. Regardless of what I've set the Roland to send for that port, it sends one or two messages with a value less than 127 before sending the value of 127. This causes Mainstage to advance 2 or 3 patches each time I press the switch.
    I saw that recent release notes said that this didn't happen for the sustain pedal now. Indeed, it does not. However, I need the sustain pedal to sustain.
    Is there any way to get Mainstage to only advance one patch in this situation? Perhaps set a threshold value for the action?

    I've had this problem - bad polarity on the pedal was my demon.
    I have found a very stable configuratio.
    On my 88 note midi-master keyboard, the lowest note has been assigned to step back one patch, and the next black note, to advance one patch.
    This works just fine, and these are notes I never use - just be careful if you do big "sweeps" of the keyboard to STOP before these last two notes.
    Sort of "off" subject.
    Mainsatge 2.2.1 and OS 10.7.4 are unstable.
    Deleting the "CPU/Ram" meter has been suggested as a fix, or shell out for MS 2.2.2
    Or, apparently OS 10.8 fixes the stability problem.
    Good luck

  • About case and switch in multiple condition step in workflow.

    i ve some information about case and switch in multiple condition in workflow.
    case - static determination
    switch - runtime determination.
    but i want brief explanation about case and switch and difference please help me.....

    hi velmurugan............
        in case,
               we can have only one value for comparison and can have any number of branches for it.
       in switch,
               we can compare any number of values and have any number of branches.
    eg:
         consider i am triggering a workflow for purchase order change and i am having a multiple condition step.
    if i am going for a case:
            i can have only on value (ie po number/vendor number.....) as a parameter and can check different values with it. ( eg vendor number < 1000
                                                                 vendor number > 1000.... so on)
            a branch will be created for each condition.
    if i am going for a switch:
            i can take any parameter needed. (eg: vendor number > 1000
                                                                    order type = 'NB' .... so on)
             so a single branch can have any number of comparisons with the help of 'and' and 'or' operators and i can have any parameter for my condition.
    ---regards,
       alex b justin

  • Firefox crashes multiple times per day

    Hello all!
    As of the last month or two, Firefox now crashes multiple times per day (even in Safe Mode). Firefox is fully updated, as are my Add-ons and Extensions.
    Yesterday alone, it crashed 14 times (which is about average).
    System Info:
    Windows 7 Home Premium
    Intel Core i7-3610QM CPU @ 2.30 GHz
    8.00 GB RAM
    64-bit OS
    Troubleshooting details:
    "application": {
    "name": "Firefox",
    "version": "30.0",
    "userAgent": "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:30.0) Gecko/20100101 Firefox/30.0",
    "supportURL": "https://support.mozilla.org/1/firefox/30.0/WINNT/en-US/"
    "crashes": {
    "submitted": [
    "id": "bp-56f4b9d3-7646-4804-b1f0-6b86a2140712",
    "date": 1405205216202,
    "pending": false
    "id": "bp-252f490e-dbc4-4b6c-89bb-abc7a2140712",
    "date": 1405205139899,
    "pending": false
    "id": "bp-728dabc3-d5ae-42cc-a7b3-5ef922140712",
    "date": 1405204414387,
    "pending": false
    "id": "bp-f4cf2971-3a0d-4737-b3e4-81c2f2140712",
    "date": 1405204325838,
    "pending": false
    "id": "bp-717ff5d6-7edf-49c7-956f-247e52140712",
    "date": 1405204300027,
    "pending": false
    "id": "bp-e0f0c131-39c9-40e3-b6aa-45c312140712",
    "date": 1405184955514,
    "pending": false
    "id": "bp-8f6e4e47-0363-48d2-a7ff-875b92140712",
    "date": 1405184937698,
    "pending": false
    "id": "bp-9245429c-ccfc-41fa-9edd-79baa2140712",
    "date": 1405184884426,
    "pending": false
    "id": "bp-5e91822b-8fc3-411c-bcf7-c753f2140712",
    "date": 1405184798033,
    "pending": false
    "id": "bp-db406fb0-7045-41a5-b42c-522db2140712",
    "date": 1405183704121,
    "pending": false
    "id": "bp-6c913909-d1ef-4773-9712-fa1b92140712",
    "date": 1405183678385,
    "pending": false
    "id": "bp-65a30f3e-da4a-406b-9bfa-8cec72140712",
    "date": 1405178435488,
    "pending": false
    "id": "bp-11fbb2a8-923f-4ab3-b577-6dbe32140712",
    "date": 1405178411720,
    "pending": false
    "id": "bp-968183f6-086d-430a-a993-f1d892140712",
    "date": 1405127322874,
    "pending": false
    "id": "bp-017688f8-afc7-4b90-8fa7-2be692140711",
    "date": 1405040514173,
    "pending": false
    "id": "bp-342b9f6c-3ffd-489e-ae1c-b5ac62140711",
    "date": 1405037808744,
    "pending": false
    "id": "bp-62c1ea5a-24da-421f-9983-9b09c2140711",
    "date": 1405037772426,
    "pending": false
    "id": "bp-a7227128-b4dd-4cd5-997c-b9f132140711",
    "date": 1405037229671,
    "pending": false
    "id": "bp-2d0b1114-0d86-4f2b-ba7d-20f902140711",
    "date": 1405037207333,
    "pending": false
    "pending": 1
    "modifiedPreferences": {
    "accessibility.typeaheadfind.flashBar": 0,
    "accessibility.browsewithcaret": true,
    "browser.cache.disk.capacity": 358400,
    "browser.cache.disk.smart_size.first_run": false,
    "browser.cache.disk.smart_size.use_old_max": false,
    "browser.cache.disk.smart_size_cached_value": 358400,
    "browser.places.smartBookmarksVersion": 7,
    "browser.sessionstore.upgradeBackup.latestBuildID": "20140605174243",
    "browser.startup.homepage_override.mstone": "30.0",
    "browser.startup.homepage": "https://www.bing.com/",
    "browser.startup.homepage_override.buildID": "20140605174243",
    "dom.mozApps.used": true,
    "extensions.lastAppVersion": "30.0",
    "font.internaluseonly.changed": false,
    "gfx.direct3d.last_used_feature_level_idx": 0,
    "network.cookie.prefsMigrated": true,
    "network.cookie.cookieBehavior": 2,
    "places.database.lastMaintenance": 1405257179,
    "places.history.expiration.transient_current_max_pages": 104858,
    "plugin.state.npitunes": 0,
    "plugin.state.npesnsonar": 0,
    "plugin.state.npesnlaunch": 0,
    "plugin.importedState": true,
    "plugin.state.npsitesafety": 0,
    "plugin.state.npauthz": 0,
    "plugin.disable_full_page_plugin_for_types": "application/pdf,application/vnd.adobe.xfdf,application/vnd.fdf,application/vnd.adobe.xdp+xml",
    "plugin.state.npwlpg": 0,
    "plugin.state.npffwloplugin": 0,
    "plugin.state.npdeployjava": 0,
    "plugin.state.np_wtapp": 0,
    "privacy.cpd.offlineApps": true,
    "privacy.cpd.sessions": false,
    "privacy.donottrackheader.enabled": true,
    "privacy.sanitize.migrateFx3Prefs": true,
    "storage.vacuum.last.places.sqlite": 1405258871,
    "storage.vacuum.last.index": 0
    "graphics": {
    "numTotalWindows": 2,
    "numAcceleratedWindows": 2,
    "windowLayerManagerType": "Direct3D 10",
    "windowLayerManagerRemote": false,
    "adapterDescription": "Intel(R) HD Graphics 4000",
    "adapterVendorID": "0x8086",
    "adapterDeviceID": "0x0166",
    "adapterRAM": "Unknown",
    "adapterDrivers": "igdumd64 igd10umd64 igd10umd64 igdumd32 igd10umd32 igd10umd32",
    "driverVersion": "9.17.10.2843",
    "driverDate": "8-21-2012",
    "adapterDescription2": "NVIDIA GeForce GT 650M ",
    "adapterVendorID2": "0x10de",
    "adapterDeviceID2": "0x0fd1",
    "adapterRAM2": "2048",
    "adapterDrivers2": "nvd3dumx,nvwgf2umx,nvwgf2umx nvd3dum,nvwgf2um,nvwgf2um",
    "driverVersion2": "9.18.13.3788",
    "driverDate2": "5-19-2014",
    "isGPU2Active": false,
    "direct2DEnabled": true,
    "directWriteEnabled": true,
    "directWriteVersion": "6.2.9200.16571",
    "clearTypeParameters": "Gamma: 2200 Pixel Structure: R ClearType Level: 100 Enhanced Contrast: 100 ",
    "webglRenderer": "Google Inc. -- ANGLE (Intel(R) HD Graphics 4000 Direct3D9Ex vs_3_0 ps_3_0)",
    "info": {
    "AzureCanvasBackend": "direct2d",
    "AzureSkiaAccelerated": 0,
    "AzureFallbackCanvasBackend": "cairo",
    "AzureContentBackend": "direct2d"
    "javaScript": {
    "incrementalGCEnabled": true
    "accessibility": {
    "isActive": false,
    "forceDisabled": 0
    "libraryVersions": {
    "NSPR": {
    "minVersion": "4.10.6",
    "version": "4.10.6"
    "NSS": {
    "minVersion": "3.16 Basic ECC",
    "version": "3.16 Basic ECC"
    "NSSUTIL": {
    "minVersion": "3.16",
    "version": "3.16"
    "NSSSSL": {
    "minVersion": "3.16 Basic ECC",
    "version": "3.16 Basic ECC"
    "NSSSMIME": {
    "minVersion": "3.16 Basic ECC",
    "version": "3.16 Basic ECC"
    "userJS": {
    "exists": false
    "extensions": [
    "name": "Norton Toolbar",
    "version": "2014.7.2.6",
    "isActive": true,
    "id": "{2D3F3651-74B9-4795-BDEC-6DA2F431CB62}"
    "name": "Norton Vulnerability Protection",
    "version": "12.2.0.5 - 1",
    "isActive": true,
    "id": "{BBDA0591-3099-440a-AA10-41764D9DB4DB}"
    "name": "Troubleshooter",
    "version": "1.1a",
    "isActive": true,
    "id": "[email protected]"
    "name": "Windows Media Player Extension for Firefox",
    "version": "1.1",
    "isActive": true,
    "id": "jid0-nRwp7VvCqZcSRTppwWz2npqGEKw@jetpack"
    "name": "HTTPS-Everywhere",
    "version": "3.5.3",
    "isActive": false,
    "id": "[email protected]"
    }

    Was discussed here - https://support.mozilla.org/en-US/forums/contributors/709022 - in Feb 2013. And Bug #738661 was filed in March of 2012, with the consensus being.
    '''"In that case this is more likely a bug in Covenant Eyes than it is a bug in Firefox. If we have no hope of success through engaging with Covenant Eyes and can't blocklist the offending DLL from loading, can we at least get a support article posted instructing users how to work around this issue (ie. removing Covenant Eyes or switching to a different browser)?'''
    '''Additionally, I don't see much point in keeping this bug in the NEW state if it's unreasonable to expect that we'll ever fix this."'''

  • Dispute Case per invoice

    Hi All,
    My client is planning to implement Dispute management. I just wanted to know if we can create one dispute case per customer i.e. one dispute case per multiple invoices of a customer or does it have to be one dispute case per invoice.
    Regards,
    Raj/

    I am trying to writeoff a dispute case. I ran the program UDM_AUTOWRITEOFF. A background job gets scheduled. But there is no spool generated. When I see the job log this is the error I have.
    Field COBL-KOSTL. does not exist in the screen SAPLKACB 0002
    Can anyone help me where should I fix this. I know this is the cost element in  the coding block but where should I fix or do the configuration?
    Regards,
    Raj.

  • Help with multiple case statements

    Hello,
    I am new to BO.  I am on XI 3.0.  SQL 2005.  In Designer, I am trying to create a measure in a financial universe that would end up being multiple case statements within one select.  This is what I tried to do, but it doesn't work with the two case statements.  Can I use an ELSE leading into the second CASE WHEN somehow?  How can I accomplish this?  Sorry for my ignorance!
    CASE WHEN dbo.ClientBudgetYear.DateStage1Approved > 01/01/1900 AND dbo.ClientBudgetMonth.Month = 12 THEN dbo.ClientBudgetMonth.Stage1Sales END
    CASE WHEN  dbo.ClientBudgetYear.DateStage1Approved > 01/01/1900 AND dbo.ClientBudgetMonth.Month = 11 THEN dbo.ClientBudgetMonth.Stage1Sales END
    Any Suggestions?
    Thanks,
    Holly

    Holly,
    I don't know enough about your data or requirement to provide a solution, however, the construct that you post will not work because it causes you to build an object with multiple case statements when only one case statement per object is permitted.  From what I see in your code I would be inclined to combine the two statements into one as such:
    CASE WHEN dbo.ClientBudgetYear.DateStage1Approved > 01/01/1900 AND dbo.ClientBudgetMonth.Month in (11,12) THEN dbo.ClientBudgetMonth.Stage1Sales else null END
    Thanks,
    John

  • Nokia 2323 Contacts: Multiple entries per contact ...

    Hello Everyone,
    Greetings
    I am planning to buy Nokia 2323 Classic phone. gsmarena informs that it can save 1000 contacts. What I need to know is that does this phone accept multiple entries per contact. For example: Work Phone, Home Phone, Fax, Mobile Phone etc. If yes, then how many entries can each contact take? Also, if we add multiple entries then would it reduce the number of contacts we can save?
    I have googled but it doesn't help. Also tried looking at the online user guide of Nokia 2323. It talks about going into Details menu and then entering Add detail but doesn't mention what kind of "details" it takes. I would be really glad if some one who has seen/used the phone could help.
    Thank you.
    Regards
    Message Edited by ajobe on 26-Aug-2009 08:25 PM
    Solved!
    Go to Solution.

    Now that I'm not so sure about. The phone will either have a certain amount of memory put aside for contacts and usually you can't tell how much but you can check how much of it you have used as a percentage or it will let the contacts share the same memory as your messages and everything else and when you check your memory it will just tell you how much the contacts are using. I haven't used that phone but I think the 1st case applies to it
    Show your appreciation. Hit that kudos button real hard

  • Multiple datafiles per tablespace in 9i?

    Is it recommended to have multiple datafiles per tablespace?

    Is it recommended to have multiple datafiles per
    tablespace?It all depends on your particular storage needs. You could have a single datafile at maximum capacity for your tablespace, just ensure you can store it and in case you have to move it, it could be affordable.
    There are DBA's who use several datafiles for a single tablespaces, this reduces the single point of failure possibility and allows a more flexible datafile maintenance.
    Performance is the same for, except for the checkpoint process, the more datafiles, the more effort to update datafile headers.
    ~ Madrid

  • Multiple layouts per portal

    i would like to create a look and feel like amazon.com(and many other sites) with tabs and each tab having different layout.
    since a portal can only have one layout per group, how can this be done.
    i was thinking of having multiple portals and then switch the user to different portals depending on the tab clicked.
    but that is clumsy with all that session information transfering and admin setup.
    i saw in you api that there is something called a category and that you can get a layout using a category as an argument.
    is there going to be native support for multiple layouts per portal? if so, when, next release?

    Hi Thomas,
    you have several options with the portal standard:
    1.) If the user only has one role assigned at a time you can attach the portal layout to the roles. So depending on the role the user has he sees the respective layout - BUT: how to asign the two roles to the user!? This can only be done by admins and I assume that it is no intended to call the admins every time the user needs the other role?
    2.) The entry to the portal is realized with different urls like http://yourportal.com/VIEW1 and http://yourportal.com/VIEW2.
    VIEW1 and VIEW2 are so called portal aliases and you can attach the different layouts to those aliases.
    BUT: the two roles have nothing to do with the aliases so you still have the problem of role assignment.
    3.) Each person gets two users with each user assigned to one role and one layout assigned to the user or group or role...
    Anyhow: I would ask the people who brought up the idea of two different layouts - WHY?? A portal is ONE single point of entry for EVERY application and information a user needs. So why two different layouts? And what, if five others are coming each bringing their own layouts, too?
    4.) If you really want to have different layouts each time a different top-level navigation point is active you have to program your own portal component. That would fit your needs but is besides standard.
    Hth,
    Michael

  • Multiple OS9 per partition

    I know 9.22 supports multiple system folders per volume, eg. HD partition.
    But this wasn't always the case with the 'old' OS -- before arrival of that feature, when you wanted several system folders on your system, you needed to partition your drive first and then put 1 system per partition.
    Finally, the question: Anybody remember pretty sure starting which version OS9 supported multiple systems per partition. Was that maybe 9.1, or even 9.04?
    TNX!

    BTW, that control panel also works to make OSX
    selectable in OS's as early as OS 8.6.
    Hello and Thank you for all the answers, esp. to Don for that really valuable information bit and to Kenichi Watanabe for taking the time and testing.
    In the meantime, while bringing the client's system back to a working state, I did a fresh install of 9.1, and the installed startup cp shows those two different OS9 systems on one of that system's volume, and OS-X on an attached FireWire drive, without further updating the cp. I'd assume that 9.1 cp would see OS-X anywhere. ie no matter where installed. I figure, there may have been different 9.1 installation cds produced, some of them installing an updated and more capable startup cp.
    Whereas the startup cp of the OS 904 also present on that system would only see 1 system per volume (-> would only see itself), and no FireWire disk at all. Updated its startup cp and now all is just like in newer systems.
    TNX again! -Martin

  • "Allow multiple currencies per entity" option in Planning web form

    Hi, All
    The desciption of the option I pasted from the oracle doc library is:
    •Allow multiple currencies per entity: If the application supports multiple currencies, allow entities to support multiple currencies, regardless of base currency. Users can select currency for displayed cell values in data forms
    Well, assume that app has USD as a default currency. App was built in EPMA with multi currency option. All entities have USD as a local
    I build a form and set this flag. According to the text above i want to enter some values (for example for one of the account) in GBP, can I?
    All i need is the binary anwser, Yes or No. Honestly it's not the truth because if the anwser will be Yes i'll be surprised how? I can enter GBP in cell but after saving it returns to USD
    I've allready searched question like this and have found a couple but not answered

    Hi, Alp
    Thank you for you answer. I've checked your link and it's amazing that information like this was written not in admin but in user guide.
    Another thing i've wondered that it depends on setting of Calculate Currencies calc script (run on save). But it's just a think men must know and do I think.
    Unfortunately I can't see how does it work, although I've done this settings.
    If I set local currency for one of the entity as GBP then I can enter data in GBP of course and Calculate Currencies script runs ok. I can see exact values for local (GBP) and default currency (USD) just on planning form as I set currency dim in page.
    But in my case when i set local currency for this entity back to USD entered value in GBP always changed back to USD regardless of Calculate Currencies script settings. It happens during save on the form
    Can I get a bit more information about some other settings to be done to make this functionality work?
    BR,
    Vladimir

  • Allow Multiple currencies per Entity

    Hi All,
    When we will use "Allow Multiple Currencies Per Entity" in a data form ? The name itself is confusing. It means, we can enter many currencies per entity ?

    Hi All,
    If we use "Allow multiple currencies Per entity", do we need to take Entity in the Pages and Currency (Local & USD) on the Columns ? For ex. if i select Entity as USA in Page, then we need to enter the value for Local currency right ? In that case, how Allow multiple currencies per entity works ? In this example, we can enter the data for USA only right
    I'm unable to understand this logic. Pls. clarify me.

  • Can a case structure execute multiple cases?

    So I have a VI set up with a mutiple option case structure to select which input a voltage is read from (there are 32 options). Now that I have it made, I realize that sometimes I may want to read from multiple inputs at once.. Is there an easy way to change my setup so that it executes multiple cases at a time? Right now my control is a slider to choose the case. What would be a good front panel control choice to be able to select multiple options? Thanks
    Solved!
    Go to Solution.

    You can build an array of your options and loop through the required cases. As mentioned, a case can only perform 1 case per loop.
    A good front panel control would be a cluster or an array of booleans (e.g. a tick box per option), easy to loop through.
    /Y
    LabVIEW 8.2 - 2014
    "Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
    G# - Free award winning reference based OOP for LV

  • CSS11800 mac table per switch or per VLAN

    Hello
    I have a scenario where the CSS11800 is seeing th same mac address from bultiple interfaces on an extreme switch as this is the way the extreme works.
    Does the CSS11800 have a seperate mac database for each VLAN configured or does it have 1 per switch.
    If it is per switch then I have a problem where the packets are being forwarded to the wrong interface sometimes.
    Is there any way to resolve this on the Arrowpoint side as it cannot change on the extreme side.
    Thanks
    Micheal

    Often times complex troubleshooting issues are best addressed in an interactive session with one of our trained technical assistance engineers. While other forum users may be able to help, it’s often difficult to do so for this type of issue.
    To utilize the resources at our Technical Assistance Center, please visit http://www.cisco.com/tac and to open a case with one of our TAC engineers, visit http://www.cisco.com/tac/caseopen
    If anyone else in the forum has some advice, please reply to this thread.
    Thank you for posting.

  • Trackpad quits working multiple times per hour, is it defective?

    I have a mid-2012 13" MBP. My trackpad quits working multiple times per hour. When this happens I have to remove my hand from it and wait a few seconds, then I can use it again. It started a few months after I got the machine last year and has gotten progressively worse. Is this a bug in OS X or is this some kind of malfunction? I need to know if I need to take this to an Apple Store to be fixed under warranty.

    Yes, your issue has been posted many many times here.  Do a forum search and read the posts in the "More Like this" section as well as Apple's articles on the matter - Intel-based Apple Portables: Troubleshooting unresponsive trackpad issues and   Portables and Magic Trackpad: Jumpy or erratic trackpad operation
    Always, take full advantage of your warranty before you lose it.  Call Apple Care and make sure you get a case number.  You should also consider purchasing Apple Care Protection plan.

Maybe you are looking for

  • Authority check - in terms of User Group

    Hi all, I need restrict the usage of a finnance report by order of users.the report has order grup as an input, only certain order groups should be viewed by certain users. in authority check can do the checking by using user groups instead of indivi

  • Polling on a practice for REDO logs

    I would like to do a poll on the below security practice because it seemed not commonly deployed. If this practice is done in your company for the core databases, could you please reply to my posting and state your industry, DBA strength and total nu

  • Poll - Large ECC 6.0 system on Linux

    Hello, We are analyzing the option of switching from Windows 2008/Oracle platform on Linux and we would like to know if there are large ECC 6.0 systems productive on Linux?  We have regularly more than 5000 concurrent users in a system with a consist

  • Drawing Chat in Flash

    Hi Everyone, Firstly, I tried a lot of google-ing AND searching in this forums but did not find anything like what I want to do, so Here I am. I want to make a chat program like flash application, BUT, instead of all the text and smileys, I want a co

  • [Solved] kbuildsyscoca messing around

    Hey, today I did an pacaur -Syu update. When pacman was building the kernel, I got the following message: (19/27) Aktualisiere linux [----------------------------------] 100% >>> Updating module dependencies. Please wait ... >>> Generating initial ra