Array problem (empty).

Hi everybody,
I'm using Crystal X and I have the following query
IdField          Field1             Field2
1                  CCC                8
1                  GGG               3
1                  DDD                2
2                  AAA                7
I want the following output
IdField
1               CCC GGG DDD    Field2 define different format to Field1 (different background color)
2               AAA
My report is grouped by IdField. As the output for Field1 has a different format depending on Field2. I want to write the Field1+Field2 values for each IdField in an Array, I have the following formulas, but the array looks empty, I have changed the array declaration as global and still is empty
Section: ReportHeader
Formula InitArray
             shared stringvar Array DataArray;
             redim DataArray[30];
Section: Details (Suppresed)
Formula AddDataToArray
            shared numbervar iCounter;
            shared stringvar Array DataArray;
            iCounter := iCounter + 1;
            DataArray[iCounter] := {Command.Field1} + "-" +  {Command.Field2};                                             
Section: Footer Group1a
Formulla FillTextFromArray
            shared numbervar sDataVal;
            shared stringvar Array DataArray;
            sDataVal := DataArray[1];  //DataArray[1] shoud be = "CCC-8"
            left(sDataVal, len(sDataVal)-2);
            {@DisplayData1}= DataArray[1]; //This is my problem the array is empty
Section: Footer Group1b
Display the following data
IdField     @DisplayData1  @DisplayData2  @DisplayData3 ...
I added 50 formulas to display each Field1 value with different formats. I know these columns are fixed, but I coudn't find any other way.
I have 3 question:
??? What is wrong on my array than in formula "FillTextFromArray" is empty???
??? Is there another way to refence a formula or a text object different than FormulaName or TextObjectName???, like an object array or something, because I will be dealing with 50 formulas to write the value and to change the format
??? How to make reference to a text object, in case I would change the 50 formulas by 50 text objects
Please help with any of the 3 questions or any ideas to make the report
thanks
cc

You can try another way like
create anew formula @Initialize
whileprintingrecords;
stringvar str:="";
Now place this in group header of IDField
Now Create another formula @Evaluate
whileprintingrecords;
stringvar str;
str:=str" ";
Place this in detail section
Create another formula like @Display
whileprintingrecords;
stringvar str;
place this in group footer of IDFIeld and right click on this formula and go to format field and check the option "can grow".
Now you can suppress the sections group header and details section to show the values in a single line in each group footer.
Hope this helps!
Raghavendra

