2D Array Processing

Hi, I've made the following 5x5 array and stored values in it:
int row = 5;
          int col = 5;
          int[][] twoDarray = new int[row][col];
          int[][] twoDarray =
          {1, 2, 3 ,4, 5},
          {7, -2, 6, 8, -3},
          {1, 90, 3, -1, 0}
          {6, 5, 22, 33, 5}
I need to print the diagonal values. i.e 1, -2, 3, 7, 5
and also the opposite diagonal part: 5, 8, 3, 19, 6
Has anyone got code for this?

Try this
class Array2dDiagonals
  int[][] twoDarray ={{1,2,3,4,5},{7,-2,6,8,-3},{1,90,3,-1,0},
                                   {0,19,0,7,0},{6,5,22,33,5}};
  public Array2dDiagonals()
    for(int i = 0, ii = 0; i < twoDarray.length; i++, ii++)
      System.out.print(twoDarray[i][ii]+" ");
    System.out.println();
    for(int i = 0, ii = twoDarray.length-1; i < twoDarray.length; i++, ii--)
      System.out.print(twoDarray[i][ii]+" ");
    System.out.println();
  public static void main(String args[])
    new Array2dDiagonals();
}

Similar Messages

  • Array processing question

    Hello,
    I am somewhat new to JNI technology and am getting a bit confused about array processing.
    I am developing a C program that is called by a third party application. The third party application expects the C function to have a prototype similar to the following:
    int read_content(char *buffer, int length)
    It is expecting that I read "length" bytes of data from a device and return it to the caller in the buffer provided. I want to implement the device read operation in Java and return the data back to the C 'stub' so that it, in turn can return the data to the caller. What is the most efficient way to get the data from my Java "read_content" method into the caller's buffer? I am getting somewhat confused by the Get<Type>ArrayElements routines and this concepts of pinning, copying and releasing with the Release<Type>ArrayElements routine. Any advice would be helpful... particularly good advice :)
    Thanks

    It seems to me that you probably want to call the Java read_content method using JNI and have it return an array of bytes.
    Since you already have a C buffer provided, you need to copy the data out of the Java array into this C buffer. GetPrimitiveArrayCritical is probably what you want:
    char *myBuf = (char *)((*env)->GetPrimitiveArrayCritical(env, javaDataArray, NULL));
    memcpy(buffer, myBuf, length);
    (*env)->ReleasePrimitiveArrayCritical(env, javaDataArray, myBuf, JNI_ABORT);Given a Java array of bytes javaDataArray, this will copy length bytes out of it and into the C array named buffer. I used JNI_ABORT as the last argument to ReleasePrimitiveArrayCritical because you do not change the array. But you could pass a 0 there also, there would be no observable difference in the behavior.
    Think of it as requesting and releasing a lock on the Java array. When you have no lock, the VM is free to move the array around in memory (and it will do so from time to time). When you use one of the various GetArray functions, this will lock the array so that the VM cannot move it. When you are done with it, you need to release it so the VM can resume normal operations on it. Releasing it also propagates any changes made back to the array. You cannot know whether changes made in native code will be reflected in the Java array until you commit the changes by releasing the array. But since you are not modifying the array, it doesn't make any difference.
    What is most important is that you get the array before you read its elements and that you release it when you are done. That's all that you really need to know :}

  • [Error ORABPEL-10039]: invalid xpath expression  - array processing

    hi,
    I am trying to process multiple xml elements
    <assign name="setinsideattributes">
    <copy>
    <from expression="ora:getElement('Receive_1_Read_InputVariable','BILL','/ns2:BILL/ns2:CMS1500['bpws:getVariableData('iterator')']/ns2:HEADER/ns2:SSN')"/>
    <to variable="ssn"/>
    </copy>
    </assign>
    where iterator is a index variable .
    I am getting into this error .
    Error(48):
    [Error ORABPEL-10039]: invalid xpath expression
    [Description]: in line 48 of "D:\OraBPELPM_1\integration\jdev\jdev\mywork\may10-workspace\multixm-catch\multixm-catch.bpel", xpath expression "ora:getElement('Receive_1_Read_InputVariable','BILL','/ns2:BILL/ns2:CMS1500['bpws:getVariableData('iterator')']/ns2:HEADER/ns2:SSN')" specified in <from> is not valid, because XPath query syntax error.
    Syntax error while parsing xpath expression "ora:getElement('Receive_1_Read_InputVariable','BILL','/ns2:BILL/ns2:CMS1500['bpws:getVariableData('iterator')']/ns2:HEADER/ns2:SSN')", at position "77" the exception is Expected: ).
    Please verify the xpath query "ora:getElement('Receive_1_Read_InputVariable','BILL','/ns2:BILL/ns2:CMS1500['bpws:getVariableData('iterator')']/ns2:HEADER/ns2:SSN')" which is defined in BPEL process.
    [Potential fix]: Please make sure the expression is valid.
    any information on how to fix this .
    thanks in advance

    check out this note here
    http://clemensblog.blogspot.com/2006/03/bpel-looping-over-arrays-collections.html
    hth clemens

  • Array Processing in ABAP

    Hi all,
    I am a total newbie in ABAP.
    I need to process an array in ABAP.
    If it was in .NET C#, it will be like this:
    String strArr = new String[5] { "A", "B", "C", "D", "E" };
    int index = -1;
    for (int i=0; i<strArr.length; i++)
       if (myData.equals(strArr<i>))
            index = i;
            break;
    Can someone please convert the above code into ABAP?
    Urgent. Please help. <REMOVED BY MODERATOR>
    THank you.
    Edited by: Alvaro Tejada Galindo on Feb 22, 2008 5:37 PM

    Hi,
    There is no concept of arrays in ABAP, we use internal tables to hold application data. U can use access internal tables with index.
    Read table itab index l_index this is same as u do in case of arrrays a(l_index)
    Instead use an Internal table to
    populate the values and read them ..
    say your Internal table has a field F1 ..
    itab-f1 = 10.
    append itab.
    clear itab.
    itab-f1 = 20.
    append itab.
    clear itab.
    itab-f1 = 30.
    append itab.
    clear itab.
    Now internal table has 3 values ...
    use loop ... endloop to get the values ..
    loop at itab.
    write :/ itab-f1.
    endloop.
    Also you can do this way:
    IT IS POSSIBLE TO DECLARE THE ONE -DIMENSIONAL ARRAY IN ABAP BY USING INTERNAL TABLES.
    EX.)
    DATA: BEGIN OF IT1 OCCURS 10,
    VAR1 TYPE I,
    END OF IT1.
    IT1-VAR1 = 10.
    APPEND IT1.
    IT1-VAR1 = 20.
    APPEND IT1.
    IT1-VAR1 = 30.
    APPEND IT1.
    LOOP AT IT1.
    WRITE:/ IT1-VAR1 COLOR 5.
    END LOOP.
    <REMOVED BY MODERATOR>
    Cheers,
    Chandra Sekhar.
    Edited by: Alvaro Tejada Galindo on Feb 22, 2008 5:38 PM

  • Array Processing in Forms 6i

    I am developing a common function in a PLL library that requires data from a calling form to be retrieved into temporary arrays on which some processing and calculation takes place and the resultant data is inserted into the destination table.
    In order to do this array manipulation and processing, I know of three options :
    1. Table Type
    2. Record Group
    3. Temporary Tables.
    Which is the best option to use in terms of
    1. Processing speed ,
    2. Client load ,
    3. Server Load,
    4. Multi user processing ,
    5. Re-usability,
    6. Forms 9i compatibility,
    7. Database Interactions
    If there is any other option, apart from the three above, please point out that too. Thanks in advance.

    If you are extracting the data and processing it all from one form, I would use a pl/sql table (Table Type). The coding would be easiest.
    A server side temporary table would give you SQL functionality, but would be much slower than a stand-alone client-side table.

  • ARGB to RGB, array processing performance

    I'm trying to use a 2D picture control to display rapidly changing data - I need a decent frame rate.  I'm using the Cairo graphics library to generate the bitmap I want to display and then using a dll call to LabVIEW:MoveBlock to get it to display.  The bitmap is fairly large (720x1366) but Cairo and the MoveBlock seem pretty efficient and their performance is fine.
    The problem is that I need to convert the frame (a 1D array of U32, representing ARGB) to an array of U8 representing R then G then B. This is then converted to a string and sent to the 2D picture control to display.
    I'm using this VI to do the conversion.
    The ARGB and RGB arrays are preallocated.  However, the performance still sucks.  At the moment I'm getting about 16 frames a second and this section of my main loop is taking four times longer than everything else put together.  All I'm trying to do is strip out the alpha channel!  I've tried using masking and bitshifts rather than the split number blocks - no benefit.  I've tried pulling back the original frame as an array of U8 (A then R then G then B) and then using the decimate array and interleave array blocks to filter out the A bytes.  It was slower.
    Any ideas?
    Luke

    The array going into the shift register is already preallocated to the right size (number of pixels * 3).  The ARGB array is sized to the number of pixels.  I've tried various splitting solutions, but it seems the cost of resizing the array into a linear array so I can convert it into a string to send it to the picture control is too great. 
    Here's the code in context:  The ARGB array is grabbed using MoveBlock, processed to just get the RGB values and then formatted to be sent to the picture control.  The picture control is updated after the frame blank is detected, which just about gives flicker free updating.  The slow bits seem to be processing the ARGB array and passing the array to the picture control.  I've tried grabbing the ARGB as an array of A, R, G and B (ie bytes) but this doesn't yield any speed up.  I've also tried not processing it at all and telling the picture control to expect a color depth of 32 rather than 24, and, whilst this works (not documented... Grr NI Grr)  it isn't any faster and gets the colours wrong...
    All I want to do is put an ARGB array on the screen quickly... how hard can it be??

  • DBMS_SQL array processing - ORACLE 8.0.6

    It's been a while since I've used this.
    DEFINE_ARRAY - the last parameter is "lower bound", which is the starting point. If it's set to 1, rows will be placed in the array starting with 1 and ending with the last row fetched. The entire result set from the EXECUTE appears to be loaded into memory using the array. Fetch 1 will retrieve rows 1 - 10, and put them in array loc. 1 - 10, next fetch will return 11 - 20 and put them in array loc 11-20.
    I don't remember it being this way. Why can I not reset the array, load 10 at a time in array locations 1-10, and re-use 1-10 for each fetch? Will I not eventually blow something up if too much is loaded into the array?
    Also, why would I want to set lower bound to anything other than 1? Why would I want to use -10 to 9, or 0 to 20, or other ranges? What purpose does this capability serve?
    (Of course, back then I used host arrays in PRO*COBOL. It must have been different.)
    Thanks.
    KL

    If you do not care about the rows fetched from a prior call to FETCH, you can do a .DELETE on the collection to remove any existing elements and thus freeing the memory.
    The index positions will still start from the next available index position, so you should use .FIRST and .LAST on the collection.
    If you have a set of queries that you run one after the other and these queries produce the end result in the same format as the previous, then you may want to keep the previous rows in the collection, and start from the next available index.

  • Hung up on array processing in PHP

    If I have a complex array that contains things like this -
    Array
    [0] => Array
    [0] => Array
    [id] => 1234567
    [web_id] => 9876543
    [something_id] => 656f3953bc
    [folder_id] => 0
    [title] => Title 1
    [type] => regular
    [create_time] => Jan 05, 2009 08:39 am
    [1] => Array
    [id] => 234567
    [web_id] => 8765432
    [something_id] => 656f3953bc
    [folder_id] => 5499
    [title] => Title 2
    [type] => regular
    [create_time] => Dec 09, 2008 03:31 pm
    [2] => Array, etc. etc. etc. for another 15 elements
    [1] => Array
    [0] => Array
    [id] => 37214123
    [web_id] => 1234552
    [something_id] => 2750bd5a64
    [folder_id] => 0
    [title] => Title 3
    [type] => regular
    [create_time] => Jan 24, 2009 12:00 am
    [1] => Array
    [id] => 884174
    [web_id] => 477233
    [something_id] => 2750bd5a64
    [folder_id] => 0
    [title] => Title 3
    [type] => 0
    [create_time] => Jan 23, 2009 09:15 pm
    And what I want to do is to step through that inner array,
    either for
    element 1 or element 2, what would be the best way to do
    that? My attempts
    at using foreach() here are not working well!
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================

    That's what I wanted. Seems simple now. What I had to do was
    to strip off
    the outer level array.
    Thanks, Gary!
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "Gary White" <[email protected]> wrote in message
    news:[email protected]..
    > On Mon, 26 Jan 2009 12:34:32 -0500, "Murray *ACE*"
    > <[email protected]> wrote:
    >
    >>And what I want to do is to step through that inner
    array, either for
    >>element 1 or element 2, what would be the best way to
    do that? My
    >>attempts
    >>at using foreach() here are not working well!
    >
    > Huh? What exactly are you trying to do?
    >
    > foreach($myarray as $a){
    > if (is_array($a)){
    > foreach($a as $inner){
    > // whatever
    > }
    > }
    > }
    >
    > Gary

  • PHP & array processing

    Hello,
    Can PHP process more rows in ocifetch ?
    regards

    I did a little testing on Windows 2000 using SQL*Plus and client
    libraries from Oracle 9.2. The DB was a 9.2 release on a remote
    machine.
    The SQL script was:
      connect scott/tiger@mydb
      define AS = 1
      prompt Arraysize &AS
      set arraysize &AS
      set pagesize 0
      set linesize 200
      set termout off
      spool c:\temp\bmsp.log
      timing start
      select * from all_objects order by 1;
      spool off
      set termout on
      timing stopThe PHP file was:
      <?php
      require("ScriptTimer.php");  // from user comments on "microtime" man page
      $pfrc = 1;
      $filename = "c:/temp/bmphp.log";
      $conn = OCILogon('scott', 'tiger', 'mydb');
      Script_Timer::Start_Timer();
      if (!$handle = fopen($filename, 'w')) {
        echo "Cannot open file ($filename)";
        exit;
      $query = 'select * from all_objects order by 1';
      $stid = OCIParse($conn, $query);
      OCIExecute($stid);
      OCISetPrefetch($stid, $pfrc);
      while ($succ = OCIFetchInto($stid, $row)) {
        foreach ($row as $item) {
          fwrite($handle, $item." ");
        fwrite($handle, "\n");
      fclose($handle);
      $total_time = Script_Timer::Get_Time(3);
      echo "$pfrc Time was $total_time\n";
      ?>SQL*Plus 9.2 results:
       Time   Arraysize        
       2.1    1000             
       2.1    500              
       2.1    250              
       3.0    100              
       3.0    50               
       4.1    10               
       9.1    1                 PHP (CLI) 4.3.4 results:
       Time   Prefetchrowcount
       4.5    1000           
       4.5    500            
       4.6    250            
       4.7    100            
       4.8    50             
       5.7    10             
       9.2    1               This was a pretty rudimentary benchmark. There are a lot of areas of
    difference between SQL*Plus and PHP that could be debated and
    examined.
    Overall I'm comfortable that PHP's prefetchrowcount has a positive
    effect.
    -- CJ

  • Lexicographic image processing

    I want to process the array of an image lexicographically (meaning reading as you write, so from left to right). Normal arithmatic functions (division, multiplication etcetera) multiply the entire array, but I want to push the top-left pixel through my algorithm, and then the one to the right of that, and after that one the one to the right of that, up until the last pixel, and then it starts with the pixel one row beneath the first one all the way on the left.
     To illustrate, imagine an image of 12 X 16 pixels:
    I want to calculate what value each pixel is supposed to have. I do this by comparing the actual value with the value I want. I calculate the value it needs to be at a certain pixel by looking at how far it is from the origin. The origin is in the center:
    The distance then from the origin to the actual pixel is this:
    The length of this 'vector' is then calculated by splitting it into a horizontal and vertical part:
    The length is then the the x-coordinate squared and the y-coordinate squared added together and then the root of that number is taken. So that's basically the theorem of Pythagoras. I know that in this case, the length found is not the real length, because you use x=1 and y=1. So first off I subtract 8.5 from the x value and 6.5 from the y-value before going any further.
    But I want to process the pixels in the order of y=1 x = 1, 2, 3, 4, 5, 6, 7, 8 etcetera and then y=2 x=1, 2, 3, 4, 5, 6, 7 etcetera. That is exactly what lexicographical processing is. But how can I get this to work? In my VI you can see how I am currently exporting just the numbers of the total size of the image (or frame of a video), but I want to process them one by one. I looked up some helpful Labview files that do something similar, like the 'Check Pixel Value' VI but there you have to manually scroll through the data. I want it to happen automatically.
    So how can I process pixels of an image lexicographically?
    Solved!
    Go to Solution.
    Attachments:
    USB Webcam n-bit to corrected 1 bit.vi ‏59 KB
    Check Pixel Value-2013.vi ‏31 KB

    Yes, I do have a 2D array. I use the IMAQ Vision VI's to get my webcam to run. The solution is rather simple in that sense, yes.
    But here is the deal though: the comparing with the Lorentzian function returns me a value. That is rounded to either a 0 or a 1, because it will be the pattern used for a Digital Micromirror Device (DMD). This induces an error. In order to make up for that, I need to correct it using neighbouring pictures (if a pixel is surrounded by 8 pixels, then the diagonal pixels are primarily used for this). I tried something similar in which I split it into 'rows' and process that, but that ofcourse removes the option to resolve the induced error.
    The 'easiest' way is to split it into 1024 times 728 pixels and hook all of these up to the formula and connect each of them to their corresponding pixels, but that would take several months, so that's not an option.
    Could you be more concrete in how you would do this? I tried something similar but thought, because of that error resolving, it would remove the option to work in this way, because it doesn't allow 'inter-row interaction'.
    To give you some background:
    I want to use a DMD to create a laser with a top-hat wavefront, meaning it's intensity distribution is equal everywhere on every point of the wavefront. For this we hook a CCD camera up to our computer which measures the intensity distribution. This image is then sent to our Labview program, which processes this image and turns it into a pattern for the DMD. The DMD or Digital Micromirror Device is a device that is made up of thousands of tiny mirrors, all of which can stand in either + 12 degrees or -12 degrees.
    We look at the profile and compare that to a profile as simulted by a Super Lorentzian function
    A Super Lorentzian function looks like this:
    A / (B + ( (X-C)/X0) ^n)) + D
    A/B is the top value
    C is the horizontal transliteration
    X0 is a value referring to the width of the function
    n is a power
    D is vertical transliteration
    For even numbers of n the function produces a top hat function. In our case, we want to simulate an eigth order Super Lorentzian, so n=8
    The image of the CCD Camera is a 12 bit image. Labview saves this as 16 bit, meaning it has 2^16 different grayscale values.
    I don't have the CCD camera yet so for now I use the webcam of my laptop and turn that into a 16-bit image.
    Here a some screenshots of my program so far:
    And a SL function looks like this:
    Our error inducement comes from an algorith developed by Dorrer and Zuegel, two german physicists.
    A screenshot of their paper concerning binary spatial light modulation:
    But the main issue I am concerned with is thus the error inducing. Doesn't normal array processing remove the possibility to do so? And if not, how can I do it?

  • JDBC/OCI8 Array inserts

    Does JDBC/OCI8 support array inserts? I'm familiar with the C/C++ array inserts, but I haven't found anything on array inserting using JDBC/OCI8.
    Array processing gives an application a real performance boost and I was hoping to use it in Java.

    Hi ,
    I am facing the same problem with
    Oracle 8.1.5 on Windows NT.
    Driver : 8.1.6 JDBC OCI Driver
    JDK 1.2.2
    Any workaround / patch to solve this problem please ?
    Thanks,
    Shubhada

  • Obtain Param Array using SELECT SQL statement

    Hi,
    I was trying to use array processing to fetch an array of data from a database. Here is the problem I am facing (I am new to this, so I am sorry if I am doing something silly):
    I am using the following statements in C++:
    OParamArray idParam;
    OParamArray colorParam;
    OParameterCollection paramCol = odb.GetParameters();
    idParam= paramCol.AddTable("idParam",OPARAMETER_OUTVAR,OTYPE_NUMBER,100,10);
    colorParam= paramCol.AddTable("colorParam",OPARAMETER_OUTVAR,OTYPE_VARCHAR2,100,10);
    oresult res1 = odb.ExecuteSQL("select :idParam=MYID, :colorParam=COLOR from MYTABLE"); // MYID and COLOR are the column names
    But after the "ExecuteSQL" call when I check for the values in idParam and miColorParam, I find no values....
    What am I doing wrong? How do I use the SELECT statement with Array Parameters?
    Thanks in advance.
    Gopinath

    prepare:
    copy:
    build:
    [javac] Compiling 1 source file to C:\jwsdp-1.3\garland\build\WEB-INF\classe
    s
    [javac] C:\jwsdp-1.3\garland\src\LogonBean.java:20: cannot resolve symbol
    [javac] symbol : variable data
    [javac] location: class logonApp.LogonBean
    [javac] String SQLState2 = "SELECT PASSWORD FROM MASTER WHERE PASSWORD L
    IKE '"+data+"' ";
    [javac]
    ^
    [javac] C:\jwsdp-1.3\garland\src\LogonBean.java:79: cannot resolve symbol
    [javac] symbol : variable SQLState1
    [javac] location: class logonApp.LogonBean
    [javac] rs = stmt.executeQuery(SQLState1);
    [javac] ^
    [javac] 2 errors
    Thats the compiler error, but it still works on a normal java file. ill try a prepared statement in the mean time.
    ChrisG

  • Array Insert/Update/Select in JDBC

    I've been using array processing in ODBC, OCI, and Pro*C for years and desperately need to do so in JDBC. I've thus far been unsuccessful and am beginning to doubt that it's supported which to me is unfathomable. I've likewise found many like inquiries on the net - none of which were addressed. There have been many respondants who don't undertstand what array processing is and mistake it for batch SQL statements. They are not the same. Batched SQL statements are seperate statements which are executed in a single call to the database engine. What I'm taking about is using a prepared statement and binding primitive arrays to the statement. A single statement is executed and the contents of the arrays passed to the database. I've conducted tests years ago and array insert/update is many times faster than batch statements. Does anyone know whether or not JDBC supports array processing? If anyone's interested, I can provide snippets via email which illustrate how this is done in ODBC and other API's.
    Thanks.

    You referred me to
    http://java.sun.com/products/jdbc/download.html. The
    only reference I found to arrays were SQL Arrays - not
    what I'm talking about. See prior C/ODBC snippet. Do
    you know how to do this in JDBC?You are talking about passing an array as a single parameter to and from the underlying database correct? (And that has nothing to do with batch processing.)
    If so in section 16.4 "Array Object"..... looking at that section gives the following reference....
    The Array object returned to an application by the ResultSet.getArray and
    CallableStatement.getArray methods is a logical pointer to the SQL ARRAY
    value in the database; it does not contain the contents of the SQL ARRAY value.
    The above has nothing to do with batch processing (although presumably one could use it in a batch process but then one can use String as well.)
    Of course perhaps there is something in there that says that only applies to batch processing. If so could you please point out the section and quote the text.

  • Fill array is to slow

    hello,
    in the attachement there is an example.
    in this example i've got an array where i want to insert values at column 4.
    the attached vi works, but my array can contain 40000 rows.
    this takes minutes for the calculation.
    is there a way to make this vi faster?
    markus
    Attachments:
    Test.vi ‏24 KB

    Yes for speed purposes, you should initialize an array and index calculate and replace elements in a loop. This looks less elegent than just calculating and building an array but is much faster since you are not reallocating memory and copying the array as much. The downfall is that you will have to preallocate a known amount of memory for the array when initialized. You give up the nice dynamic nature of array processing but will get a speed boost in return. You also sometimes have to allocate large amounts of memory to make sure that you have enough room in your array to store all your points but memory is practically free (for most arrays you still only need a few MB at most). Also make sure you are optimized in your processing algorithms (ie move any calculations which are constant in respect to index outside of the calculation loop). One final trick which is possible on hyperthreaded systems (Newer CPU & LV 7.1+) is to split your array in to two parts and process each half in its own parallel loop. Warning that a non hyperthreaded complient system will take a speed hit (might be significant) since there will be a large amount of context switching added to your overhead. In the near future we will be seeing a greater degree of multithreaded and multi-core CPU becoming mainstream so you can keep this in mind if you are developing longterm applications. (if all else fails you can write the process algorithm in c++ and call the .dll from labview, but I will probably be ousted from the Labview community for suggesting such a 'stupid' fix).
    -Paul
    Paul Falkenstein
    Coleman Technologies Inc.
    CLA, CPI, AIA-Vision
    Labview 4.0- 2013, RT, Vision, FPGA

  • Populate field1 in table, based on dropdown value of a field2 in same row

    Hi Experts,
    I have created an offline interactive Adobe form and need help with java-script on events. I will describe my scenario below -
    I have written an SE38 report program which will generate the PDF. To pre-populate fields in the PDF, I have a structure Default_Values which has a few internal tables. One of the internal tables Employees has 2 fields Emp_Code and Emp_Name. I have written code to obtain a list of employees and populate this internal table Empoyees. I call the Adobe form and along with other parameters, pass this structure Default_Values. Thus all the default values along with the internal table Employees pre-populated with the Employee Code and Employee Names have been passed to the Context.
    In the Adobe form I have a table with 10 lines with Employee details (6 columns, 2 of which are Emp_Code and Emp_Name)
    In this table control, the column Employee Name is a drop down list. For this column, under List Items, I have created a binding to the internal table Employees with default values. This binding Items looks like this - $record.DEFAULT_VALUES.EMPLOYEES.DATA[*] with Item Text and Item Value having the value EMP_NAME.
    When I test the form, I can see all the Employee Names in the drop down list in the column Employee Name of the table control.
    My requirement is that when a user selects an Employee Name from the drop-down list, the field Emp_Code for that row in the table control should be automatically populated with the corresponding value of Emp_Code  depending on the Emp_Name which the user has selected.
    I am new to Java-scripts and Adobe forms. I have searched this and other forums, however I couldn't find the right code which I can place in either the Change or Exit event of the drop-down to accomplish this.
    Can someone please provide me with sample code to achieve this.
    Any help will be greatly appreciated.
    Thanks in advance.
    Regards,
    Neha

    Hi Neha,
    I would prefer not to use FormCalc for this requirement.
    Array Processing shall be done in Java Scripting and you simply cannot have two different scripting language elements in the same scripting block.
    First create a table type parameter in the interface or GT_* type in Global variable and pass all the necessary entries of dropdown to the table type parameter. Once included in the context it shall be available in your data view of the form.
    To access any repeating instance node of the form in the data view, use te following script -
    var theFields = xfa.resolveNodes(
                      "xfa.datasets.data.data.CUSTOMERS.DATA[*].NAME");
    assuming that you have a table named CUSTOMERS in the Data View.
    For more details on XFA Data Model refer to
    [http://help.adobe.com/en_US/livecycle/es/lcdesigner_scripting_reference.pdf]
    Hope these inputs help.
    Regards,
    Rohit

Maybe you are looking for

  • How can I get a list of DSNs currently registered?

    Hi everybody, Can anyone tell me how to obtain a list of the DSNs currently registered on my machine using Java? I want to populate a drop-down list for the user (an administrator) to select the requisite DSN to work with. I realise that this is prob

  • Need help with automating text import/pasting/macro between Photoshop and Excel

    Hey everyone, I'm working on a large project now that seems extremely daunting, but I was hoping there would be some way to automate it using either Actions or some sort of macro program.  Here's the gist: I've created a template with 24 differently

  • How use my apple tv like second  monitor

    how use my apple tv like second  monitor some very help me

  • STRANGE BEHAVIOR OF NVL

    Hi everybody, Can you please explain me this strange behavior of NVL function: SQL> select nvl(10000,'none') from dual; select nvl(10000,'none') from dual ERROR at line 1: ORA-01722: invalid number SQL> select nvl('none',10000) from dual; NVL( none C

  • OBIEE 11g URL not working

    hi every one, I got a problem regarding my presentation services they are upend running and all the opmnctl files are all alive but my url is not working http://VAMSHI-PC:7001/analytics or any other em , console etc i waiting like 15min and tried the