Can't get dupe checking working

I'm currently making an inventory management system in java for college. The user enters a two letter combination (specified in a 2d array, the other side holds the full name for display purposes later). Now I also need to check whether or not the item number has already been entered. This is where I have a problem, it compiles fine but it just doesn't work at all. Here is the item number function, I know its something really small that I'm not seeing. Thanks for any help.
     public static void setItemNo()
          int index = 0;
          String item;
          error = true;
          do
               //get item number
               System.out.print("\n\t\tEnter an item number: ");
               item = TextIO.getlnString();
               item = item.toUpperCase();
               //checking for duplicate entries
               for (int dupeCheck = 0; dupeCheck == publicItemNumber.length; dupeCheck++)
                    if (item == publicItemNumber[dupeCheck])
                         System.out.print("\n\t\titem already entered");
                         dispmenu();
               //item length not equal to 5
               if (item.length() != 5)
                    //item length must be five, it isn't
                    System.out.print("\n\t\tPlease enter a vailid item number\n");
                    error = true;
               //passed error check, item number is 5 chars!
               else
                    error = false;
          }while(error == true);
          //now we check if the first two chars are actually letters
          found = false;
          String firstTwoCharacters = item.substring(0,2);
          while ((found == false) && (index < depts.length))
               if (depts[index][0].equals(firstTwoCharacters))
                    found = true;
                    publicItemNumber[counter] = item;
                    return;
               else if ((found == false) && (index < depts.length))
                    found = false;
                    index = index + 1;
          if (found == false)
               System.out.print("\n\t\tPlease enter a valid number!\n\n");
               return;
     }

In this line:
if (item == publicItemNumber[dupeCheck])Use ".equals" to compare the values. They are Strings. You do it correctly in the 'while' loop near the bottom.