Similar Messages

  • A quick Array Problem

    hey all,
    i'm having a dumb array problem, I cannot figure out what I've done wrong !
    I've set up an empty array of JButtons (because that '4' is actually a variable in my code)
    HERE IS THE CODE
    //===========================
    JButton[] buttons = new JButton[4] ;
    for (int g = 0; g < 4; g++)
    Imag[g].setIcon(imageIcons[g]);     
    buttons[g].setEnabled(true);
    System.out.print (buttons[g] + " " + g + "\n");
    //===========================
    My Error is a null pointer exception. And when I take out the:
    buttons[g].setEnabled(true);
    line, I just get the ouput, and it is:
    null 0
    null 1
    null 2
    null 3
    Ok, I know I'm probably making one dumb little mistake, but I have no idea what it is right now, Please Help !! thanks,
    Kngus

    When you want to use an array, you declare it (which you did), construct it (which you did), and initialize it (which the VM did). When you initialize an array of primitives, the primitives get their default value (0 for signed int types, 0.0 for float types, false for boolean, null-character for char) and so do object references (null).
    You are setting up an array of object references. When the VM initializes it, the elements of the array (i.e. the references to the JButtons) are set to null. That's why you're getting the NullPointerException. You need additional code, something along the lines of this:
    for(int j = 0; j < buttons.length(); j++) {
        buttons[j] = new JButton();
    }Now, your buttons array will contain references to JButtons rather than null.
    AG

  • Transposin​g Array Problem

    I need to get the information from a table which has been populated at an earlier point in the program, and convert it to numbers, and then break it up into its individual elements. Both ways of doing this in my attached vi work, but the one method throws three 0's in between columns, when I resize the 2D array to 1D. Any idea why? Is there an easier way to go about this?
    Thanks, Geoff
    Attachments:
    Array Problem.vi ‏26 KB

    Your original table contains 3 extra row which generate 3 rows of zeroes. Your 2D array actually contains 35 elements. the reshape function truncates to 20 elements. After transposing, you throw away nonzero elements while before rehshaping all zeroes are in the tail giving the false apperance of correct behavior.
    The attached modification gives you a button to fix the table size so it works correctly.
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    ArrayProblemMOD.vi ‏41 KB

  • Am having problems emptying my trash. Takes forever and then the contents don't delete. What must i do?

    a) Am having problems emptying my trash.
    Takes forever and then the contents don't delete.
    What must i do? My trash box is full and it's affecting my operating system?
    b) Does the items in trash slow down my operating system?

    Abu,
    There may be something going on with your ownership if the Trash if the files aren't deleting. OK, let's try this:
    Launch Terminal (found in Applications>Utilities folder). At the $ prompt, type (or paste):
    ls -la
    and hit Return. In the right hand column, you should see .Trash listed and to the left, you will see the "owners" name (in my case, clintondyches). If the owners name shows as root then the following will fix the problem. At the same $ prompt enter
    sudo chown yourusername .Trash
    (replace yourusername with your actual user name - such as mine being clintondyches).
    At the prompt $ again, type or paste:
    ls -la
    If this was successful, you should see yourusername instead of root.
    You should be in business now. You should have ownership of .Trash and be able to empty your Trash, drag items to it and empty it, etc.
    Call back and let me know...
    Clinton

  • MS Office Report Express VI and Array Problem

    Hello all,
    I have a strange issue with the MS Office Report VI that's included with the Report Generation Toolkit. I created an Excel template which I linked using the "Custom template for Excel" preference and applied all the named ranges. However, two of the named ranges that I am inputting are 1D Arrays of doubles. Now the problem:
    When I input the arrays to their specific name range (it's only 6 values), instead of inputting just the array values into the cells, it inputs like this:
    0    Value
    1    Value
    2    Value
    6    Value
    It pushes the "Value" to the column next to the name range because of the 0-6.
    It does this with both arrays so it screws up all the formulas. Any one know how to remove the 0-6 and just input the values?
    Thanks all 
    Solved!
    Go to Solution.

    Greetings, I wrote a program that generates an array of data and stores a data table, just as a chart, just starting to program, I hope that my program can be useful
    Atom
    Certified LabVIEW Associate Developer
    Attachments:
    write_excel.vi ‏60 KB

  • Assigning value to a two-dimensional byte array - problem or not?

    I am facing a really strange issue.
    I have a 2D byte array of 10 rows and a byte array of some audio bytes:
    byte[][] buf = new byte[10][];
    byte[] a = ~ some bytes read from an audio streamWhen I assign like this:
    for (int i=0; i<10; i++) {
        a = ~read some audio bytes // this method properly returns a byte[]
        buf[i] = a;
    }the assignment is not working!!!
    If I use this:
    for (int i=0; i<10; i++) {
        a = ~read some audio bytes
        for (int j=0; j<a.length; j++) {
            buf[i][j] = a[j];
    }or this:
    for (int i=0; i<10; i++) {
        System.arraycopy(a, 0, buf, 0, a.length);
    }everything works fine, which is really odd!!
    I use this type of value assignment for the first time in byte arrays.
    However, I never had the same problem with integers, where the problem does not appear:int[] a = new int[] {1, 2, 3, 4, 5};
    int[][] b = new int[3][5];
    for (int i=0; i<3; i++) {
    b[i] = a;
    // This works fineAnybody has a clue about what's happening?
    Is it a Java issue or a programmers mistake?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Back again! I'm trying to track down the problem.
    Here is most of my actual code to get a better idea.
    private void test() {
         byte[][] buf1 = new byte[11][];
         byte[][] buf2 = new byte[11][];
         AudioInputStream audioInputStream = AudioSystem.getAudioInputStream(audioFile);
         byte[] audioBytes = new byte[100];
         int serialNumber = 0;
         while (audioInputStream.read(audioBytes) != -1) {
              if (serialNumber == 10) {
                   serialNumber = 0; // breakpoint here for debugging
              // Fill buf1 -- working
              for (int i=0; i<audioBytes.length; i++) {
                   buf1[serialNumber] = audioBytes[i];
              // Fill buf2 -- not working
              buf2[serialNumber] = new byte[audioBytes.length];
              buf2[serialNumber] = audioBytes;
              serialNumber++;
    }I debugged the program, using a debug point after taking 10 "groups" of byte arrays (audioBytes) from the audio file.
    The result (as also indicated later by the audio output) is this:
    At the debug point the values of buf1's elements change in every loop, while buf2's remain unchanged, always having the initial value of audioBytes!
    It's really strange and annoying. These are the debugging results for the  [first|http://eevoskos.googlepages.com/loop1.jpg] ,  [second|http://eevoskos.googlepages.com/loop2.jpg]  and  [third|http://eevoskos.googlepages.com/loop3.jpg]  loop.
    I really can't see any mistake in the code.
    Could it be a Netbeans 6.1 bug or something?
    The problem appears both with jdk 5 or 6.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Problem: Empty id attribute is not allowed

    Hi, I'm a newby with JSF and can't understand how to make some really simple things to work.
    One of the problems occurred, when I tried to make a dataTable for choosing locales.
    Simple table, like
    language code | button "choose"
    language code | button "choose"
    language code | button "choose"
    , and actionListener attached to buttons. The language code is shown by <h:outputText value="${locale}">, works just fine! But when I add <h:commandButton id="${locale}" value="#{msg.set}" actionListener="#{tryoutsView.chooseLocaleAL}"/>, an error appears "Empty id attribute is not allowed"!
    So I have two questions about that:
    (1) Why ${locale} is normally calculated in one place, and is null nearby? Didn't find any clues on that in official tutorial.
    (2) How do I make this work (make id attribute take expression)?
    And one more question on related subject
    (3) Why did official tutorial authors use "synchronized" mark for method, that determines content of h:dataTable? (http://download.oracle.com/javaee/6/tutorial/doc/bnaty.html#bnauc)
    The code:
    <?xml version='1.0' encoding='UTF-8' ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"
          xmlns:h="http://java.sun.com/jsf/html"
          xmlns:f="http://java.sun.com/jsf/core">
        <h:head>
            <title>Facelet Title</title>
        </h:head>
        <h:body>
            Hello from Facelets!
            <f:view>
                <f:loadBundle basename="my.presentation.tryouts" var="msg"/>
                <h:dataTable
                    id="locales_table"
                    value="#{tryoutsView.supportedLocales}"
                    var="locale"
                    title="#{msg.thelocales}">
                    <f:facet name="header"><h:outputText value="#{msg.tableheader}"/></f:facet>
                    <h:column>
                        <f:facet name="column_locale_head"><h:outputText value="#{msg.locale}"/></f:facet>
                        <h:outputText value="${locale}"/>
                    </h:column>
                    <h:column>
                        <h:form>
                            <h:commandButton id="${locale}" value="#{msg.set}" actionListener="#{tryoutsView.chooseLocaleAL}"/>
                        </h:form>
                    </h:column>
                    <f:facet name="footer"><h:outputText value="#{msg.tablefooter}"/></f:facet>
                </h:dataTable>
            </f:view>
        </h:body>
    </html>
    public class TryoutsView {
        private static final TreeMap<String, Locale> SUPPORTED_LOCALES = MyUtils.iterator2treemap(FacesContext.getCurrentInstance().getApplication().getSupportedLocales());
        public synchronized List<String> getSupportedLocales() {
            List<String> l = MyUtils.iterator2arrlist(SUPPORTED_LOCALES.keySet().iterator());
            return l;
    }Edited by: 800060 on Oct 4, 2010 10:23 PM
    Edited by: 800060 on Oct 5, 2010 12:18 AM

    If you have/intend nothing useful to say, then, please, stop trashing the thread.I don't consider asking questions, or pointing out tautologies, to be 'trashing the thread'.
    (1) Why ${locale} is normally calculated in one place, and is null nearby? It isn't 'calculated' anywhere in your code. It is set by the listbox. Until the user selects a value it doesn't have one. It iis empty. Hence the error message that I keep directing your attention to.
    (2) How do I make this work (make id attribute take expression)?Make sure the value of the expression isn't empty.
    And one more question on related subject
    (3) Why did official tutorial authors use "synchronized" mark for method, that determines content of h:dataTable? (http://download.oracle.com/javaee/6/tutorial/doc/bnaty.html#bnauc)
    Because 'items' is probably not thread-safe.
    If you want any further help from me I suggest you mind your manners. It is clear that you have very little useful to say here. You seem to have no intention of answering any of the questions I asked you. Nor am I convinced that you understand the difference between 'empty' and 'omitted' that I have been trying to get you to see. It is impossible to help those who will not help themselves, and abusing those who are trying to help them is not a rational policy.

  • RAID 5 array problem

    Hi,
    I've a problem arising from the replacement of a drive in a Proliant ML370 G3 RAID 5 array.
    What happened is one disc in the array failed. I replaced it and selected the "F1" rebuild option. The system then appeared to start the rebuild, both the green arrow and the green HD icon on the replaced disc flashing. However, when I returned to the server, over a week later, I found that the HD light had gone out but the green arrow continued to flash on occasion. I had expected the HD icon to remain illuminated and the arrow to flash every so often. When I checked in Disc Manager (Windows 2003 Server) this reported that although both partitions allocated to the array were healthy, there was no fault tolerance. I have since rebooted the server which then responded that the same disc had failed and presented me with a rebuild option.
    I've now tried to rebuild this array three times without success, the result being the same each time I try. What am I missing?
    I'd appreciate any suggestions
    Phil

    You gave a very nicely detailed list of datum ... thanks, that's rare!
    Now ... one other bit ... you mention media being on the Thunderbolt RAID5 ... is everything there, including cache/database/previews/project-file, or just the media? I know that if say everything else was on the system drive, this would probably happen ... the media is the 'easiest' part of the disc-in/out chain as it's mostly "simple" reading of files, those other things are heavy read/write items. I'm assuming you've probably put most of it on that RAID, as the folks on the Tweaker's Page would oft posit.
    Neil

  • Associative Array problem in Oracle Procedure

    Hi,
    I've searched through the internet and this forum and haven't been able to resolve a problem using associative array values within an IN clause. Everything I've read states that I can't use the associative array directly in the SQL statement. I have to convert it to a table and then I can use it. Unfortunately, I'm receiving an "ORA-21700: object does not exist or is marked for delete" error when trying to access the table I've populated from the array. Please note that I have verified the table is actually being populated during the loop. I'm catching the error when referencing it in the SELECT statement.
    I've declared the following in the ARCHIVE package specification:
    TYPE RSType IS REF CURSOR;
    TYPE integer_aat IS TABLE OF INTEGER INDEX BY PLS_INTEGER;
    TYPE integer_table IS TABLE OF INTEGER;
    The procedure is as follows:
    PROCEDURE SEL_SEARCH_RESULTS (v_term IN VARCHAR2,
    v_categories IN ARCHIVE.integer_aat,
    rs OUT RSType)
    AS
    /* PURPOSE: Return Search Results for the Category and Keyword Provided
    VARIABLES:
    v_categories = Document Categories array
    v_term = Keyword entered
    rs = Result Set
    tbl_cat ARCHIVE.integer_table := ARCHIVE.integer_table();
    BEGIN
    FOR i IN 1 .. v_categories.COUNT
    LOOP
    tbl_cat.EXTEND(1);
    tbl_cat(i) := v_categories(i);
    END LOOP;
    OPEN rs FOR
    SELECT A.ID,
    B.CATEGORY,
    A.FILENAME,
    A.DISPLAY_NAME,
    A.COMMENTS
    FROM TBL_ARCHIVE_DOCUMENTS A,
    TBL_ARCHIVE_DOC_CAT B,
    TBL_ARCHIVE_DOC_KEYWORDS C
    WHERE A.ID = B.ID
    AND A.ID = C.ID
    AND B.CATEGORY IN (SELECT * FROM TABLE(tbl_cat))
    AND C.KEYWORD = v_term
    ORDER BY A.ID;
    END SEL_SEARCH_RESULTS;
    Any help would be greatly appreciated and thanks in advance,
    Matt

    Thank you for the quick response. I looked at the example you suggested and made the following changes. Now I'm receiving an "Invalid datatype" error on the "SELECT column_value FROM TABLE(CAST(tbl_cat AS tbl_integer))" statement. I must be missing something simple and I just can't put my finger on it.
    PROCEDURE SEL_SEARCH_RESULTS (v_term IN VARCHAR2,
    v_categories IN ARCHIVE.integer_aat,
    rs OUT RSType)
    AS
    /* PURPOSE: Return Search Results for the Category and Keyword Provided
    VARIABLES:
    v_categories = Document Categories array entered
    v_term = Keyword entered
    rs = Result Set
    TYPE tbl_integer IS TABLE OF INTEGER;
    tbl_cat tbl_integer;
    BEGIN
    FOR i IN 1 .. v_categories.COUNT
    LOOP
    tbl_cat.EXTEND(1);
    tbl_cat(i) := v_categories(i);
    END LOOP;
    OPEN rs FOR
    SELECT A.ID,
    B.CATEGORY,
    A.FILENAME,
    A.DISPLAY_NAME,
    A.COMMENTS
    FROM TBL_ARCHIVE_DOCUMENTS A,
    TBL_ARCHIVE_DOC_CAT B,
    TBL_ARCHIVE_DOC_KEYWORDS C
    WHERE A.ID = B.ID
    AND A.ID = C.ID
    AND B.CATEGORY IN (SELECT column_value FROM TABLE(CAST(tbl_cat AS tbl_integer)))
    AND C.KEYWORD = v_term
    ORDER BY A.ID;
    END SEL_SEARCH_RESULTS;

  • Array problem in FL 1.x

    Is there any alternative for array in Flash Lite 1.X
    (excluding PSUEDO Array)?

    kamsky wrote:
    > Is there any alternative for array in Flash Lite 1.X
    (excluding PSUEDO Array)?
    Yes, since arrays structures are not natively supported in
    Flash Lite
    prior to 2.x, developers must use one of two methods for 1.1
    content
    (that I know of) to simulate them:
    1.) Use the eval statement (2) or a movieclip to store and
    reference
    vars. Depending on your situation and/or needs one may be
    more
    appropriate to what you are doing than the other.
    1.) eval method:
    arr1 = "a"
    arr2 = "b"
    arr3 = "c";
    for ( i=1; i<=3; i++ ) {
    trace( eval( "arr" add i ) );
    2.) Create an empty movieclip off stage. Assign it an
    instance name of
    array_mc (or whatever) ... use it to store vars. Use the
    syntax:
    array_mc[0] = "a";
    array_mc[1] = "b";
    array_mc[2] = "c";
    trace( array_mc[0] );
    Also, here is a Pseudo array class for 1.1 from Aral Balkan
    you may be
    interested in:
    http://aralbalkan.com/353
    Some addition resources you should also check out if you are
    coming from
    > 2 and are working in 1.1:
    http://www.flashmobilebook.com/
    http://www.adobe.com/devnet/devices/articles/as2_to_flashlite_print.html
    http://www.adobe.com/devnet/devices/articles/as_flashlite.html
    Alessandro Pace has a running list of useful items like this
    at:
    http://www.biskero.org/?page_id=342

  • I've had this 2D array problem for ages and would apprecoate any help :)

    I've posted a few times about this in the past and with your guys help I have gradually advanced.
    Basically, all I want to do at the moment is fill the lowest position a counter can go in in a game of Connect Four.
    The first counter goes to the bottom, then if you place another counter in the same column it goes above the previous counter you put in that same column and so on...
    I have set up my 2D array and initialised integers for each player so when a counter is red the player = 1 and when yellow player = 2.
    Here is my code...
    CircleGrid [][] cArray = new CircleGrid[col][row]; //Declare array
    static final int row = 6;
    static final int col = 7;
    for (int i = 0; i < col; i++)
                        for (int h = 0; h < row; h++)
                             cArray[i][h] = new CircleGrid();
                             gameCenter.add(new CircleGrid());
                   JOptionPane.showConfirmDialog(game, "Welcome to Frenzy Fours. Press 'OK to begin or 'Cancel' to go back.", "Game", JOptionPane.OK_CANCEL_OPTION);
                   /*if (cArray[col-1][row] && cArray[col-2][row] == 1) //This doesn't work at all...array out of bounds !?
                        System.out.println("testing");
    public class CircleGrid extends JPanel implements MouseListener, MouseMotionListener
             int ifRed;
             int notIfRed;
                 boolean ifEmpty;
              String currentColour = "White";
              final int empty = 0;
              final int competitorOne = 1;
              final int competitorTwo = 2;
                 public CircleGrid()
                   ifRed = 1;
                   notIfRed = 0;
                   int redCircles = 0;
                   int yellowCircles = 0;
                   ifEmpty = true;
                   addMouseListener(this);
                 public void alternateColour()
                   ifEmpty = !ifEmpty;
                   repaint(); //Repaint upon changes
                 public void paintComponent(Graphics g)
                 if (ifEmpty)
                   g.setColor(Color.WHITE); //Set all of the ovals to white
             else if (ifRed == clicks)
                   position--;
                   addMouseListener(this);
                    g.setColor(Color.RED); //Paint red
                    currentColour = "Red";
                    System.out.println(getColour());
                    System.out.println(playerOneMove());
              else if (notIfRed == clicks)
                   addMouseListener(this);
                   g.setColor(Color.YELLOW); //Paint yellow
                   currentColour = "Yellow";
                   System.out.println(getColour());
                   System.out.println(playerTwoMove());
                   g.fillOval(5, 10, 42, 42); //Draw and fill oval
                 public String getColour()
                   return currentColour;
              public int playerOneMove()
                   return competitorOne;
              public int playerTwoMove()
                   return competitorTwo;
                 public void mousePressed(MouseEvent ev)
                   alternateColour(); //Use commands from this method
                   if (clicks == 0)
                        clicks = 1;
                        repaint(); //Paint oval red
                        number--; //Decrement number of counters left by 1
                         counterNo1.setText(number + " counters left.");
                         move++;
                         moveCount1.setText(move + " moves.");
                   else if (clicks > 0)
                        clicks = 0;
                        repaint(); //Paint oval yellow
                        number2--;
                         counterNo2.setText(number2 + " counters left.");
                        move2++;
                         moveCount2.setText(move2 + " moves.");
                 }I think that is all of the code which matters for this!
    I didn't choose to do this project and it is really stressing me out! If anybody could give me a nudge in the right direction (in really simple steps) that would be awesome. I appreciate you guys do this voluntarily (and for some even work) so I would be deeply grateful for any assistance in this matter.
    Thank you. :)
    - Jay
    Edited by: Aurora88 on Mar 5, 2008 7:18 AM

    public class CircleGrid extends JPanel implements MouseListener, MouseMotionListener
             int ifRed;
             int notIfRed;
                 boolean ifEmpty;
              String currentColour = "White";
              final int empty = 0;
              final int competitorOne = 1;
              final int competitorTwo = 2;
              static final int row = 6;
              static final int col = 7;
              Circle [][] cArray = new Circle[col][row]; //Declare array
              Circle circle = new Circle(0,0);
                 public CircleGrid()
                   ifRed = 1;
                   notIfRed = 0;
                   int redCircles = 0;
                   int yellowCircles = 0;
                   ifEmpty = true;
                   addMouseListener(this);
                 public void alternateColour()
                   ifEmpty = !ifEmpty;
                   repaint(); //Repaint upon changes
                 public void paintComponent(Graphics g)
                 if (ifEmpty)
                   g.setColor(Color.WHITE); //Set all of the ovals to white
             else if (ifRed == clicks)
                   position--;
                   addMouseListener(this);
                    g.setColor(Color.RED); //Paint red
                    currentColour = "Red";
                    System.out.println(getColour());
                    System.out.println(playerOneMove());
              else if (notIfRed == clicks)
                   addMouseListener(this);
                   g.setColor(Color.YELLOW); //Paint yellow
                   currentColour = "Yellow";
                   System.out.println(getColour());
                   System.out.println(playerTwoMove());
                   g.fillOval(5, 10, 42, 42); //Draw and fill oval
                 public String getColour()
                   return currentColour;
              public int playerOneMove()
                   return competitorOne;
              public int playerTwoMove()
                   return competitorTwo;
                 public void mousePressed(MouseEvent ev)
                   alternateColour(); //Use commands from this method
                   if (clicks == 0)
                        clicks = 1;
                        repaint(); //Paint oval red
                        number--; //Decrement number of counters left by 1
                         counterNo1.setText(number + " counters left.");
                         move++;
                         moveCount1.setText(move + " moves.");
                   else if (clicks > 0)
                        clicks = 0;
                        repaint(); //Paint oval yellow
                        number2--;
                         counterNo2.setText(number2 + " counters left.");
                        move2++;
                         moveCount2.setText(move2 + " moves.");
                   for (int i = 0; i < col; i++)
                        for (int h = 0; h < row; h++)
                             cArray[i][h] = new Circle();
                             gameCenter.add(cArray[i][h]);
                   System.out.println("LOCATION");
                   System.out.println("Row: " + circle.getRow());
                   System.out.println("Col: " + circle.getCol());
                 public void mouseClicked(MouseEvent ev)
                 public void mouseReleased(MouseEvent ev)
                   if (number < 0)
                        JOptionPane.showMessageDialog(game, "Error! You have no counters left.", "Error 001", JOptionPane.ERROR_MESSAGE);
                        System.out.println(countersGone()); //Display error when all counters are used
                        number = 22; move = 0; number2 = 22; move2 = 0;
                        counterNo1.setText(number + " counters left.");
                        moveCount1.setText(move + " moves.");
                        counterNo2.setText(number2 + " counters left.");
                        moveCount2.setText(move2 + " moves.");
                        clicks = 0;
                        game.dispose();
                 public void mouseEntered(MouseEvent ev)
                 public void mouseExited(MouseEvent ev)
                 public void mouseMoved(MouseEvent ev)
                 public void mouseDragged(MouseEvent ev)
                 public int getClickCount()
                   return clicks; //Record number of mouse clicks
                 public int getCounterNumber(int numberP1)
                      numberP1 = number; //Assigned number to numberP1
                      return number;
              public int getCounterNumber2(int numberP2)
                   numberP2 = number;
                   return number2;
              public int moveCounter1(int counterOne)
                   counterOne = move;
                   return move;
              public int moveCounter2(int counterTwo)
                   counterTwo = move2;
                   return move2;
                 public String countersGone()
                   return "You have used up all of your counters!";
         class Circle
             int rowNum, colNum;
             boolean occupied;
             String color;
        public Circle(int r, int c)
              rowNum = r;
              colNum = c;
              occupied = false;
        public int getRow()
              return rowNum;
        public int getCol()
              return colNum;
    }new Circle - cannot find symbol
    gameCenter.add - cannot find symbol
    Circle has been declared so I don't know why this is happening. :S

  • FCC problem:  Empty document found. Proceed without sending message

    Hi all,
    I am doing FCC to FCC scenario.
    In that I am getting the following message in Communication channel Monitoring.
    <b>Channel CC_File_FILBAS009_Sender</b>: Entire file content converted to XML format
    <b>Channel CC_File_FILBAS009_Sender</b>: Empty document found. Proceed without sending message
    File "/temp/xidelivery/send/FILBAS009_input.txt" archived after processing
    and My File structure is as follows..
    RS
    -HEADER
    Field1
    Field2
    Field3
    -DATA
    Field4
    Field5
    Field6
    -TRAILER
    Field7
    Field8
    Field9
    FCC Parameters are:
    RecordsetName : RS
    HEADER.fieldFixedLengths                   :  5,1,5
    HEADER.fieldNames                            :  Field1,Field2,Field3
    HEADER.keyFieldName                       :  Field2
    HEADER.keyFieldValue                       :  'H'
    HEADER.endSeparator                        :  'nl'
    In the same way I gave conversion parameters to DATA and TRAILER also.
    Can any one tell me what is the problem?
    Regards,
    Pavani

    hi pavani,
    excuse me about my previous reply.
    I was just checking your FCC parameters. I see fieldseparator missing and also is it possible to paste sample input data.
    I fieldsepartor is also not necessary since you have fiexedlengths. Since you say FCC to FCC and you paste the receiver FCC parameters
    regards
    Ramesh P
    Message was edited by:
            Ramesh P

  • XSLT Tranformation problem - empty output lines

    Hi experts,
    I have a following problem with the XSLT transformation.
      FIELD-SYMBOLS: <tab> TYPE table,
                     <line> TYPE ANY,
                     <tabz> TYPE ANY TABLE. 
      CREATE DATA a_table LIKE i_table.
      ASSIGN a_table->* TO <tabz>.
      GET REFERENCE OF <tabz> INTO g_xml_l-value.
      g_xml_l-name = a_templid.
      APPEND g_xml_l TO g_xml_t.
      TRY.
          CALL TRANSFORMATION z_ddu_xslt_test
          SOURCE XML g_tab_cal                            "OK file was loaded
          RESULT (g_xml_t).                                     "Seems to be ok, but I am not sure if g_xml_l was referenced OK
        CATCH cx_root INTO a_rif_ex.
          a_text = a_rif_ex->get_text( ).
          MESSAGE a_text TYPE 'E'.
      ENDTRY.
    Result is, that <tabz> have a two (correct) empty lines, but of course the data should be filled ...
    When I replace <tabz> to some kind of simple structured table, result is like above ...
    Thanks for help.

    Problem solved.
    There was internal problem with the I_TABLE structure.
    Regards.
    Edited by: Daniel Duras on Jul 15, 2010 3:34 PM

  • Converting bytes to character array problem

    I am trying to convert a byte array into a character array, however no matter which Character Set i choose i am always getting the '?' character for some of the bytes which means that it was unable to convert the byte to a character.
    What i want is very simple. i.e. map the byte array to its Extended ASCII format which actually is no change in the bit represtation of the actual byte. But i cannot seem to do this in java.
    Does anyone have any idea how to get around this problem?

    Thanks for responding.
    I have however arrived at a solution. A little un-elegant but it seems to do the job.
    I am converting each byte into char manually by this algorithm:
              for (int i=0;i<compressedDataLength;i++)
                   if (((int) output)<0)
                        k=(127-((int) output[i]));
                        outputChr[i]=((char) k);
                   else
                        k=((int) output[i]);
                        outputChr[i]=((char) k);
                   System.out.println(k);
    where output is the byte array and outputChr is the character array

  • Mathscript Array -problem

    Dear Friends,
    I am reading the serial port data data , byte by byte..I used serial port vi and math-script in it ....
    And these  serial data are sent in a format like below........
    format:  HEADER ,  MSB  , DATA ,  CHECKSUM..
    I need to collect these bytes and plot it on the graph.. I have problem with saving these data in an array and processing it....
    below is the code,which i had written to do the process
     persistent  ubIndex = 0
     persistent  bHeader = 0
    ubTemp=input
     if bHeader ==0
                     if ubTemp == 89
                            ubIndex= 0
                            bHeader = 1                              
                       end
    else
                  ubIndex= ubIndex +1
                  ubReceivedata(ubIndex) = ubTemp      
                   if  ubIndex == 3
                           ubIndex = 0
                           bHeader = 0               
                     end
    end      
     ubChecksum = ubRecieveData(1) + ubRecieveData(2) + ubRecieveData(3)
    if   ubChecksum == 0
                   if ubRecieveData(1) == 76
                            duLen1 = ubRecieveData(2)
                                 elseif   ubRecieveData(1) == 69
                                        duLen2 = ubRecieveData(2)
                                 elseif   ubRecieveData(1) == 78
                                           duLen3 = ubRecieveData(2)
                                   elseif ubRecieveData(1) == 71
                                                duLen4 = ubRecieveData(2)
                                                duLength = duLen1 * 16777216 + duLen2 * 65536 + uwLen3 * 256 +  ubLen4 
                                  elseif   ubRecieveData(1) == 80
                                               uwTemp1 = ubRecieveData(2);
                                   elseif  ubRecieveData(1) == 66
                                                ubTemp2 = ubRecieveData(2);                 
                                                uwpackageSpeed = uwTemp1 * 256 + ubTemp2;
                                     elseif  ubRecieveData(1) == 68
                                              uwTemp1 = ubRecieveData(2);
                                     else  ubRecieveData(1) == 65
                                              ubTemp2 = ubRecieveData(2);                 
                                             uwDrumSpeed = uwTemp1 * 256 + ubTemp2;
                       end
    end
    In the above program,i collected 2nd, 3rd,4th byte in the ubRecieveData array  and i left the 1st byte(which is header)...
    and I find the checksum by adding the 2nd,3rd,4th byte to find whether it is zero or not,
    if it is zero ,then the received bytes are correct...and it will proceed to take only the data bytes...and i will plot it on the chart...
    I have a doubt in the ubrecievedata array..whether it is collecting the 3 bytes data or not......whether array  get's initliazed every time in the script..
    since it doesn't get in to the if-loop checksum and loop further.....
    I even removed the if-loop checksum ,to collect and process the data inside the loop below if-loop checksum..but it's not working ...
    will the above script are correct..... .....?suggest some solutions to get working
    i attached my  program vi..for u to get feel of my problem...
    regards
    rajasekar
    Attachments:
    vjnewsamp.vi ‏319 KB

    Hi Grant,
    I did as u told u,still unable to process the data and plot it on the chart.....
    I attached my program  testing20.vi ....for finding the problem..
    could u please see the vi..and suggest some solutions....
    As u said  the array should also be persistent.....and my doubt is the other variable like dulen1,dulen2,dulen3,dulen4,...should also be persistent...in order to calculate the parameter
    duLength,.......similarly the parameter uwpackagespeed and uwdrumspeed should be persistent.(in my point of view....)
    objective of the program is to read the serial port byte and byte ...and plotting it
    And the byte are sent in format like
    format: Header , MSB ,data,checksum..
                 Header, LSB ,data,checksum..
    so i need to recogize this format in my mathscript node ...the main thing is ,...... in 4 bytes the data is only of 1byte....
    In my program , i am plotting length(x-axis) versus packagespeed and drumspeed(y-axis)..
    here the length parameter itself 4 byte of data.....i have to collect it byte by byte of data ,...from the 4 byte format(math script gets called 16 times to collect these 4 data bytes
     from 4 byte format)...        and packagespeed and drumspeed is of 2 byte.......
    if u have any questions please ask me...
    Eagerly awaiting for ur reply....
    Regards
    rajasekar
    Attachments:
    testing21.vi ‏442 KB

Maybe you are looking for