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;
}
Similar Messages
-
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 -
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,
AshviniI got the solution
Thanks anyways
Regards,
AShvini -
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,
MohammadHi 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?
WayneHi 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 -
Need help about switch & case statements
Dear friends
I am new student of Java
Our University gave us project to make a program. Here is the program:
a- Write a java program ,so the user can input the monthly salary then compute the net salary of an employee after deducting the tax ,use the following table to calculate the tax .Note use switch statement .
Annual salary Tax
100- 999 0
1000- 1999 5%
2000- 3999 7%
4000- 7000 10%
7000 13%Please help me how could I use switch statement.
All I know about switch statement is that I have use Integers for selection.
Kindly help me. I have only 2 days to submit my assignment.
Thanks in Advance
Edited by: syedejaz on Aug 13, 2008 8:09 AM
Edited by: syedejaz on Aug 13, 2008 8:10 AMHello every body:
I tried to make my first program using if then else but the problem is that no calcuation is happinig
/* TMA01 ITC250, Part-III, a
Program which gets input monthly salary and shows net salary after deducting given tax.
File: netSalary.java
import javax.swing.*;
import java.text.*;
public class netSalary {
public static void main(String[] args) {
int Salary=0,Tax=0,monthlySalary=0;
monthlySalary= Integer.parseInt(JOptionPane.showInputDialog(null, "Enter Monthly Salary:"));
if ((monthlySalary>=100) && (monthlySalary<=999)) {
Tax = (monthlySalary*(0/100));
Salary = (monthlySalary-Tax);
JOptionPane.showMessageDialog(null, "Net Salary is:" +Salary);
} else if ((monthlySalary>=1000) && (monthlySalary<=1999)) {
Tax = (monthlySalary*(5/100));
Salary = (monthlySalary-Tax);
JOptionPane.showMessageDialog(null, "Net Salary is:" +Salary);
} else if (monthlySalary>=2000 && monthlySalary<=3999) {
Tax = (monthlySalary*(7/100));
Salary = (monthlySalary-Tax);
JOptionPane.showMessageDialog(null, "Net Salary is:" +Salary);
} else if (monthlySalary>=4000 && monthlySalary<=7000) {
Tax = (monthlySalary*(10/100));
Salary = (monthlySalary-Tax);
JOptionPane.showMessageDialog(null, "Net Salary is:" +Salary);
} else {
Tax = (monthlySalary*(13/100));
Salary = (monthlySalary-Tax);
JOptionPane.showMessageDialog(null, "Net Salary is:" +Salary);
} The tax is not detuting. please tell me the mistake
Edited by: syedejaz on Aug 13, 2008 2:49 PM -
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,
LeelaHi,
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 -
Help using jar file!
Hello
I have created a jar file by using
jar cvmf Manifest.txt myjar.jar 1.class Mydirectory
In 1.java file :I have used
JEditorPane editor;
editor.setPage(getClass().getResource("/Mydirectory/default.htm"));
If I am only giving myjar.jar file to the client without Mydirectory then also it is working fine by showing default.htm in JeditorPane.
But my problem is I want to use
Runtime.getRuntime().exec("cmd /c start IEXPLORE"+targetstr) ;
targetstr will be the filename with path of the default.htm
If I am giving myjar.jar file with Mydirectory to the client it is working but I don't want to give Mydirectory to the client .
What should I do?
Is there any solution for this?
Using another jar file which will include mydirectory can solve this problem?
Is there any othe concept in java so that I wll be able to hide Mydirectory from client?
Please help.It seems like you could extract the .htm file from the jar, either with Runtime.exec or using the Jar API classes.
-
Help using file sharing with different users accounts on same Macbook
Hi, I just wanted a little help using the file sharing option. My wife and I had different users accounts on the same MacBook, but when I am trying to share my baby's picture from my documents folder for my wife to have the same picture, I can't find the way to do that; I am not been able to find my pictures on my wife's account. Is there any way that I could share a folder from my account and my wife to have the same files at the same time on her account?
I mean, something like the smart play list on the itunes?
Thank youYou can't do that directly unless you change permissions on your whole Documents folder which is not a good idea. Your wife can see your Documents folder from her account by going to Users/yourusername/Documents. However, this folder has no read privileges for others except yourself by default so she won't be able to open it.
rather than changing permissions on your Documents folder, you can place the pictures you want to share in Public folder in your home directory or in Users/Shared folder. -
How to assign search help using ovs for select options for ALV in web dynpr
how to assign search help using ovs for select options for ALV in web dynpro
Hi,
refer http://wiki.sdn.sap.com/wiki/display/WDABAP/InputhelpofObjectValueSelectioninWDABAP
http://www.****************/Tutorials/WebDynproABAP/OVS/page1.htm
and http://wiki.sdn.sap.com/wiki/display/Snippets/WebDynproAbap-OVSsearch+help
Thanks,
Chandra -
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 Inspectorhttp://forums.ni.com/ni/board/message?board.id=320&message.id=633
Duplicate threadMessage Edited by Berto on 02-28-2006 12:15 PM -
How to create Search Help using more than 1 table
Hi all,
I need to create a search help using more than 1 table.
Eq:- Itable1 contains the data and Table2 contains the description of a field.
In my search help i require A field from Table1 and For the corresponding field description from Table2.Hi,
You can do this with the help of collective search help.
Collective search helps:- Combination of elementary search helps. When we need to fetch data based on multiple selection criteriau2019s. More than one tables are Selection from multiple tables
Steps for creating collective search help.
1) Enter the search help name and click on create.
2) Choose Collective search help radio button option as the search help type.
3) Enter the search help parameters.
Note that there is no selection method to be entered for a collective search help.
4) Instead of the selection method, we enter the included search helps for the collective search help.
5)We need to assign parameters for each of the included search helps.
6) Complete the parameter assignment by clicking on the push button.
7) Collective search help offers the user to obtain F4 help using any of the included search helps.
Hope this will help you:
Reagrds:
Alok -
Just brought a ipad2 need some help using it.
Need some help using ipad2
Also, Good Instructions http://www.tcgeeks.com/how-to-use-ipad-2/
Apple - iPad - Guided Tours
http://www.apple.com/ipad/videos/
Watch the videos see all the amazing iPad apps in action. Learn how to use FaceTime, Mail, Safari, Videos, Maps, iBooks, App Store, and more.
You can download this guide to your iPad.
iPad User Guide for iOS 5
http://itunes.apple.com/us/book/ipad-user-guide-for-ios-5/id470308101?mt=11
Cheers, Tom -
I need helping using iAds in my application.
I need helping using iAds in my application. I currently am not using any storyboards. I am using Sprite builder for my UI.
I attatched an image ot show all the different file name I have.
Everyone is being used & they all work fully.
The "iAdViewController.h & .m" files are just example codes I looked up and was messing with so that my iAd can work.I wouldn't even be able to use the Mathscript node in an executable?
What I am trying to do is make a user configurable data stream.
They tell me how many bytes are in the stream and what parameters they
want to be put in to it. Currently I have to make vi's that are
called dynamicaly to make the parameters. Then recompile
the code and send it to them. This is somewhat of how the config
file is set up so I know how to make the data.
Data_Type foo
Bytes 30
parameter_name
function
byte# format
sync
foo_sync
29 int
time
foo_time
1,2,3,4 double
If I can't use MathScript to allow the user to make there own functions
is there another way that I might be able to do this so I do not have
to recompile the code atleast? Were I might just be able to make
the new function and send that to them.
Any Idea would be great. -
Help, used ipod will lock up mitunes when I try to add songs from library will stop after 20-30- songs How do I fix this?
Need more info to be of any assistance
Which version of iTunes are you using?
What is the iPod Software version as shown in the iTunes summary page?
Which model of iPod classic are you using?
Maybe you are looking for
-
My phone signs in OK with iCloud, and iCloud syncs the calendar etc. OK, but FindMyPhone app does not work. It is iinstalled and logs in to iCloud OK, but iCloud shows 'no devices'. I've uninstalled/reinstalled several times with no change. The ph
-
How to burn data CD/DVD that opens to the first level of folders?
I want to burn a data disc (with Toast if possible) that automatically opens up to the first level of folders with no toolbar when inserted.
-
Lightroom will not accept caches on different drives for multiple catalogs on different drives
I have three catalogs: one for my work files, one for botanical pictures (>200,000 pictures on a network drive) and one for everything else (about 90,000 pics). (i have been forced into this because the keyword files for each set are very large and
-
Problem when setting cursor position property
I'm trying to use property nodes to set the cursor position programmatically, following an arrow keypress. When my actual data file plotted, the position assignment doesn't work properly. If I clear the data from the graph (right click, clear graph
-
I don't want a discussion. I want support from Adobe. Can someone from Adobe assist or do they just not support users?