Similar Messages

  • Have entrourage and want to use Mail. Can't get it to work.

    I had a macbook and purchased the Microsoft office for Mac which included Entrourage.
    I have now purchased a new macbook Pro and want to begin to use Mail rather than Entrourage. 
    I have Entrourage on my new computer but i can't get it to transfer my information to the the Mail program
    I am on Charter.net at my office and sbcglobal.net at home.
    How can i get this to work.  I can receive on Mail, but i can't send.

    check your outgoing port settings and make sure it's using a specific port and not the default port, also you might want to check to see if it is using SSL, TLS or any other encryption.  Verify the setting from your old machine setup.

  • I bought an IR receiver and an Apple Remote, and I can't get it to work. What am I doing wrong?

    I bought an IR receiver and an Apple Remote, and I can't get it to work. What am I doing wrong? The receiver is a Lenovo eHome OVU430006/01 USB IR Receiver.

    Hello,
    You would need to pair the Apple Remote with the receiver. So I would use the generic Mac/PC receiver and follow these instructions:
    http://support.apple.com/kb/HT1619
    If that doesn't work then check in System Profiler to see if the IR receiver has been recognized by the PowerBook's hardware. You may require the install of drivers for this device to be recognized.
    Best of luck

  • I have signed up for adobe conversion to microsoft word and i can't get it to work - can you help me

    I have signed up for adobe conversion to microsoft word and I can not get it to work -  can you help me?

    Hi Mike,
    I've checked your account. I see that you just purchased the subscription this morning. The order is still pending processing, which is why you haven't yet been able to log in an use your subscription. It can take 24-48 hours for a subscription to process fully. Once it does, you'll be able to log in and convert files.
    I apologize for the inconvenience.
    Best,
    Sara

  • Cisco 1812 wireles setup, can't get it to work

    Hello everyone,
    I've read trough the "871 wireless setup" topic, which I found very helpful, but I still can't get my wireless working. Basically I have a Cisco 1812W and I would like both wireless and wired to be on the same subnet. We aren't using DHCP, so the IP's are all static (even for the wireless clients). I can connect to my wireless SSID, but ping doesn't go trough either way. Wired connections are working fine. So the wireless client is connected, but has no IP address as far as the router goes (show Dot11 associations shows it's IP as 0.0.0.0) , but the wireless client does have an IP set up.
    I guess I'm overlooking something in my config, so here it is (i took out the firewall rules and aaa setup, they aren't relevant if i'm not mistaken and there's a limit to post size):
    ip cef
    ip tcp synwait-time 10
    no ip bootp server
    ip name-server <removed>
    ip name-server <removed>
    crypto pki trustpoint TP-self-signed-1358229530
    enrollment selfsigned
    subject-name cn=IOS-Self-Signed-Certificate-1358229530
    revocation-check none
    rsakeypair TP-self-signed-1358229530
    crypto pki certificate chain TP-self-signed-1358229530
    certificate self-signed <removed>
    quit
    username <removed>
    bridge irb
    interface Null0
    no ip unreachables
    interface FastEthernet0
    description $ETH-WAN$$FW_OUTSIDE$
    ip address extip extsubnet
    ip access-group 101 in
    ip verify unicast reverse-path
    no ip redirects
    no ip unreachables
    no ip proxy-arp
    ip nbar protocol-discovery
    ip flow ingress
    ip flow egress
    ip nat outside
    ip inspect sdm_ins_in_100 in
    ip inspect SDM_MEDIUM out
    ip virtual-reassembly
    ip route-cache flow
    duplex auto
    speed auto
    interface FastEthernet1
    no ip address
    no ip redirects
    no ip unreachables
    no ip proxy-arp
    ip route-cache flow
    shutdown
    duplex auto
    speed auto
    interface BRI0
    no ip address
    no ip redirects
    no ip unreachables
    no ip proxy-arp
    encapsulation hdlc
    ip route-cache flow
    shutdown
    interface FastEthernet2
    interface FastEthernet3
    interface FastEthernet4
    interface FastEthernet5
    interface FastEthernet6
    interface FastEthernet7
    interface FastEthernet8
    interface FastEthernet9
    interface Dot11Radio0
    description 802.11g
    no ip address
    encryption mode ciphers tkip
    ssid <removed>
    authentication open
    authentication key-management wpa
    guest-mode
    wpa-psk ascii 7 <removed>
    speed basic-1.0 basic-2.0 basic-5.5 6.0 9.0 basic-11.0 12.0 18.0 24.0 36.0 48.0 54.0
    station-role root
    bridge-group 1
    no bridge-group 1 source-learning
    no bridge-group 1 unicast-flooding
    interface Dot11Radio1
    description 802.11a
    no ip address
    shutdown
    encryption key 1 size 40bit 7 1ED10A3EC0C5 transmit-key
    encryption mode wep mandatory
    speed basic-6.0 9.0 basic-12.0 18.0 basic-24.0 36.0 48.0 54.0
    station-role root
    interface Vlan1
    description $FW_INSIDE$
    no ip address
    no ip redirects
    no ip unreachables
    no ip proxy-arp
    ip virtual-reassembly
    ip route-cache flow
    bridge-group 1
    interface BVI1
    ip address <internal router ip> <subnet>
    ip access-group 100 in
    ip nat inside
    ip virtual-reassembly
    ip route 0.0.0.0 0.0.0.0 <external router IP> permanent
    ip flow-top-talkers
    top 5
    sort-by bytes
    ip http server
    ip http access-class 1
    ip http authentication local
    ip http secure-server
    <bunch of static nats>
    <access rules>
    no cdp run
    radius-server attribute 32 include-in-access-req format %h
    radius-server vsa send accounting
    control-plane
    bridge 1 protocol ieee
    bridge 1 route ip
    line con 0
    line aux 0
    line vty 0 4
    access-class 102 in
    password 7 <removed>
    transport input ssh
    scheduler allocate 4000 1000
    webvpn context Default_context
    ssl authenticate verify all
    no inservice
    end

    Okay, I've somewhat figured it out. Apparently my WPA-PSK configuration doesn't work with the integrated Broadcom adapter found in the laptop I was testing it with.
    Either that or my WPA-PSK configuration is broken.
    I switched over to an open network with no encrpytion and everything works now.

  • My iPod Classic is seen by Windows but not by iTunes.  I have reset it, gone to disk mode and it won't show up in iTunes.  There appears to be music on it in a file called MUSICSAVE.  How can I get this to work with iTunes again?

    My iPod Classic is seen by Windows but not by iTunes.  I have reset it, gone to disk mode and it won't show up in iTunes.  There appears to be music on it in a file called MUSICSAVE.  How can I get this to work with iTunes again?

    1. Update iTunes to the latest version. Plug in your iPod. If iTunes still can't recognize it, then in iTunes in the top left corner click help> run diagnostics. On the box that comes up, check the last two things. Click next and it should identify your iPod.
    2. Click on your windows start menu. Type in "services". Click on it and when it pops up, on the bottom of it click on "standard". Now Scroll down to find "Apple Mobile Device" Right click it when you see it and click on "Start". When it has started, close iTunes and replug in your iPod and it should show up.
    3. Check the USB cable
    4 Verify that Apple Mobile Device Support is installed
    5. Restart the Apple Mobile Device Service and verify that the Apple Mobile Device USB Driver is installed.
    6. If you just want to add some photos, songs and movies from computer to your devices, you can use an iTunes alternative to do the job
    7. Check for third-party software conflicts.
    <Link Edited By Host>

  • Can't get iTunes to work with 2 User Accounts

    I've tried to find my specific problem on previous threads but it seems that each situation is just a little different. I have two user accounts on my family shared Windows XP Home edition PC. Last week I installed my son's iPod/iTunes using the install disc. I changed the default to C:\documents and settings\user1\My Documents. Life was good. Then I got an iPod of my own. I followed the same install as above only changed the path to user2's account. I went to iTunes and everything was working just fine for user2. The next time user1 tried to access iTunes on his desktop under his Windows user account, he said it just kept searching. (Windows error message with flashlight) He decided to pop the install disc in and see what happens. (yikes!) He took all of the defaults and left both users with nothing working. Infact at that point iTunes was still on the user desktops but only pages and pages of HTML code would display if you tried to launch iTunes. I deleted all traces of itunes and iPod I could locate and went through the same reinstall process as before. I was able to locate user 2's libary and everything worked fine. (That's mine) Poor user1,(my son) we can't get anything installed to his user. The install disk recognizes only my installation and wants to remove everything first. I;ve done that a few times and still can only get user 2 working but not both.

    hi Mommatron!
    just checking on something. have you ever had any error messages at any stage of proceedings?
    b in particular,
    have you ever had an 0x80040707?
    love, b

  • HT1203 i have tried this 6+ times to "How to share music between different accounts on a single computer" on my wifes mac and can not get it to work!! On my PC no problem but on the MAC it will not work, follow the instructions to the T but no go????

    i have tried this 6+ times to "How to share music between different accounts on a single computer" on my wifes mac and can not get it to work!! On my PC no problem but on the MAC it will not work, follow the instructions to the T but no go????

    It is almost as if the program does not exist on my computer. If I search for it, the only thing that comes up is the installer. I cannot find it anywhere despite the fact I have installed it numerous times, uninstalled it and conducted a fresh install, and the Adobe website checks says that it is installed.

  • Sync with k750i? can't get it to work. anyone else?

    followed instructions from oracle for s700/k700 and i still can't get it to work. works fine on nokia 9300. anything specific i need to know? thanks!

    Yep I have the same problem. Is ther a log we can check out... I have tried to get an answer on this for a long time. but no answers.
    Please help her.

  • I purchase the Forms plus,  bywidgets.mu, and can't get it to work.  any help?

    I purchase the Forms + bywidgets.mu
    I've followed the directions on the weblink (https://widgets.mu/se/FormsPlus/demo/)
    and still can't get anything to work.
    I just keep getting <> inside a box and that's it.
    Help please!

    Hi Lisa,
    Do you have a URL where I can take a look at the issue? It may be a configuration issue or it may be a bug so I just want to check and make sure.
    In terms of the radio buttons one, I just published up update to the Forms+ Widget this morning that includes a new way to do grouping for radio buttons. Creative Cloud should download the updated version of the .mulib file into your downloads folder (and it should now be called something like FormsPlus Bundle.mulib), and you can double click that to add the updated widgets to your Muse library. The one I'm referring to in particular is called the "Radio Group (Box Selection)" widget. Basically, when you drag the widget out onto the page, it shows a dotted line box and you simply drag and resize the box around the radio items you'd like to group together. The box itself won't be exported so you don't have to worry about that, but it will allow you to visually group them instead of doing so with labels.
    Let me know if you have any trouble getting the new update or using the box selection widget and I'd be happy to help further.
    Thanks,
    Andrew

  • Help!! Can't get BeforeReport to work

    I am in desperate need of help - I have tried opening an SR and I was told using parameters was a customization and I needed to hire a consultant. I also tried to email my instructor from my XML Publisher class but she told me to check the user's guide....which I have done and to no avail. In fact, I have copied exactly based on the sample data template from the users guide to what I have and I still get an "Invalid Relational Operator".
    I have to get this report published but can't get it to work - I will be happy to email or post my template and package body but need anyone's help who is willing to give it. I am sorry to sound so desperate but I am!!!
    Thanks SO much!!!
    Rob

    Thanks so much Tim!
    My template is as follows:
    <?xml version='1.0' encoding='utf-8'?>
    <dataTemplate name='servicerecord' description='Employee Service Record' defaultPackage='gisd_xml_pkg' version='1.0'>
    <parameters><parameter name='p_emp' dataType='number' ></parameter></parameters>
    <dataQuery>
    <sqlStatement name="Q1"><![CDATA[select pac.segment1,
    pac.segment2,
    pac.segment3,
    pac.segment4,
    pac.segment5,
    pac.segment6,
    pac.segment7,
    pac.segment8,
    pac.segment9,
    pac.segment10,
    pac.segment11,
    pac.segment12,
    pac.segment13,
    pp.date_from,
    pp.date_to,
    pp.EMPLOYEE_NUMBER,
    pp.last_NAME,
    pp.first_name,
    pp.middle_names,
    pp.national_identifier
      from per_analysis_criteria pac,
           (select ppf.person_id,
                  ppf.first_name,
                  ppf.middle_names,
                  ppf.NATIONAL_IDENTIFIER,
                   ppf.EMPLOYEE_NUMBER,
                   ppf.last_name,
                   ppf.effective_start_date,
                   ppa.analysis_criteria_id,
                   ppa.date_from,
                   ppa.date_to
              from per_all_people_f ppf, per_person_analyses ppa
             where ppf.person_id = ppa.person_id
             and trunc(sysdate) between ppf.effective_start_date and ppf.effective_end_date) pp,
           PER_SPECIAL_INFO_TYPES_V psit
    where pp.analysis_criteria_id = pac.analysis_criteria_id
       and psit.id_flex_num = pac.id_flex_num
       and psit.name = 'GISD Employee Service Record'
       and &p_dynamic_where_clause]]></sqlStatement>
    </dataQuery>
    <dataTrigger name='beforeReport' source='gisd_xml_pkg.beforeReport'/>
    <dataStructure>
    <group name='G_EMPLOYEE' source='Q1'>
    <element name='LAST_NAME' value='LAST_NAME'/>
    <element name='FIRST_NAME' value='FIRST_NAME'/>
    <element name='MIDDLE_NAME' value='MIDDLE_NAMES'/>
    <element name='SSN' value='NATIONAL_IDENTIFIER'/>
    <element name='DATE_FROM' value='DATE_FROM'/>
    <element name='DATE_TO' value='DATE_TO'/>
    <element name='SCHOOL_YR' value='SEGMENT1'/>
    <element name='POSITION' value='SEGMENT2'/>
    <element name='YR_OF_EXPERIENCE' value='SEGMENT3'/>
    <element name='PERCENT' value='SEGMENT4'/>
    <element name='NO_OF_DAYS' value='SEGMENT5'/>
    <element name='ST_SK_PYB' value='SEGMENT6'/>
    <element name='ST_SK_EARNED' value='SEGMENT7'/>
    <element name='ST_SK_USED' value='SEGMENT8'/>
    <element name='ST_SK_EYB' value='SEGMENT9'/>
    <element name='ST_PERS_PYB' value='SEGMENT10'/>
    <element name='ST_PERS_EARNED' value='SEGMENT11'/>
    <element name='ST_PERS_USED' value='SEGMENT12'/>
    <element name='ST_PERS_EYB' value='SEGMENT13'/>
    </group>
    </dataStructure>
    </dataTemplate>
    My package:
    CREATE OR REPLACE package APPS.gisd_xml_pkg as
    function beforeReport return boolean;
    p_emp number;
    p_dynamic_where_clause varchar2(4000);
    end gisd_xml_pkg;
    My package body:
    CREATE OR REPLACE package body APPS.gisd_xml_pkg as
    function beforeReport return boolean is
    begin
    if p_emp is not null
    then
    p_dynamic_where_clause:= 'pp.employee_number = p_emp';
    else
    p_dynamic_where_clause:= '1=1';
    end if;
    return(TRUE);
    end;
    end gisd_xml_pkg;
    My SR number is 6367551.993
    Rob

  • Can't get firefox to work

    i can not get firefox to work on my computer with windows xp it worked once before but it won't work at all now i even unistalled it and re- installed it and still nothing could u please help me with this issue .

    Boot the computer in Windows Safe Mode with network support (press F8 on the boot screen) as a test.
    *http://www.bleepingcomputer.com/tutorials/how-to-start-windows-in-safe-mode/
    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem.
    *Switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance
    *Do NOT click the Reset button on the Safe Mode start window
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes
    If you do not keep changes after a restart or otherwise have problems with preferences, see:
    *http://kb.mozillazine.org/Preferences_not_saved

  • Can't get Java to work in IE 6!

    I downloaded and installed the file jre-1_5_0_01-windows-i586-p-iftw.exe and couldn't get java to work on websites that used it. So I tried to install it again and got the message "You already have this version of the JRE installed. Please uninstall the product through your add/remove programs utility before reinstalling." followed by "The Wizard was interrupted before J2SE Runtime Environment 5.0 Update 1 could be completely installed...".
    So I went into Control Panel --> Add or Remove Programs --> J2SE Runtime Environment 5.0 Update 1. I clicked to remove the program and eventually got the message "Fatal error during installation." Then I tried going into Control Panel and click the Java coffee mug icon. Nothing happened when I did that -- no Java console/panel or anything.
    So basically I can't get it to work and now I can't even remove it. In Internet Explorer --> Tools --> Internet Options --> Advanced I have the box checked beside Use JRE 1.5.0_01 for <applet> (requires restart). But when I go to Tools --> Sun Java Console, nothing happens.
    Can anyone help me out???

    Welcome to the wonderful world of Windows...
    In your user folder (c:\documents and settings\somewhere in there) you will find a java folder. Try removing that and then reinstalling the JRE through the java.com website.

  • Can't get netcfg2 to work

    hey guys, I can't get netcfg2 to work on my machine... really annoying upgrade check this:
    [network.d]% diff examples/wpa.example home
    1,2c1,2
    < CONNECTION="wireless"
    < INTERFACE=wlan0
    > CONNECTION="home"
    > INTERFACE=eth1
    5,6c5,6
    < ESSID="mynetwork"
    < KEY="SomePasskey"
    > ESSID="Lebowski"
    > KEY="foobar"
    [network.d]% sudo netcfg2 home
    > home is not a valid connection, check spelling or look at examples
    Any ideas? Also, why do I have to specify CONNECTION="foo"? the filename is enough to get the name, no?
    chris
    Last edited by delmonico (2008-03-28 17:54:41)

    I can't get work netcfg2...
    if I run
    iwconfig wlan0 essid SpeedTouch5F3851 enc open s:LesPiTTareL
    it works great, I can connect to my wireless network but...
    if I configure my /etc/network.d/celadina in this way:
    CONNECTION="wireless"
    DESCRIPTION="Connessione wireless casa Bergamo"
    INTERFACE=wlan0
    ESSID=SpeedTouch5F3851
    KEY=LesPiTTareL
    SECURITY=wep
    IP="static"
    IFOPTS="192.168.1.70 netmask 255.255.255.0"
    GATEWAY=192.168.1.254
    and running
    netcfg2 celadina
    I get this error message
    :: celadina up - Could not set wireless configuration [FAIL]
    [root@Arials skioppetto]# "Set Encode" (8B2A) :
    SET failed on device wlan0 ; Invalid argument.
    I think the error is in SECURITY but I can0t find a solution... I've tried also with IWOPTS and if I don't
    define SECURITY it doesn't give any errors but it can't connect becouse key remains off
    I use rt61 wireless module; when I connect trough the first way I don't get any wep modules loaded even if it works...
    I think the problem could be the kernel module.
    What do you think about?

  • Can't get X to work properly (ATI AIW 9800)

    Hello,
    I have a few problems. My first problem is this. The dpi was messed up when i first install, so i thought no big deal, I'll just go and configure the defaultserverargs setting in the startx script to "-dpi 75". This does not seem to work. Secondly,I can't get gnome to work as my default window manager. I put this line in my .xinitrc file in my home directory:
    exec gnome-session
    I also tried this:
    exec /opt/gnome/bin/gnome-session
    My last problem is that when i try to install the ati fglrx drivers with the stock kernel arch package but whenever the fglrx module is called, it says that the module doesn't exist. One thing i might mension which might be of importance is that i compiled a custom kernel during install without SMP and preemtivity so i could use my rt2500 wireless card. Thanks in advance for the help
    cheers,
    -Lukas

    sinisterguy:  You're going to need to build your own kernel module, afaik you can't just symlink a module built for another kernel and expect it to work.
    As root, run
    abs
    Once that's done (it'll check out a bunch of stuff from cvs), change to your normal user and either make a directory for the new package, or cd to some temp directory, then:
    cp /var/abs/extra/modules/ati-drivers-arch/* .
    vim PKGBUILD
    then make the following changes:
    pkgname=ati-drivers-arch
    to
    pkgname=ati-drivers-custom
    (or whatever you want to call the package)
    depends=('ati-drivers' 'kernel26')
    to
    depends=('ati-drivers')
    source=(https://a248.e.akamai.net/f/674/9206/0/www2.ati.com/drivers/linux/fglrx_6_8_0-$pkgver-1.i386.rpm fireglcontrol.desktop)
    to
    source=(http://www2.ati.com/drivers/linux/fglrx_6_8_0-$pkgver-1.i386.rpm fireglcontrol.desktop)
    (for some reason I can never get the source from the https address through makepkg.)
    and
    _kernel=2.6.15-ARCH
    to
    _kernel=`uname -r`
    Save and quit, then run
    makepkg
    - this'll make you a brand new kernel module package that you can install with
    pacman -A ati-drivers-custom-8.22.5-2.pkg.tar.gz
    You'll need to update this package every update to the ati-drivers in the same way you originally built it.
    If you need more information, ABS is a good place to look, as well as man makepkg. 
    </abs tutorial>

Maybe you are looking for

  • Retrive Multiple Records Into A database Block

    hi, all i would like to know if there is any document or references wich illustrait the way of retriving Multi records from a procedure built on database side into a database block using form 6i ?? My Problem is : i create a procedure in the database

  • InDesign CS6 / CC crashing on Launch

    InDesign is a crashing monster in CS5, so I figured CS6 (CC) would perhaps solve some serious issues.  It crashes on launch on OS X 10.8.3 - doesn't even need to be opening a document.  Tried clearing caches and preferences - doesn't matter.  Running

  • Defaults Roles Doubt - GRC 10.0

    Hi All, I have a query regarding default roles in GRC. In the role search screen when the user selects a role, there will be a defaults roles column which shows all existing defaults roles for different systems maintained in GRC. Actually our client

  • Attachments in MS word document in Pages

    I would like to open a word document containing excel and pdf attachments embedded in this word document using Pages for iPad. Would I be able to open these excel and pdf attachments in Pages?

  • SOLARIS 8 SPARC: Find command 64bit-version

    Hi to all. I have this situation: find / -name xyz -print Value too large for defined data typeOn the newsgroups I read: "That can occur if you run a 32-bit application on a file whose timestamp does not fit in a 32-bit time_t. To work around the pro