Matrix code help

Experts,
code written
Dim str As String
Dim omat As SAPbouiCOM.Matrix
Dim recset As SAPbobsCOM.Recordset
str = "Select *from [@TableName] where  Code='" & FieldName& "'"
  recset.DoQuery(str)
omat = objform.Items.Item("mtx_0").Specific
                        If recset.EoF = False Then
                            While recset.EoF = False
                          omat.Columns.Item("1").Cells.Item(omat.VisualRowCount).Specific.value = recset.Fields.Item("U_Field1").Value
                          omat.Columns.Item("2").Cells.Item(omat.VisualRowCount).Specific.value =  recset.Fields.Item("U_Field2").Value
                            End While
                        End If
                        omat.AddRow()
But this is not giving correct value in loop, it is going on and epeating
How to write loop correctly in matrix

Hi,
Try This.....
   Dim str As String
                Dim omat As SAPbouiCOM.Matrix
                Dim recset As SAPbobsCOM.Recordset
                 str = "Select *from @TableName where Code='" & FieldName& "'"
                recset.DoQuery(str)
                omat = objform.Items.Item("mtx_0").Specific
                If recset.RecordCount > 0 Then
                    While recset.EoF = False
                        omat.Columns.Item("1").Cells.Item(omat.VisualRowCount).Specific.value = recset.Fields.Item("U_Field1").Value
                        omat.Columns.Item("2").Cells.Item(omat.VisualRowCount).Specific.value = recset.Fields.Item("U_Field2").Value
                        recset.MoveNext()
                    End While
                End If
                omat.AddRow()
Thanks
Shafi
Edited by: shafi_sunshine on Sep 17, 2011 9:41 AM

