Newbie Probs (IF conditions)

Hi
Can anyone tell me why when I input 1 it works, yet input 2 and it doesnt run the code for choice 2?
          if (option==1)
               while (callsPointer<6)
               System.out.print("Enter Reminder time (as int) ");
               intTime = EasyIn.getInt();
               System.out.print("Enter Text ");
               theText = EasyIn.getString();
               theReminder[callsPointer] = new Reminder(theText,
intTime);
               callsPointer ++;
          else if (option==2)
               //print call list
               for (int index=0;index<callsPointer;index++)
               System.out.print("Reminder state is: ");
System.out.println(theReminder[index].getAlarmTime().getFormattedTime()
               System.out.println(theReminder[index].isOn() );
               System.out.println(theReminder[index].getText() );
Thanks

the datatype of 'option' is int
i can change the value from 1 or 2 but somehow the 'IF' checks dont spot this.
I can change the first 'IF' loop to 2 and the second to 1, only the 'IF' for option=1 works, change it back and the same again but this time the other 'IF' loop works.
Its as though any other value than 1 is not detected

Similar Messages

  • Newbie Prob-Punch In

    How do I set up a track to puch in with a guitar solo and have it record on a separate track everytime it plays through. This way I can keep the best solo?

    No need to do this on separate tracks. Use the "Cycle Record" mode. To do this, go up to the top where the bar numbers are. Click and drag. It should highlight in green. The section that you highlight in green is the section that you will be recording over and overagin without having to hit stop and record.
    Matt

  • Newbie alert spry conditions question

    I am trying to use an XML dataset to draw data for my
    application pages. I have some XML fields, (in this case {helpurl}
    and {moreinfo} ) which may or may not have a value assigned to them
    in each record.
    My question is simple, but I can't find the answer... where I
    originally would write it this way in CF, what is the equivalent in
    CS3/Spry?
    <cfif (#helpurl# is not "")>
    <a href="#helpurl#">HELP</a>
    </cfif>
    <cfif (#moreinfo# is not "")>
    <a href="#moreinfo#">MORE INFORMATION</a>
    Thanks so much!!

    You need to use Spry:if like below
    <p> {Description} <a href="{Link}" target="_blank"
    spry:if="'{Link}' != ''">MORE..</a></p>
    Regards
    Phil

  • Creating filling panel with insets without gridbaglayout

    Hi,
    This is quite a newbie prob but i can't seem to get it right. I want a Panel with two panels. Both with insets. I want the first to only fill horizontally. The second has to fill-up the rest of the panel. Because Boxlayout and Borderlayout don't support insets with layout i tried the gridbaglayout, but i can't get the second panel to fill the remainder of the panel. It stops halfway.
    contentPane.add(one,
    new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0, GridBagConstraints.NORTH, GridBagConstraints.HORIZONTAL,
    new Insets(2, 2, 2, 2), 0, 0));
    contentPane.add(two,
    new GridBagConstraints(0, 1, 1, 1, 1.0, 1.0, GridBagConstraints.CENTER,
    GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));
    Can anyone tell me how to do this?
    Much thanks
    Hugo Hendriks

    You can use:
    panel.setBorder(BorderFactory.createEmptyborder(2,2,2,2));
    to set insets on a JPanel. I believe Insets is the "old" way of doing borders.
    Regards,
    Tim

  • Curious Palm Installer

    1. For several days I'd tried to d/l the Palm Desktop 4.2.1 file. I'd get the .sit file on the desktop and it would run, seemingly normally, but all I'd get would be an empty folder (showing 'No items').
    2. I ran through it several times, with the same results, and was unable to find any discussion about this anywhere. Earlier I happened to Info that empty folder and discovered that it was a bit over 20Mb in size.
    3. Spotlight showed an installer in that location, with an installer icon, and showed it as parked on the desktop and not in a folder. Running the .sit file a second time resulted in a second folder on the desktop and a second (.1) installer file showing up in Spotlight.
    4. I decided to try just running the installer from Spotlight, and it worked just fine. (NB — I'd had fairly typical newbie probs w/Spotlight but, after some researching and re-indexing, I'm starting to like it a lot more than I did at first. Other problems with Palm, prior to this update, were that quitting the app (or logging out, for that matter) would always yield one of the "The file .... has unexpectedly quit ...." splashscreens. That seems not to be happening with the new version, however.)
    5. Question, then, is why this happened? Specifically, is this pointing to some flaws in the OS/installation, or would it be more correct to point the finger of blame at that downloaded installation file? I've been doing a fair number of download & install runs and this has been the only notable glitch.

    Sounds like you've been bitten by a stuffit bug!
    http://support.allume.com/techsupport/forum/viewtopic.php?t=564

  • Conditional probes

    Hello everyone,
    I have a question regarding conditional probes. What conditions allow you to have a conditional probe. I have seen in some of my subvis that the condtional probes are not always available. See attached picture. I can have conditional probe on the output of one add function, but not the other. Why is this?
    thanks
    Attachments:
    conditional probe.PNG ‏204 KB

    Under "Custom Probe" you can normally see the list of the last Customized Probes you used. LabVIEW has a list of already defined Conditional Probes which are already programmed.
    You should go to "Custom Probe -> New... -> Create from existing Probe and choose the Probe (f.e. Conditional Double Probe.vi) you want to use. After choosing, the probe will appear directly by "Custom Probe".
    Regards
    Ken

  • Simple OR condition..but getting prob

    Hi all,
    Please help me
    I am trying to use simple OR condition in a where clause
    here is my script
    Select * from table 1
    where is_numeric(acct_no) = 0 --- is_numeric is function which returns 0 for non digit acc no
    or
    count_no in ( select count_no from table 1
    minus
    select count_no from table2)
    i dont knw why query is taking a long long time to run w/o out put itired to put braket also but didnt worked.
    i knw we can use union too but i dont want to use that.
    please help me ....
    Thanks
    Edited by: user10647455 on Dec 3, 2008 8:04 AM

    Hi,
    Like Jortri, I would use EXISTS.
    I suspect this way is faster:
    Select  *
    from    table1
    where   is_numeric (acct_no) = 0 --- is_numeric is function which returns 0 for non digit acc no
    or      NOT EXISTS
            (   select  NULL
                from    table2
                where   count_no = t1.count_no
            );There's no need to reference table1 in the sub-query. You already know count_no exists in table1: that's where you got it.
    Calling the PL/SQL function is taking considerable time. If you're only checking for simple types of numbers (such as unsigned integers) you can do that a lot quicker using SQL, especially regular expressions, as Blushadow and Michaels showed you in [your previous thread|http://forums.oracle.com/forums/message.jspa?messageID=3155232#3155232]. If you need to check for any possible number (such as '+1.4E-5') then you probably do need a function. The function may be faster if it is declared as DETEMINISTIC.
    Edited by: Frank Kulash on Dec 4, 2008 1:03 PM

  • Multiple condition prob

    Hi,
    I have one query regarding different condition. Suppose i have to one internal table itab.
    Now i read the data from vbak & vbap table. My parameters r p_vbeln, p_posnr.
    parameters: p_vbeln  LIKE  vbak-vbeln,
             p_posnr  LIKE  vbak-posnr.
    I have to select all records from table vbak for parameter p_vbeln.
    after it for each entry on table vbak select single on table vbap for the material. & store
    it into internal table itab.
    if only one entry exists on table itab check the entry matches the input parameters p_vbeln,
    p_posnr. If no match then generate error. If match then proceed.
    anybody will tell me how to write the logic for the above condition.
    thanks in advance.

    Why do you want to add a condition again. because
    select * into corresponding fields of table itab
      from vbap
      where vbeln in (
                select vbeln from vbak where vbeln eq p_vbeln )
        and matnr eq p_matnr
        and posnr eq p_posnr.
    if not sy-subrc is initial.
      "not match.
    endif.
    itab already has conditioned value.
    ibrahim
    ok i have changed the code.
    Message was edited by: Ibrahim UGUR

  • MP3 newbie - MuVo N200 Micro prob

    Hello. I'm new to MP3 players and got my N200 Micro at the weekend. When I first listened to the radio, that was fine, I could scroll through the other settings, and I copied some tracks straight from my CD player using line out without problem. However, despite setting up the software and disconnecting the N200 as instructed, tracks transferred from my pc don't copy properly - they stick at 0.00... and when I listen, I just hear clicking.
    The really worrying thing is that I've now lost all the functions - scroll doesn't work - and player won't even turn off unless I remove the battery!
    I've only used this once - for about hour - and I followed the instructions so I'm at a loss to know what's gone wrong. Have I got a duff machine? Is there something I can do, or should I get a refund?
    Help!
    ChrisC

    Thanks for the suggestion. Despite getting a message saying I already have this version, I've reloaded from the fw update link posted on this site. All I'm getting is the MuVo blue screen for approx minute and now the display reads 00.00.00 EN002 MP3 - pressing Scroll doesn't call up any options, eg Radio, and I still can't turn it off other than by removing the battery.
    I'd be v grateful if you can suggest anything - otherwise I'll be asking Amazon for a refund PDQ.
    Thanks.
    ChrisC

  • Newbie....with inst probes

    Hi,
    I've downloaded the java 2 SDK and J2SE
    to my windows XP system I've written a
    small program in my editor Problem is
    where can I compile my program? Where's
    XP:s commandline?
    Thanx in advance
    //Ylva

    On my XP system, it is Start Menu -> Programs -> Command Prompt.
    If Command Prompt does not show on your system, search for cmd.exe. You can create a shortcut to cmd.exe and put it in your Programs folder or on your desktop.

  • Newbie: Trashing an PSE9 icon on my desktop gives prob...

    before I begin.. please be patient, I am very new to Mac.. (I sometimes wish I had just bought a new PC) 
    I installed Photoshop Elements9 onto my Mac, I have the original file on my desktop, and I have it on my dock.. however when I try to trash the PSE on my desktop, (to keep my desktop clean) I have a problem using the PSE9 software, as soon as I get it back out of the trash, it works fine..
    Question: where do I put any software that I install.. I hope Im explaining it properly..   

    Hi,
    Not sure if this will work... but it's certainly worth a try...
    Delete the Icon you have in the Dock...
    Put your PSE9 into your Applications Folder...
    Then Drag the PSE9 Icon to the Dock from the Folder you have in Applications....
    See if that works...
    Does that make Sense...?
    http://support.apple.com/kb/HT3739
    http://www.apple.com/support/mac101/tour/

  • Error in conditional map using User Defined Function

    All,
    In my mapping I basically have a user defined function that returns the filename of my inbound file from the adapter-specific message attributes (file adapter).  I know this is coded properly because if I simply assign this function to my destination field I can see the filename in the payload XML.
    However if I conditionally check that returned value using if,then,else I get an error message stating:
    "During the application mapping com/sap/xi/tf/_MaterialData2ZcustProdMastMulti_ a com.sap.aii.utilxi.misc.api.BaseRuntimeException was thrown: RuntimeException in Message-Mapping transformation"
    Essentially in my if I'm checking if the value returned by my user defined function is equal to the constant "SOMECONSTANT" then I'm setting my destination field to some other constant value.  Otherwise it's equal to a different constant value.
    Any thoughts?

    Claus,
    Thanks for the help.  I actually had figured the problem out on my own.  Sorry for not updating the thread sooner.  What happened was this (as I suspected it wasn't related to my user defined function).  For the newbies out there (of which I'm one) the problem was I was comparing strings in the graphical mapping tool using the Boolean "EQUALS" rather than the Text "EQUALSS".
    Can you give yourself points for solving

  • Im a newbie in java and i need help. im a student

    im an I.T student in Adamson University here in the philippines i went here to ask help about our activity in school about java. our professor told us to make a program in java (btw were using netbeans) that will ask the user his birth year and then the output will tell the zodiac sign of the year entered. she told us (our prof) to make it using showInputDialog. and then to show the output we must use the JOptionPane.showMessageDialog.
    i try to do it but i found myself in trouble bcoz im new in java.
    i try to to it and here's what i did
    import javax.swing.JOptionPane;
    public class Zodiac;
    public static void main(String args[])
    String name=JOptionPane.showInputDialog("Enter your year of birth?");
    String message=String.format("Your zodiac sign is tiger");
    JOptionPane.showMessageDialog(null,message);
    i knew that i need to use conditional statements here but i dont know where to put it and how to declare the JOptionPane.etc.
    pls help me asap im a newbie.

    as you wish heres what i did. this is not a gui version
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    package marlonestipona;
    * @author ESTIPONA
    import java.util.Scanner;
    public class Main {
    public static void main(String[] args) {
    Scanner input = new Scanner(System.in);
    int yr1;
    String tgr ="Tiger";
    String dog ="Dog";
    String rbt ="Rabbit";
    String ox ="Ox";
    String drgn ="Dragon";
    String rat ="Rat";
    String pig ="Pig";
    String rst ="Rooster";
    String hrs ="Horse";
    String shp ="Sheep";
    String mky ="Monkey";
    String snk ="Snake";
    System.out.print("Enter your birth year: ");
    yr1=input.nextInt();
    if (yr1==1974 || yr1==1986 || yr1==1998)
    System.out.printf("Your zodiac sign is %s!\n",tgr);
    }else if (yr1==1982 || yr1==1994 || yr1==2006){
    System.out.printf("Your zodiac sign is %s!\n",dog);
    }else if (yr1==1975 || yr1==1987 || yr1==1999){
    System.out.printf("Your zodiac sign is %s!\n",rbt);
    }else if (yr1==1973 || yr1==1985 || yr1==1997){
    System.out.printf("Your zodiac sign is %s!\n",ox);
    }else if (yr1==1976 || yr1==1988 || yr1==2000){
    System.out.printf("Your zodiac sign is %s!\n",drgn);
    }else if (yr1==1972 || yr1==1984 || yr1==1996){
    System.out.printf("Your zodiac sign is %s!\n",rat);
    }else if (yr1==1983 || yr1==1995 || yr1==2007){
    System.out.printf("Your zodiac sign is %s!\n",pig);
    }else if (yr1==1981 || yr1==1993 || yr1==2005){
    System.out.printf("Your zodiac sign is %s!\n",rst);
    }else if (yr1==1978 || yr1==1990 || yr1==2000){
    System.out.printf("Your zodiac sign is %s!\n",hrs);
    }else if (yr1==1971 || yr1==1991 || yr1==2003){
    System.out.printf("Your zodiac sign is %s!\n",shp);
    }else if (yr1==1980 || yr1==1992 || yr1==2004){
    System.out.printf("Your zodiac sign is %s!\n",mky);
    }else if (yr1==1977 || yr1==1989 || yr1==2001){
    System.out.printf("Your zodiac sign is %s!\n",snk);
    } else
    System.out.println("Invalid");
    now my problem is how to turn this whole code into gui using those dialog boxes.

  • Multiple condition checking question

    Hi I have a newbie question -
    if ((temp == null) && (!temp.text.equals(""))) {
    statement;
    If temp really is null, would this give a compiler error? or would it simply break after the first condition?
    Thanks,
    Mike

    whatsupdoc wrote:
    Hi I have a newbie question -
    if ((temp == null) && (!temp.text.equals(""))) {
    statement;
    If temp really is null, would this give a compiler error?Compile it and see.
    I'm curious though what you're trying to accomplish. You seem to be confused about the meaning of &&.
    or would it simply break after the first condition?&& and || are "short-circuit" operators. They stop evaluating once the truth of the operation is known. So if the first operand to && is false, it stops there and does not evaluate the second, since the result of the && must be false, regardless of what the second operand is. Likewise, if the first operand to || is true, then it doesn't evaluate the second one, because the result is true regardless.

  • Return the value of a form field to WHERE condition in LOV SQL

    I'm an APEX newbie.
    I'm developing an APEX app using a form based on a dynamic report. The form opens when I click a record in the report, and uses an Automated Row Fetch process to populate the form with the selected record's values.
    I have included a few hidden fields on my form, which I want to act as conditions for the WHERE statements in related list boxes, in order to limit the number of list items. For example, I have a field P4_CONT_DEPT_ID, which contains a department number. I have a list box called P4_DIVISION_NAME, which I want to populate with only the devisions related to the current department #.
    Here is my List Of Values definition SQL for P4_DIVISISON_NAME
    SELECT CONT_DIVISION_NAME display_value, CONT_DIVISION_ID return_value
    FROM CONTACTS_DIVISION
    WHERE CONT_DIVISION_ID IN
    (select DEPT_DIVISION_XREF.cont_division_id from DEPT_DIVISION_XREF
    WHERE DEPT_DIVISION_XREF.cont_dept_id = :P4_CONT_DEPT_ID)
    GROUP BY CONT_DIVISION_NAME, CONT_DIVISION_ID
    ORDER BY 1
    Note that I refer to P4_CONT_DEPT_ID to limit the list. This query is not working. ALL values in the listbox's parent table are returned, not the ones specific to the dept id. If I hard code the dept id, it works fine. What am I missing here?
    I should mention that I'm using APEX 3.2. I know that creating dynamic list boxes is not going to be easy, even this first step is giving me fits! But I have to remain on this version. Any help on this would be greatly appreciated.
    Thanks!

    I figured it out. The bind variable substitution works as designed. It was just my head that wasn't working right.

Maybe you are looking for