Using "switch"

I'm trying to create an "English calculator" (i.e. - user inputs a statement like "six plus two") using only swtich.
Problem is since I can't case something like "six", how am I suppose to translate something like "six" into 6 for Java?
Thanks for any help.

there is no API class to handle that type of convertion, if you can get them to enter it in number form you can use the parse statements. Otherwise you will need to use if statements.
Strings always need complex translations, java API supports convertion of all primitive data type (i.e. int , double ect) but a String is not a primitive data type, its an object
let me know why you cant use if statements and maybe i can help

Similar Messages

  • How to use switch statement in JSP?

    Hi,
    I am using switch satement in jsp.
    the code as follows:
    switch(flag)
         case 1: query="select * from cust";
                        break;
         case 2: query="select * from cust where minp="+mini+"and maxp="+maxi;
                        break;
        default: query="";
    out.println(query);but, i am getting some number format exception. I don't know where i am going wrong.
    Please help
    Regards,
    Ashvini

    I got the solution
    Thanks anyways
    Regards,
    AShvini

  • Cannot connect to com1 in PXI2530 using Switch Executive

    I have a PXI2530 configured using Switch Executive 2.10.  The first 60 Channels are setup with my signal names on ch0 - ch59.  Com0, 1, 2 and 3 are my Instrument connections.  The IVI Driver Sessions has Driver Setup set to Topology:2530/1-Wire Octal 16x1 Mux. 
    When I try to configure either a Channel, Route or a Group, there is only a com0 pin and no com1, 2, 3, 4, 5, 6 or 7.  There is no way to connect to any pin beyond ch15.
    The configuration looks like it is setup for a 128:1 mux, but when I try to connect ch16 to com0, it cannot complete the route.  Ch16 cannot be connected to com0 or any channel in the list.  Any idea what I am doing wrong?
    Michael Munroe, ABCDEF
    Certified LabVIEW Developer, MCP
    Find and fix bad VI Properties with Property Inspector

    http://forums.ni.com/ni/board/message?board.id=320​&message.id=633
    Duplicate threadMessage Edited by Berto on 02-28-2006 12:15 PM

  • Using Switch Excequtive with NI TestStand

    Hello
    I am beginner in NI teststand & NI switch excequtive.
    I have NI SCXI-1001 Chassis with NI SCXI-1130 switching slots.
    I need a quick help on how to use switching in NI TestStand. What  I am going to do is: generating a signal by a RIGOL Function Generator and switch this signal to excite some piezoelectric sensors and reading the response signals by a Tektronix oscilloscope.
    I have read these documents:
    NI TestStand 4.0 Quick Start Guide
    Getting Started with TestStand
    GETTING STARTED GUIDE NI Switch Executive
    and so on
    But still, I can not switch the signals with my hardware.
    Is there any Tutorial to help me in doing my work?
    Is there any VI code,  NI TestStand Sequence or Example which can help me?
    Please help me asap
    Thanks in advance,
    Mohammad

    Hi Mohammad,
    The following are a few documents that outline various ways (including with the Switch Executive) to incorporate switches into your TestStand sequence:
    http://zone.ni.com/reference/en-XX/help/370404G-01/nise/teststand/
    http://www.ni.com/white-paper/10092/en/
    Let us know if those are helpful and keep us updated on your progress!
    Regards,
    David R
    Applications Engineer
    National Instruments

  • Scan list using Switch Executive

    I have a number of signal routes using multiple switch cards that I have set up using switch executive. I want to create a scan list that will switch each of my routes in turn each time I see a hardware trigger on the trigger inputs of my switches.
    I have looked at some examples in TestStand and can see that if I use the IVI Switch Step using the IVI Switching setting that I can set up a scan list but that seems to be only for one switch card, I have two that I need to route signals to a Digitizer. I can not see a way of using my routes set up using Switch Executive. 
    I can either use LabView2013 or TestStand 2013 to do this.
    Some help would be most appreciated?
    Wayne 

    Hi Wayne, 
    If I have understood your problem correctly, this VI in LabVIEW sound like it does what you are after. 
    NI Switch Route Trigger Input
    Also at the bottom of this LINK are some examples of scan lists, perhaps you will be able to adapt this to your needs
    Please let me know how you get on
    Kevin R
    Applications Engineer
    National Instruments UK&Ireland

  • Transfering data using switch device manager from old palm to new curve 8330....please help!!!

    Trying for hours to import data using switch device manager from old Palm Treo and Palm Desktop 4.2 to my new Blackberry Curve 8330.  Blackberry seem to connect...but second step of choising Palm or Mircrosort will not allow me to select anything.  I do not believe Palm is connecting...Is my palm to old?  If I cannot tranfer data this way, especially contacts is there any other way besides entering it into Blackberry one by one?

    Hi there!
    If the device switch wizard is not working, check this KB to be sure all of your Palm things are compatible and that you are using the correct process:
    KB05459 How to use the Switch Device Wizard to switch from another smartphone to a BlackBerry smartphone
    And then see this KB for some troubleshooting help
    KB10722 BlackBerry Desktop Manager does not detect the Palm software when using the Switch Device Wizard
    And if it happens that it will not work, then you will have to find out how to export from your Palm to an ASCII or CSV file...then you can import it with this process:
    KB11194 How to import contacts from an CSV file to the BlackBerry device
    Good luck and let us know!
    Occam's Razor nearly always applies when troubleshooting technology issues!
    If anyone has been helpful to you, please show your appreciation by clicking the button inside of their post. Please click here and read, along with the threads to which it links, for helpful information to guide you as you proceed. I always recommend that you treat your BlackBerry like any other computing device, including using a regular backup schedule...click here for an article with instructions.
    Join our BBM Channels
    BSCF General Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • Thunderbird opening chromium but need to use switches

    I have no problem opening chromium with links in Thunderbird. However, I would like to open the chromium browser with switches (which specify a ram disk for cache and size- performance tweaks), which don't seem to work (nothing happens whenever I add a -switch). I tried to make a pointer file called "chrome" in /usr/bin/ containing the switches, which works everywhere except with Thunderbird. Is there a way to get Thunderbird to open Chromium while using switches?
    I don't think there are any global settings for things like this in chromium, that would also solve this problem...
    Thanks for any help,
    Last edited by jskier (2010-12-18 16:03:09)

    Does it work if you change the value of these to include the flags?
    Preferences -> Advanced -> General -> Config Editor
    network.protocol-handler.app.ftp
    network.protocol-handler.app.http
    network.protocol-handler.app.https

  • Multiple records using switch case

    Hi...
         I am having input file like
      <?xml version="1.0" encoding="utf-8" ?>
    - <ns1:mt_out xmlns:ns1="http://Block">
    - <Material>
      <Item>0</Item>
      <ItemName />
      <ReqQty>0</ReqQty>
      <AvailQty>0</AvailQty>
      <Cost>0</Cost>
      <suppid />
      <suppname />
      <leadtime>0</leadtime>
      <matname>Y-351</matname>
      <plantloc>2222</plantloc>
      <date>2008-09-30T00:00:00</date>
      <orderqty />
      <warehouseloc />
      <unit>KG</unit>
      </Material>
    - <Material>
      <Item />
      <ItemName />
      <ReqQty>0</ReqQty>
      <AvailQty>0</AvailQty>
      <Cost>0</Cost>
      <suppid />
      <suppname />
      <leadtime>0</leadtime>
      <matname>Y-355</matname>
      <plantloc>1111</plantloc>
      <date>2008-09-30T00:00:00</date>
      <orderqty />
      <warehouseloc />
      <unit>KG</unit>
      </Material>
    - <Material>
      <Item />
      <ItemName />
      <ReqQty>0</ReqQty>
      <AvailQty>1000.000</AvailQty>
      <Cost>0</Cost>
      <suppid />
      <suppname />
      <leadtime>0</leadtime>
      <matname>Y-352</matname>
      <plantloc>1100</plantloc>
      <date>2008-09-30T00:00:00</date>
      <orderqty />
      <warehouseloc />
      <unit>KG</unit>
      </Material>
      </ns1:mt_out>
      In this input file it is having multiple records. Based on the AvailQty, the input file should go to the webservice. If the condition AvailQty is !=0, the the input file should go to the java webservice or else it should go to the .net webservice. In BPM i have used switch step for this. if i give the input file structure like above it is going to the java webservice only. It is not entering to the esle part.
    Could you please help me out in this issue.
    Thanks & Regards,
    Leela

    Hi,
    Having had a look at these blogs:
    Illustration of Multi-Mapping and Message Split using BPM in SAP Exchange Infrastructure
    How to Split Message through BPM in 1:n scenario
    Transformation Step to Implement 1:n Splitting
    I think the best solution for your scenario is the following:
    In your BPM use a TransformationStep that does the multimapping N:1
    And then send the messages individually. You don`t need a Switch Step.
    You should have two Receiver determination.
    1.- File_server --> Integration Process.
    2.- Integration Process --> WebService.
    In the second RD, add two receiver Services (e.g. JAVA_WebService and NET_WebService) and
    use routing roules that checks if AvailQty is !=0. And depending on this condition,
    the message should be sent either JAVA_WebService or NET_WebService.
    Hope this helps you.
    Carlos

  • Used switch keeps booting to a company prompt no matter what

    Bought 3 used switches and they keep booting to a company prompt and wants a username. I have changed to register to 0x2142 and tried sticking a different ios flash disk in with no luck. System keeps booting to image even when booted from rommon flash image..
    Devices are sup32

    Good Article Rolando...it was exactly what I was eluding too...Aaron, on some Sup's there are two points in which you need to Ctrl+Break and set the Config Register to 0x2142 before it will bypass the configuration.  During your boot process, I see where it is saying...
    %OIR-6-CONSOLE: Changing console ownership to route processor
    ...and then its looks as if it starts to boot again, after you see console text
    System Bootstrap, Version 12.2(17r)SX3, RELEASE SOFTWARE (fc1)
    Technical Support: http://www.cisco.com/techsupport
    Copyright (c) 2004 by cisco Systems, Inc.
    Cat6k-MSFC2A platform with 524288 Kbytes of main memory
    Ctrl+Break and set your Confreg to 0x2142 there as well and you should be golden!  I deal with this on a daily basis, your Gear is good my friend, no worries! 
    One thing I would make sure is that you do this all in one boot sequence meaning you set both Confregs to 0x2142 in the same boot process of course Resetting in between each Confreg and after the second time let it boot completely and your good. 
    Oh yeh and you will only have to set the Confreg back to 0x2102 once.  Thanks!

  • Cannot connect to com1 using Switch Executive

    I have a PXI2530 configured using Switch Executive 2.10.  The first 60 Channels are setup with my signal names on ch0 - ch59.  Com0, 1, 2 and 3 are my Instrument connections.  The IVI Driver Sessions has Driver Setup set to Topology:2530/1-Wire Octal 16x1 Mux. 
    When I try to configure either a Channel, Route or a Group, there is only a com0 pin and no com1, 2, 3, 4, 5, 6 or 7.  There is no way to connect to any pin beyond ch15.
    The configuration looks like it is setup for a 128:1 mux, but when I try to connect ch16 to com0, it cannot complete the route.  Ch16 cannot be connected to com0 or any channel in the list.  Any idea what I am doing wrong?
    Michael Munroe, ABCDEF
    Certified LabVIEW Developer, MCP
    Find and fix bad VI Properties with Property Inspector

    Michael,
    What probably happened is that originally the NISE vd was created using the 128x1 topology. If the driver session is changed to another topology (like Octal 16x1 Mux) and saved the linked from the NISE vd and the old topology still exists until you close MAX and reopen it. When MAx opens it establishes a link between the NISE vd and driver session which remains in memory until MAX is closed and reopened.
    Guy Ferraro
    Switch Product Support Engineer
    NI - USA

  • I converted a heap of music using 'switch', when i try and add this music to library iTunes will not load it??

    i converted a heap of music using 'switch', now when i try and add this to library itunes will not load???

    Unless the MUST be AAC, try FreeWMAtoMP3Changer: http://www.wma-mp3.com/free-wma-to-mp3-converter/
    The ONLY caveat with it is: You CAN'T drag & drop files on it to open them. You MUST use the browse function to select them. If you drag and drop, it multiplies the output files. A 10 track album will produce 45 converted files.

  • How do I use switch and case statements to fill more than one other field?

    Hi all,
    I'm new to the community.
    I'm trying to make an existing form more user friendly for my coworkers. I want to use a switch and case approach in a drop-down list field so that the selection fills two seperate other fields with different info related to the selection.
    I can already do this with one field, but if I add a second target field under an existing case the text doesn't appear there when I make the selection from the dropdown.
    Basically, I'm asking if I can do this:
    switch 
    (sNewSel){
       case "1": // Selection 1    Row2.Field1
    = "text for field 1";
        Row1.Field2 = "text for field 2"; 
        break;
    etc.
    It works if the "row1.field2" option isn't there, but not when it is present.
    Any takers?

    I'm not sure if I will be able to send you the form. There may be too much to redact.
    Would this last bit of code in the cell affect anything?
    if 
    (bEnableTextField)
    {Row2.Field1.access
    = "open"; // enable field
    Row2.Field1.caption.font.fill.color.value= "0,0,0"; // set caption to black
    That is, do I also need to repeat the same thing for the second target cell (Row1.Field2)?
    What would be possible hang ups that would prevent it from working correctly?
    Dave
    By the way, I'm not sure if my other attachment posted. I am trying again.

  • Compiler error when useing switch statements in an inner class

    I have defined several constants in a class and want to use this constans also in an inner class.
    All the constants are defined as private static final int.
    All works fine except when useing the switch statement in the inner class. I get the compiler error ""constant expression required". If I change the definition from private static final to protected static final it works, but why?
    What's the difference?
    Look at an example:
    public class Switchtest
       private static final int AA = 0;     
       protected static final int BB = 1;     
       private static int i = 0;
       public Switchtest()
          i = 0; // <- OK
          switch(i)
             case AA: break; //<- OK, funny no problem
             case BB: break; //<- OK
             default: break;
      private class InnerClass
          public InnerClass()
             i = 0; // <- OK: is accessible
             if (AA == i) // <- OK: AA is seen by the inner class; i  is also accessible
                i = AA + 1;
             switch(i)
                case AA: break; // <- STRANGE?! Fail: Constant expression required
                case BB: break; // <- OK
                default: break;
    }Thank's a lot for an explanation.

    Just a though:
    Maybe some subclass of Switchtest could decalare its own variable AA that is not final, but it can not declare its own BB because it is visible from the superclass. Therefore the compiler can not know for sure that AA is final.

  • Help!!!! using switch

    Hello I'm using the switch statement and I have a problem.
    int x=10;
    switch(data) {
         case 2:
    break;
    case 3:
    break;
    case x:
    break;
    default:
    break;
    When i compile I'll recive this error
    "constant expression required" on case x;
    How can I solve this problem,
    Thank a lot.
    Diego

    switch(data) {
        case 2:
            break;
        case 3:
            break;
    /*case x: -- you can not use a variable as a case label.
    break; */
        default:
            if (data == x) {
            } else {
            break;
    }

  • Deploying Adobe Reader 9.1.2 and 9.1.3 silently using switches in Langard

    I am having problems deploying the patches to Adobe Reader 9.1.0 using Langard 9.0 Build 20090709.  I deployed 9.1.0 without any issues using this switch: sAll /rs /l /msi" /qb-! /norestart ALLUSERS=1 EULA_ACCEPT=YES SUPPRESS_APP_LAUNCH=YES"
    I have tried multiple switches with the .msp packages.  I end of getting a Windows installer pop-up with switch examples in them in XP and 2000, Interactive Services pop-up in VISTA.  The updates do not install.
    I chose install with alternative credentials and put in the domain admin and password.
    If anyone out there has a working deployment of these updates done completely silent in Langard or now we are even open to active directory options also.  We have too many machines to be doing these at each work station.  Also, since they do not have admin privileges, automatic updates are not the answer.  Really for any enterprise.  Thanks.

    I am having problems deploying the patches to Adobe Reader 9.1.0 using Langard 9.0 Build 20090709.  I deployed 9.1.0 without any issues using this switch: sAll /rs /l /msi" /qb-! /norestart ALLUSERS=1 EULA_ACCEPT=YES SUPPRESS_APP_LAUNCH=YES"
    I have tried multiple switches with the .msp packages.  I end of getting a Windows installer pop-up with switch examples in them in XP and 2000, Interactive Services pop-up in VISTA.  The updates do not install.
    I chose install with alternative credentials and put in the domain admin and password.
    If anyone out there has a working deployment of these updates done completely silent in Langard or now we are even open to active directory options also.  We have too many machines to be doing these at each work station.  Also, since they do not have admin privileges, automatic updates are not the answer.  Really for any enterprise.  Thanks.

  • How do I associate switches in a four layer relay tree using Switch Executive

    I have a three layer relay tree, controlled with a PXI-2567, to route an instrument input to 16 DUT channels. How do I create aliases in Switch Executive to turn the appropriate set of three relays on and off to route the input signal to one of the channels?

    Bob,
    Here is what you need to do to be able to call 2 end channels and create a route though 3 layers.
    1) You have to tell NISE how the independent relays are connected to each other. You will do that by creating Hardwires.
    2) You need to tell NISE that you want the channels connected to the hardwires to be used for routing. You will do that by marking the connected channels as "Reserved for Routing".
    3) You can name the end channels according to your topology. COM for the single input channel and CH0 to CH15 for the output channels by creating aliases.
    In the route editor, you will only need to create a route between COM and CHx and NISE will find the appropriate relays to close. In the route editor, if you only want to see the channels with an alias (COM, CH0, CH1 etc...) select in Options "Hide channels without aliases"

Maybe you are looking for

  • Why does my Yahoo and Facebook account keep resetting in the 2nd profile I created?

    I have 2 profiles, one for my wife and one for me. When either of us in on profile 2, our Yahoo and Facebook accounts keep logging us out. I was just on Facebook writing a response to a friend and I get a "Your not logged in" message pop up and it lo

  • Video in my flash presentation playing faster than the animation

    I have a flash presentaion that contains flvs, devided to chapters,everytime a video ends (chapter ends) a flash animation runs (like title changing,and thunmbnails changing). the prob i m having is that on a core2quad, animation is faster than video

  • How to Pay the difference amount after Change in Grade

    Hi, I have pay element which has global values for different grades. GRADE E = 10000 GRADE F= 15000 Payment for allowance is happening once in a year, but we need to pay the additional amount if employee is moved from grade E to F. But the change can

  • Use Logic Express as a Softsynth?

    Can Logic Express be used as a softsynth by other programs? I use Band in a Box and the Quicktime Instruments are not the best. I f I could route the BIAB midi out into LE I could use the software instruments and the synths that are in LE. Can this b

  • MacBook Pro, Win XP and Sleep

    Hey, I'm not sure if this is the proper topic for my question, but if it's not I will move it. Anyway, I have a MBP with Core 2 Duo with absolutely NO problems. It works fine and lasts a long time. I also have XP Pro installed via Bootcamp with, agai