Similar Messages

  • Flash Matrix Code Tutorial Help Needed

    Please could someone help me out with this Flash problem, I would really appreciate it.
    I have followed the guide at this link to create a matrix code effect. The matrix code font file is available to download from this site also (mCode15).
    Once I get this file up and running and understand how it works, I'm going to tweak it somewhat to suit my needs.
    I am, however, experiencing some problems getting it to work as described in the tutorial. I have followed the tutorial to the letter, but when the flash movie file runs, only the glyph symbol that I used to create the_one and one_pod movie symbols is displayed in the code that scrolls down screen. I have embedded the font the way it describes and even added it to the library and set it to export for actionscript using the linkage option. But the matrix code that rains down is still only one symbol which never changes.
    Please please help me out with this as I'm slowly losing my sanity trying to figure it out. I am using Flash CS3 on a PC to do this and the file is set up up as action script 2.0.

    hi
    try asking in the AS2 forum; they will be better placed to help you - and post some of your code too rather than a link (you cant expect us to do all the work for you )

  • Matrix Code Tutorial Help Needed - Symbols wont change

    Please could someone help me out with this Flash problem, I would really appreciate it.
    I have followed the guide at this link to create a matrix code effect. The matrix code font file is available to download from this site also (mCode15).
    Once I get this file up and running and understand how it works, I'm going to tweak it somewhat to suit my needs.
    I  am, however, experiencing some problems getting it to work as described  in the tutorial. I have followed the tutorial to the letter, but when  the flash movie file runs, only the glyph symbol that I used to create the_one and one_pod movie symbols is displayed in the code that scrolls  down screen. I have embedded the font the way it describes and even  added it to the library and set it to export for actionscript using the  linkage option. But the matrix code that rains down is still only one  symbol which never changes.
    Please please help me out with  this as I'm slowly losing my sanity trying to figure it out. I am using  Flash CS3 on a Windows 7 PC to do this and the file is set up up as action script  2.0.
    Many thanks for any help you can provide.
    The Action Script code from the site is included below, this is pasted into the 1st frame.
    // ---------------------------------------------// The Flash Matrix - www.pixelhivedesign.com// ---------------------------------------------// Initialize variables.maxLines = 25;  // Maximum number of lines at once.
    minScale = 10;  // Minimum scale of a line.
    maxScale = 100; // Maximum scale of a line.
    // Create an empty Movieclip to hold the Matrix.theMatrix = createEmptyMovieClip('MatrixCode',1);curLines = 0; // Keeps track of the current number of lines.
    // ----------------------// Generating the Matrix.// ----------------------theMatrix.onEnterFrame = function(){
    // Check that the current number of lines is less than the maximum allowed.
    if(curLines <= maxLines){
    curLines++;  // Increment the number of lines.
    // Create a new line.codeLine   = this.createEmptyMovieClip('codeLine',curLines); // Generate a random scale for the line.// This simulates lines at different distances.
    var ranScale  = Math.round(Math.random() * (maxScale-minScale)) + minScale;codeLine._xscale = codeLine._yscale = ranScale; // Position the line at a random X location.codeLine._x = Math.random() * Stage.width; // Determine line speed based on the distance.codeLine.speed = (codeLine._xscale)/10; // ---------------------------------------------// Creating a line of multiple pods (characters)// ---------------------------------------------codeLine.myCodes = []; // Array to store individual pods.
    numPods = 0;       // Number of pods.
    while(codeLine._height < Stage.height){
    numPods++;  // Increment the number of pods.
    // Attach a single pod to the line of code.pod = codeLine.attachMovie('one_pod','pod'+numPods,numPods);codeLine.myCodes.push(pod);   // store pod.
    // Position pod above the last one (vertical lines)pod._y -= (pod._height+2) * numPods; // Choose a random Matrix character.// Character Codes for lower case letters are between 96 & 123pod.the_one.Neo.text = chr(Math.round(Math.random() * 27) + 96);} // ----------------------------// Initialize the white pulse.// ----------------------------// Store pod position to start at.codeLine.ind = 0;// Store delay between pulses.codeLine.delay = codeLines.myCodes.length; // ------------------------------------// Animating each line of code.// ------------------------------------codeLine.onEnterFrame = function(){
    // -------------------------------// Vertical animation of the line.// -------------------------------// Every frame make the line move down by it's speed.
    this._y += this.speed; // Check if the line of code has animated off the Stage
    if(this._y - this._height >= Stage.height) {
    // Yes, so allow an additional line to be generated.maxLines++;// Remove this line and free memory.
    this.removeMovieClip();}// ----------------------------// Animating the white pulse.// ----------------------------// Get next pod to affect.
    this.curCode = this.myCodes[this.ind];// If the pod is not currently animating, start its animation.
    if(this.curCode._currentframe == 1) this.curCode.play();// Check if we have reached the end of the line.
    if(this.ind < this.myCodes.length and this.delay != 0){
    // No, then move on to next character.
    this.ind++;// Decrease the delay before next pulse.
    this.delay--;
    } else {
    // Yes, then reset the character position.
    this.ind = 0;// Reset the delay before next pulse.
    this.delay = this.myCodes.length;}}}}

    When you dynamically add content, it has no home on the timeline unless you anchor it in one.  If you were to manually place an empty movieclip on the timeline in the lowest layer and then and then create the matrix stuff in there then you would have it living in the background.
    Try creating such a movieclip, located in the upper left corner of the stage and assign it an instance name of "theMatrix"
    Then remove the following lines from your existing code (which is otherwise creating that mc dynamically)...
    // Create an empty Movieclip to hold the Matrix.theMatrix = createEmptyMovieClip('MatrixCode',1);
    That should be all you need to do.

  • Survey creation abap code help needed

    hello experts,
    I need to create a survey in crm, by taking values from end-user from a webpage
    A sample code help is needed.
    Thanks in advance

    Take a look at this SAP note - It does a pretty good job of detailing the steps for you.  No coding necessary, it worked out of the box for us after patching this note.
    https://service.sap.com/sap/support/notes/638320

  • Inquiring minds may find this error code helpful: 0x207

    Hopefully I'm asking this in the right forum. I just downloaded the update for Microsoft Remote Desktop for Windows Phone 8.1 (I am actually running Denim on a 1520 but that may not matter). The version is 8.1.8.13 released 3/4/2015. I am trying to connect
    to a RemoteApp application but I am receiving the following error message shortly after it tries the redirection process (I think it fails at the securing remote connection part after it attemps the redirction to the RemoteApp application collection server):
    Connection error
    We couldn't connect to the remote PC. This might be due to an expired password. If this keeps happening, ask your admin or tech support for help.
    Inquiring minds may find this error code helpful: 0x207
    I am able to connect directly to both the broker server as well as the RemoteApp collection server with this application with the same credentials and am only experiencing this when trying to connect to a RemoteApp application.
    We are running Server 2012 R2 for both the broker/web and the collection servers. We are not using a gateway server as we use an SSL VPN concentrator instead for access outside of our network. We have server farms set up as well in the RemoteApp topology.
    Any info would help or let me know if I'm not posting in the right forum for this issue. I know this is a very recent release so I'm trying to figure out if I should wait for a bug fix or if there's something that I can do on my end.
    Thank you in advance for your time!

    Hi Scott,
    Please check your configuration once again and the certificate must be well configured. Also for accessing RemoteApp there might be the permission issue for your use, recheck once and verify. You can also got through
    this article for information.
    Hope it helps!
    Thanks.
    Dharmesh Solanki
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • Generate and print data matrix code from a vi

    Folks,
    does anyone know how to code a string into a data matrix code? How can the code be printed most straightforward? Probably it's the best way to generate the code in an image or picture format and send it to the printer that way? The printer we are using is a barcode printer, not an usual laser printer. According to the specifications this printer is able to print data matrix codes. Unfortunately, the vendor of the printer wants the user to use the proprietary software and does not provide a LabVIEW driver.
    Thanks for any hint,
    P.

    Hi
    I think the Dymo Labelwriter is a general purpose printer. So you may send data as you do to any printer. Her is a link to free barcode kit for labview http://code.google.com/p/lvbarcode/downloads/list
    Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
    (Sorry no Labview "brag list" so far)

  • Redemption code help that you keep sending everyone to is NOT HELPING. It just tells you to put in the redemption code. IF I HAD THE CODE I WOULD HAVE PUT IT IN!! How do I find the code?

    Redemption code help that you keep sending everyone to is NOT HELPING. It just tells you to put in the redemption code. IF I HAD THE CODE I WOULD HAVE PUT IT IN!! How do I find the code?

    Version 5.5 was/is not part of the Cloud, so you could not have subscribed to that version
    You install version 5.5 on a 2nd computer exactly the same way you did the 1st time... put the disc in the drive and enter your serial number when asked
    Does your serial number show on your account page?
    https://www.adobe.com/account.html for serial numbers on your Adobe page... or
    Lost serial # http://helpx.adobe.com/x-productkb/global/find-serial-number.html

  • Print Dot Matrix codes in InDesign CS6

    In InDesign, you can display barcodes by using a barcode font.
    Is there anything similar available to display Dot Matrix codes.
    Thanks

    No.

  • Code help in writing  report Program

    Hello experts
    I have to write a selection screen program based on the following requirements (only for sales Org:5090, plant:9000, Outbound delivery type= "LF")
    Selection parameters:
    Material (lips-matnr)
    Sold to party(likp-kunag): can hardcode it to 5090
    Sales Org(likp-vkorg)
    Plant(lips-werks) : hard code it to plant:9000
    Sales order(likp-vbeln)
    Actual goods movement dates(likp-wadat_ist)
    Invoice number
    Sales order
    Output
    material numberlips~matnr ( should Display only S* materials  and  material type FERT)
      Serial number of the device shipped (objk-sernr)
    Delivery number (lips~vbeln)
    Invoice number (vbrp-vbeln)
    Invoice price=Vbrp-vbeln/quantity (invoice price)
      Notification number (Viqmel-QMNUm)
      KBB Repair Level(VIQMEL-QMTXT from QMCOD ) 
      KBC Repair level(VIQMMA-MNCOD from KBC-SM07 code group(VIQMMA-MNGRP))
    code help is higly appreciated,
    Thanks
    Sp

    Hi anurag,
    Code is going like this, i could able to display it but when i run it ABAP Dump is coming.
    what could be the reason?
    Tahnks
    SP
    *& Report  ZSDR_PRICING_KSE_RPT                                        *
    REPORT  ZSDR_PRICING_KSE_RPT          .
    TABLES: likp, lips, vbfa, vbak.
    TYPE-POOLS: slis.
    */ Selection and Input Parameters
    SELECTION-SCREEN BEGIN OF BLOCK block2 WITH FRAME TITLE text-003.
    SELECT-OPTIONS: s_matnr FOR lips-matnr,
                    s_kunag FOR likp-kunag.
    SELECT-OPTIONS: s_vkorg FOR likp-vkorg NO INTERVALS,
                    s_werks FOR lips-werks.
    SELECT-OPTIONS: s_vbeln FOR likp-vbeln,
                    s_waist FOR likp-wadat_ist.
    SELECT-OPTIONS: s_vgbel FOR lips-vgbel.
    SELECTION-SCREEN END OF BLOCK block2.
    DATA: gt_fieldcat TYPE slis_t_fieldcat_alv.
    TYPES: BEGIN OF ty_data,
           matnr TYPE lips-matnr,
           sernr TYPE equi-sernr,
           vbeln TYPE lips-vbeln,
           invno TYPE vbfa-vbeln,
           qmnum TYPE vbak-qmnum,
           netwr type vbrp-netwr,
           END OF ty_data.
    DATA: gt_data TYPE TABLE OF ty_data WITH HEADER LINE.
    TYPES: BEGIN OF ty_lips,
           vbeln TYPE likp-vbeln,
           matnr TYPE lips-matnr,
           wersk TYPE lips-werks,
           vgbel TYPE lips-vgbel,
           END OF ty_lips.
    DATA: gt_lips TYPE TABLE OF ty_lips WITH HEADER LINE.
    DATA: gt_vbfa TYPE TABLE OF vbfa WITH HEADER LINE.
    DATA: gt_vbrp TYPE TABLE OF vbrp WITH HEADER LINE.
    TYPES: BEGIN OF ty_ser01,
           lief_nr TYPE ser01-lief_nr,
           obknr TYPE ser01-obknr,
           sernr TYPE objk-obknr,
           END OF ty_ser01.
    DATA: gt_ser01 TYPE TABLE OF ty_ser01 WITH HEADER LINE.
    START-OF-SELECTION.
      PERFORM get_data.
      PERFORM display_data.
    *& Form get_data
    FORM get_data.
      SELECT likpvbeln lipsmatnr lipswerks lipsvgbel
             INTO CORRESPONDING FIELDS OF TABLE gt_lips
             FROM likp INNER JOIN lips ON lipsvbeln = likpvbeln
             WHERE lips~matnr IN s_matnr
             AND lips~werks IN s_werks
             AND likp~kunag IN s_kunag
             AND likp~wadat_ist IN s_waist
             AND lips~vgbel IN s_vgbel
             AND likp~vkorg IN s_vkorg.
      IF NOT gt_lips[] IS INITIAL.
        SELECT vbeln vbelv INTO CORRESPONDING FIELDS OF TABLE gt_vbfa
        FROM vbfa
        FOR ALL ENTRIES IN gt_lips
          WHERE vbelv = gt_lips-vgbel
          AND vbtyp_n = 'M'.
        IF NOT gt_vbfa[] IS INITIAL.
          SELECT vbeln matnr netwr
          INTO CORRESPONDING FIELDS OF TABLE gt_vbrp
          FROM vbrp FOR ALL ENTRIES IN gt_vbfa
          WHERE vbeln = gt_vbfa-vbeln.
          SELECT ser01lief_nr ser01obknr objk~sernr
          INTO CORRESPONDING FIELDS OF TABLE gt_ser01
          FROM ser01 INNER JOIN objk ON objkobknr = ser01obknr
          FOR ALL entries IN gt_vbfa
          WHERE ser01~lief_nr = gt_vbfa-vbeln
          AND taser EQ 'SER01'.
        ENDIF.
      ENDIF.
      clear: gt_data[].
      LOOP AT gt_lips.
        LOOP AT gt_vbfa WHERE vbelv = gt_lips-vgbel.
          READ TABLE gt_vbrp WITH KEY vbeln = gt_vbfa-vbeln
          matnr = gt_lips-matnr.
          LOOP AT gt_ser01 WHERE lief_nr = gt_vbfa-vbeln.
            gt_data-matnr = gt_lips-matnr.
            gt_data-sernr = gt_ser01-sernr.
            gt_data-vbeln = gt_lips-vbeln.
            gt_data-invno = gt_vbfa-vbeln.
            gt_data-netwr = gt_vbrp-netwr.
            APPEND gt_data.
          ENDLOOP.
        ENDLOOP.
      ENDLOOP.
    ENDFORM. " get_data
    *& Form display_data
    FORM display_data.
      DATA: lv_repid TYPE sy-repid.
      lv_repid = sy-repid.
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
      EXPORTING
      i_program_name = lv_repid
    I_INTERNAL_TABNAME =
      i_structure_name = gt_data
    I_CLIENT_NEVER_DISPLAY = 'X'
    I_INCLNAME =
    I_BYPASSING_BUFFER =
    I_BUFFER_ACTIVE =
      CHANGING
      ct_fieldcat = gt_fieldcat
    EXCEPTIONS
    INCONSISTENT_INTERFACE = 1
    PROGRAM_ERROR = 2
    OTHERS = 3
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    I_INTERFACE_CHECK = ' '
    I_BYPASSING_BUFFER =
    I_BUFFER_ACTIVE = ' '
    i_callback_program = lv_repid
    I_CALLBACK_PF_STATUS_SET = ' '
    I_CALLBACK_USER_COMMAND = ' '
    I_STRUCTURE_NAME =
    IS_LAYOUT =
    it_fieldcat = gt_fieldcat
    IT_EXCLUDING =
    IT_SPECIAL_GROUPS =
    IT_SORT =
    IT_FILTER =
    IS_SEL_HIDE =
    I_DEFAULT = 'X'
    I_SAVE = ' '
    IS_VARIANT =
    IT_EVENTS =
    IT_EVENT_EXIT =
    IS_PRINT =
    IS_REPREP_ID =
    I_SCREEN_START_COLUMN = 0
    I_SCREEN_START_LINE = 0
    I_SCREEN_END_COLUMN = 0
    I_SCREEN_END_LINE = 0
    IMPORTING
    E_EXIT_CAUSED_BY_CALLER =
    ES_EXIT_CAUSED_BY_USER =
    TABLES
    t_outtab = gt_data
    EXCEPTIONS
    PROGRAM_ERROR = 1
    OTHERS = 2
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.

  • I was messing around with my iPad and put in a in app purchese and forgot the pass code help!

    I was messing around with my iPad and put in a in app purchese and forgot the pass code help!

    Do you mean you forgot the passcode for your iPad?  If so you need to restore it through the recovery mode described in http://support.apple.com/kb/HT1808

  • Redemption Code Help, where do I locate it?

    Redemption Code Help, where do I locate it?

    You have activate the subscription only once in the month of August 2014, so you can activate it one more time, if the Cc is asking for serial number then please follow the steps:
    Creative cloud do not need a serial number. it will be using your Adobe ID on which you have purchased the creative cloud membership.
    So you need to login with your Adobe ID and password to activate the cloud membership.
    Log out & log back in of the CC Desktop App.
    In case it is not signing in successfully please try the following:
    I don't know which operating system you are working on so i am giving you some steps windows and MAC OS:
       Windows:
       In windows 7 navigate to following location:
         /windows/system32/drivers/etc
       1. look out for "Hosts" file
       2. Open it with notepad
       3. Check if you have any entry for Adobe
       4. Remove the entries and try again launching any product from CC
       On Windows XP navigate to following location:
       \windows\system32\drivers\etc
       1. look out for "Hosts" file
       2. Open it with notepad
       3. Check if you have any entry for Adobe
       4. Remove the entries and try again launching any product from CC
       Mac:
       1. Please click on "Go" and navigate to /private/etc
       2. Open "hosts" file and check out for any entries for Adobe.com
       3. Remove the entries and save the file
       4.  try again launching any product from CC
    You can refer :
    http://helpx.adobe.com/creative-cloud/kb/ccm-prompt-serial-number.html
    http://helpx.adobe.com/x-productkb/policy-pricing/activation-network-i ssues.html.
    Please let us know if it worked.
    Regards,
    Rajshree

  • HT201209 When I try to redeem it says error invalid code help me please.

    When I try to redeem it says error invalid code help me please.

    Contact iTunes Customer Service and request assistance
    Use this Link  >  Apple  Support  iTunes Store  Contact
    Note: iTunes Gift Cards are only Valid in Country of issue

  • I just had to buy a new computer because my "vintage" Mac died. after migrating my backup drive over my Adobe creative suite no longer wroks I get a 150:30 error code HELP!

    I just had to buy a new computer because my "vintage" Mac died. After migrating my backup drive over to my New mac book my Adobe CS no longer works. I get a 150:30 error code HELP!

    You need to reinstall it properly, not use migration.
    Mylenium

  • Boolean matrix - Please Help

    Would anyone be able to help me out with code to create a boolean (1/0) for a GUI? Iam looking to use a matrix of up to 10 rows and columbs that would resize depending on an entered value. It would then be possible to use the mouse to click on each element within the matrix to make it a 1 or a 0. I would appretiate any help.

    yay !!!!
    import java.awt.*;
    import java.awt.event.*;
    import java.util.BitSet;
    import javax.swing.*;
    import javax.swing.event.MouseInputAdapter;
    * @author  Ian Schneider
    public class BooleanMatrix extends JPanel {
        BitSet bits;
        int w = 10;
        int h = 10;
        /** Creates a new instance of BooleanMatrix */
        public BooleanMatrix() {
            resizeMatrix(w,h);
            MouseUpdater updater = new MouseUpdater();
            addMouseListener(updater);
            addMouseMotionListener(updater);
        public boolean isSet(int x,int y) {
            return bits.get(idx(x,y));
        public void toggle(int x,int y) {
            bits.flip(idx(x,y));
        private int idx(int x,int y) {
            return x + y * w;
        public void resizeMatrix(int w,int h) {
            bits = new BitSet(w * h);
            this.w = w;
            this.h = h;
        public Dimension getPreferredSize() {
            return new Dimension(w * 10,h* 10);
        public void paintComponent(Graphics g) {
            super.paintComponent(g);
            for (int i = 0, ii = w; i < ii; i++) {
                for (int j = 0, jj = h; j < jj; j++) {
                    if (isSet(i,j))
                        g.setColor(Color.green);
                    else
                        g.setColor(Color.red);
                    g.fillOval(i * 10 + 2,  j * 10 + 2, 6,6);
        class MouseUpdater extends MouseInputAdapter {
            public void mouseClicked(MouseEvent me) {
                int x = me.getX() / 10;
                int y = me.getY() / 10;
                toggle(x,y);
                repaint();
            public void mouseDragged(MouseEvent me) {
                mouseClicked(me);
        public static final void main(String[] args) throws Exception {
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(f.EXIT_ON_CLOSE);
            f.getContentPane().add(new BooleanMatrix());
            f.pack();
            f.setLocationRelativeTo(null);
            f.show();
    }The rest of the exercises are left to the student :)

  • Tic Tac Toe code Help

    I am a beginner Java programmer, and I need help with my tic tac toe code.
    import javax.swing.JOptionPane;
    * Created on Nov 14, 2006
    * TODO To change the template for this generated file go to
    * Window - Preferences - Java - Code Style - Code Templates
    * @author jye
    * TODO To change the template for this generated type comment go to
    * Window - Preferences - Java - Code Style - Code Templates
    public class TicTacToe {
        public static void main(String[] args) {
            int[][]matrix = {{0,1,2},{3,4,5},{6,7,8}};
            while (true)
            System.out.println(); //keeps the tables seperate
            for(int row = 0; row<matrix.length;row++)
                for(int col = 0; col < matrix[row].length;col++)
                if (matrix[row][col]!=-1 && matrix[row][col]!=-2) //Compares each element to -1 and and -2, if not, then it just prints out the regular number
                System.out.print(matrix[row][col] + " ");
                if (matrix[row][col]==-1)
                    System.out.print("X" + " ");
                if (matrix[row][col]==-2)
                System.out.print("O" + " ");
                System.out.println();
                int p1 = Integer.parseInt(JOptionPane.showInputDialog (null, "Enter number 1"));
                int p2 = Integer.parseInt(JOptionPane.showInputDialog (null, "Enter number 2"));
            for(int row = 0; row<matrix.length;row++) //this piece of code refers to above print code
                for(int col = 0; col < matrix[row].length;col++)
                if (p1==matrix[row][col]) //compares each element in array to the position inputted. If it is equal to the number inputted, then it changes that to -1. For example, the postition of 4 is [1][1], it will replace [1][1] with -1. The matrix[row][col] is a position.
                    matrix[row][col]=-1;
                if(p2==matrix[row][col])
                    matrix[row][col]=-2;
            for(int row = 0; row<matrix.length;row++)
                for(int col = 0; col < matrix[row].length;col++)
                    if(matrix[0][0]==-1 && matrix[0][1]==-1 && matrix[0][2]==-1)
                        System.out.println("Player 1 wins.");break;
                    if(matrix[1][0]==-1 && matrix[1][1]==-1 && matrix[1][2]==-1)
                        System.out.println("Player 1 wins.");break;
                    if(matrix[2][0]==-1 && matrix[2][1]==-1 && matrix[2][2]==-1)
                        System.out.println("Player 1 wins.");break;
                    if(matrix[0][0]==-1 && matrix[1][0]==-1 && matrix[2][0]==-1)
                        System.out.println("Player 1 wins.");break;
                    if(matrix[0][1]==-1 && matrix[1][1]==-1 && matrix[2][1]==-1)
                        System.out.println("Player 1 wins.");break;
                    if(matrix[0][2]==-1 && matrix[1][2]==-1 && matrix[2][2]==-1)
                        System.out.println("Player 1 wins.");break;
                    if(matrix[0][0]==-1 && matrix[1][1]==-1 && matrix[2][2]==-1);
                        System.out.println("Player 1 wins.");break;
                    if(matrix[0][2]==-1 && matrix[1][1]==-1 && matrix[2][0]== -1)
                        System.out.println("Player 1 wins.");break; //I GET A "UNREACHEABLE CODE" ERROR HERE
                    if(matrix[0][0]==-2 && matrix[0][1]==-2 && matrix[0][2]==-2)
                        System.out.println("Player 2 wins.");break;
                    if(matrix[1][0]==-2 && matrix[1][1]==-2 && matrix[1][2]==-2)
                        System.out.println("Player 2 wins.");break;
                    if(matrix[2][0]==-2 && matrix[2][1]==-2 && matrix[2][2]==-2)
                        System.out.println("Player 2 wins.");break;
                    if(matrix[0][0]==-2 && matrix[1][0]==-2 && matrix[2][0]==-2)
                        System.out.println("Player 2 wins.");break;
                    if(matrix[0][1]==-2 && matrix[1][1]==-2 && matrix[2][1]==-2)
                        System.out.println("Player 2 wins.");break;
                    if(matrix[0][2]==-2 && matrix[1][2]==-2 && matrix[2][2]==-2)
                        System.out.println("Player 2 wins.");break;
                    if(matrix[0][0]==-2 && matrix[1][1]==-2 && matrix[2][2]==-2);
                        System.out.println("Player 2 wins.");break;
                    if(matrix[0][2]==-2 && matrix[1][1]==-2 && matrix[2][0]== -2)
                        System.out.println("Player 2 wins.");break;//I GET A "UNREACHEABLE CODE" ERROR HERE
    }Why do I get a unreachable error code???
    Thanks.

    Just in case you are tired I mean this (from the ending bit of your code)
    if(matrix[0][0]==-2 && matrix[1][1]==-2 && matrix[2][2]==-2);// <== PROBLEM RIGHT HERE
                        System.out.println("Player 2 wins.");break;
                    if(matrix[0][2]==-2 && matrix[1][1]==-2 && matrix[2][0]== -2)
                        System.out.println("Player 2 wins.");break;//I GET A "UNREACHEABLE CODE" ERROR HERE
                    }And same earlier on.

Maybe you are looking for

  • Unrestricted Qty and SLoc  in  Batch search in "Batches for Vendor" option

    Hi All, I have a requirement in Batch search option. When we are using 4.7 we have the option for available qty for the batch in Batch search option. It is removed in ECC6.0.Can anybody help me to get this option in ECC 6.0

  • IDVD - 6.7 GB to 1.4 GB

    OK, so I have an iDVD project whose files add up to 6.7 GB but when compressed for DVD the disk image is 1.38 GB. How do I increase the quality in order to take advantage of all the extra disk space? I can go up to 4.3 GB right? What's the point of u

  • Problem in designing

    hi all i m developing online test(aptitude test) i want to add images or figures like circle or rectangle wat tech i should use for desiging the page frontpage or java is it possible in html thanx in advance rachna Message was edited by: rachna_arora

  • HT1688 ok i have a iphone 3 and there are some things that is wrong with it can it be fixed and if so where or who do i talk to

    i have a iphone 3 and there is things wrong with it can it be fixed and who do i talk to to get it fixed

  • LOV or calling a procedure

    i am working on a financial system and i am implementing a form to do a contract between two people so i want to force the user to insert only valid customer no from the customer table (containing more than 2 million row) so i make a List of value an