Found character data inside an array element while deserializing

Hi Experts,
When I am trying to execute the webservice I am getting the following error
Found character data inside an array element while deserializing
Actual structure is as follows
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://10.1.2.21:8090/axis/services/InventoryManager" targetNamespace="http://10.1.2.21:8090/axis/services/InventoryManager">
<xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
<xsd:element xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns="" name="retrieveInventoryRequest" type="retrieveInventoryRequest" />
<xsd:complexType xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" name="ArrayOf_xsd_string">
<xsd:complexContent>
<xsd:restriction base="soapenc:Array">
<xsd:attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:string[]" />
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" name="ArrayOf_tns1_SkuQuantity">
<xsd:complexContent>
<xsd:restriction base="soapenc:Array">
<xsd:attribute ref="soapenc:arrayType" wsdl:arrayType="tns1:SkuQuantity[]" />
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
</xsd:schema>
I know XI doesnt support array types thats why I have created my own structure as follows
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="retrieveInventory" type="InvArray" />
<xsd:complexType name="InvArray">
<xsd:sequence>
<xsd:element name="pOutletList" type="xsd:string" maxOccurs="unbounded" form="qualified" />
<xsd:element name="pSkuQuantityList" type="xsd:string" maxOccurs="unbounded" form="qualified" />
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
This webservice takes input like
storenumber1;storenumner2....
item1,qty;item2,qty.
I am passing values like this to my webservice. But still I am getting the same probl

The problem doesn't seem to be related to the XI system. Have you done any configuration at receiver Webservice to convert the string data passed through XI into string array data? I think there is a mismatch in what XI sends and receiver expects.
Regards,
Prateek

Similar Messages

  • How to put data into a array element in the BPEL

    Hi,
    I have a element in the WSDL which is of type Array. (i.e accepts unlimited data for the same element). How should i put a data into a array in the BPEL.
    Example:
    The below Example gives u an idea about wht iam asking:pasting a piece of my requirement:
    <s:element minOccurs="0" maxOccurs="1" name="parameters" type="tns:ArrayOfCSParameters" />
    <s:complexType name="ArrayOfCSParameters">
    <s:sequence>
    <s:element minOccurs="0" maxOccurs="unbounded"
    name="CSParameters" nillable="true" type="tns:CSParameters" />
    </s:sequence>
    </s:complexType>
    <s:complexType name="CSParameters">
    <s:sequence>
    <s:element minOccurs="0" maxOccurs="1" name="RevenueItem" type="tns:RevenueItem" />
    <s:element minOccurs="0" maxOccurs="1" name="AccountURIs" type="tns:ArrayOfString" />
    <s:element minOccurs="0" maxOccurs="1" name="GroupURIs" type="tns:ArrayOfString" />
    <s:element minOccurs="1" maxOccurs="1" name="Percentage" nillable="true" type="s:decimal" />
    </s:sequence>
    <s:attribute name="Version" type="s:decimal" use="required" />
    <s:attribute name="URI" type="s:string" />
    </s:complexType>
    Any suggestion is appreciated.
    Regards
    pavan

    You have 2 options i guess.
    Use the transformation and the for-each to construct the array-list
    or like Richard said, use a loop in bpel, assign in the loop an variable of element type="CSParameters" and append this variable to your variable with accepts the arraylist.

  • How to set the value of an array element (not the complete array) by using a reference?

    My situation is that I have an array of clusters on the front panel. Each element is used for a particular test setup, so if the array size is three, it means we have three identical test setups that can be used. The cluster contains two string controls and a button: 'device ID' string, 'start' button and 'status' string.
    In order to keep the diagrams simple, I would like to use a reference to the array as input into a subvi. This subvi will then modify a particular element in the array (i.e. set the 'status' string).
    The first problem I encounter is that I can not select an array element to write to by using the reference. I have tried setting the 'Selection s
    tart[]' and 'Selection size[]' properties and then querying the 'Array element' to get the proper element.
    If I do this, the VI always seems to write to the element which the user has selected (i.e. the element that contains the cursor) instead of the one I am trying to select. I also have not found any other possible use for the 'Selection' properties, so I wonder if I am doing something wrong.
    Of course I can use the 'value' property to get all elements, and then use the replace array element with an index value, but this defeats the purpose of leaving all other elements untouched.
    I had hoped to use this method specifically to avoid overwriting other array elements (such as happens with the replace array element) because the user might be modifying the second array element while I want to modify the first.
    My current solution is to split the array into two arrays: one control and one indicator (I guess that's really how it should be done ;-) but I'd still like to know ho
    w to change a single element in an array without affecting the others by using a reference in case I can use it elsewhere.

    > My situation is that I have an array of clusters on the front panel.
    > Each element is used for a particular test setup, so if the array size
    > is three, it means we have three identical test setups that can be
    > used. The cluster contains two string controls and a button: 'device
    > ID' string, 'start' button and 'status' string.
    >
    > In order to keep the diagrams simple, I would like to use a reference
    > to the array as input into a subvi. This subvi will then modify a
    > particular element in the array (i.e. set the 'status' string).
    >
    It isn't possible to get a reference to a particular element within an
    array. There is only one reference to the one control that represents
    all elements in the array.
    While it may seem better to use references to update
    an element within
    an array, it shouldn't really be necessary, and it can also lead to
    race conditions. If you write to an element that has the
    possibility of the user changing, whether you write with a local, a
    reference, or any other means, there is a race condition between the
    diagram and the user. LV will help with this to a certain extent,
    especially for controls that take awhile to edit like ones that use
    the keyboard. In these cases, if the user has already started entering
    text, it will not be overwritten by the new value unless the key focus
    is taken away from the control first. It is similar when moving a slider
    or other value changes using the mouse. LV will write to the other values,
    but will not rip the slider out of the user's hand.
    To completely avoid race conditions, you can split the array into user
    fields and indicators that are located underneath them. Or, if some
    controls act as both, you can do like Excel. You don't directly type
    into the cell. You choose w
    hich cell to edit, but you modify another
    location. When the edit is completed, it is incorporated into the
    display so that it is never lost.
    Greg McKaskle

  • How do I put and sort string data into an array?

    I have a txt file that has the following sample data:
    Sample.txt----
    Jones Bill 12,500 Salesperson
    Adams Frank 34,980 Manager
    Adams John 23,000 Salesperson
    Thompson Joe 59,500 Trainee
    I need to incorporate each line of data into an individual array element, while using a user-defined method
    (ex. setAllValues(String last, String first, String salary, String job)
    How do I loop the data into the array to be displayed and what is the best way to do sorts on this sample data. Any code or clues would be super helpful.
    Sanctos

    If you set up an array of Strings you can use the java.util.Arrays.sort() method to sort it. If you need to sort arbitrary Objects (i.e. your 3 strings as a whole entity) your 3-way object will have to either implement Comparable or you could write a Comparitor class to do the ordering. Not much to it, though.
    Dom.

  • In LabVIEW6i, is there a way to make particular elements of an array invisible while the others stay visible (without losing any element's info.)?

    I have an array of clusters. Each cluster pertains to a certain oscilloscope I am controlling. There is another control which specifies which oscilloscopes I have "on".
    If a particular oscilloscope is "on" I want its cluster to be VISIBLE in the array. If a particular oscilloscope is "off" I want its cluster to be INVISIBLE in the array.
    How can I implement this in my program without losing ANY of the info. in my array?

    I suggest to use two arrays; one for user interface holding the ON clusters,
    and one for internal use holding all clusters. The diagram periodically
    updates the internal array with user interface array data.
    By INVISIBLE do you mean "skipped from the array" or displayed as an empty
    placeholder? To hide an OFF cluster you could put in the cluster a flat
    button boolean that is small and transparent when ON and large enough to
    cover the whole cluster area (and other controls) when OFF.
    Jean-Pierre Drolet
    Scientech R&D
    "mcmastal" a écrit dans le message news:
    [email protected]..
    > In LabVIEW6i, is there a way to make particular elements of an array
    > invisible while the others stay visible (without losing any element's
    > info.)?
    >
    > I have an array of clusters. Each cluster pertains to a certain
    > oscilloscope I am controlling. There is another control which
    > specifies which oscilloscopes I have "on".
    > If a particular oscilloscope is "on" I want its cluster to be VISIBLE
    > in the array. If a particular oscilloscope is "off" I want its
    > cluster to be INVISIBLE in the array.
    > How can I implement this in my program without losing ANY of the
    > info. in my array?
    LabVIEW, C'est LabVIEW

  • Error while assigning dates to associative array of date type

    Hi All,
    I am facing the issue while assigning dates to associative array of date type:
    Oracle Version:
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bi
    PL/SQL Release 10.2.0.1.0 - Production
    CORE    10.2.0.1.0      Production
    TNS for Linux: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    Stored procedure i am trying to write is as following
    create or replace procedure jp1 (
    p_start_date date default trunc(sysdate,'MM')
    , p_end_date date default trunc(sysdate)
    is
    l_no_of_days number;
    type t_date_id is table of date
    index by pls_integer;
    l_date_id_arr t_date_id;
    begin
    l_no_of_days := p_end_date - p_start_date;
    for i in 0
    .. l_no_of_days - 1
    loop
        l_date_id_arr := p_start_date + i;
        dbms_output.put_line(p_start_date + i);
    end loop;
    end;
    I am getting error at line 14 while compiling this. and the error message is as following:
    Errors for PROCEDURE JP1:
    LINE/COL ERROR
    14/5     PL/SQL: Statement ignored
    14/22    PLS-00382: expression is of wrong type
    So while investigating this i tried to output the value of (p_start_date + i) using dbms_output.put_line and the output is date itself.
    create or replace procedure jp1 (
    p_start_date date default trunc(sysdate,'MM')
    , p_end_date date default trunc(sysdate)
    is
    l_no_of_days number;
    type t_date_id is table of date
    index by pls_integer;
    l_date_id_arr t_date_id;
    begin
    l_no_of_days := p_end_date - p_start_date;
    for i in 0 .. l_no_of_days-1
    loop
        --l_date_id_arr := p_start_date + i;
        dbms_output.put_line(p_start_date + i);
    end loop;
    end;
    output of the
    exec jp1
    is as following:
    01-DEC-13
    02-DEC-13
    03-DEC-13
    04-DEC-13
    05-DEC-13
    06-DEC-13
    07-DEC-13
    08-DEC-13
    09-DEC-13
    10-DEC-13
    11-DEC-13
    12-DEC-13
    13-DEC-13
    14-DEC-13
    15-DEC-13
    16-DEC-13
    17-DEC-13
    18-DEC-13
    I see the output as date itself. so why it is throwing error while assigning the same to associative array of date type.
    I tried to google also for the same but to no avail.
    Any help in this regard is appreciated or any pointer some other thread on internet or in this forum.
    Thanks in advance
    Jagdeep Sangwan

    Read about associative arrays :
    create or replace procedure jp1 (
    p_start_date date default trunc(sysdate,'MM')
    , p_end_date date default trunc(sysdate)
    ) is
    l_no_of_days number;
    type t_date_id is table of date
    index by pls_integer;
    l_date_id_arr t_date_id;
    begin
    l_no_of_days := p_end_date - p_start_date;
    for i in 0..l_no_of_days - 1
    loop
        l_date_id_arr(i) := p_start_date + i;
        dbms_output.put_line(p_start_date + i);
    end loop;
    end;
    Ramin Hashimzade

  • Error while retrieving data from an ARRAY resultset

    We hava an Oracle stroed procedure which has a table type as its OUT parameter and where the data is being entered into. This data requries to be returned to the Java client through a JDBC connection. We have used the OracleTypes' ARRAY object for this. We are facing errors when retieving data from the ARRAY resultset
    The Oracle Package
    ----I created a table type called "PlSqlTable":
    CREATE OR REPLACE TYPE PlSqlTable IS TABLE OF VARCHAR2(20);
    ----I defined this as the out parameter for my procedure :
    PROCEDURE testSQL
    arrayOutID OUT PlSqlTable
    Then populated the object :
    arrayOutID := PlSqlTable();
    arrayOutID.extend(4);
    arrayOutID(1):= 'Hello';
    arrayOutID(2) := 'Test';
    arrayOutID(3) := 'Ora';
    ----The procedure executes fine - all debug statements are printed ----right till the end of execution.
    The Java class
    ----Here is how I have defined the parameters :
    OracleCallableStatement stmnt = (OracleCallableStatement)connection.prepareCall("begin testSQL(?);end;");
    stmnt.registerOutParameter(2,OracleTypes.ARRAY,"PLSQLTABLE");
    System.out.println("Executing..");
    stmnt.execute();
    System.out.println("Executed..");
    ARRAY outArray = stmnt.getARRAY(1);
    System.out.println("Got array");
    ResultSet rset = outArray.getResultSet();
    System.out.println("Got Resultset..");
    int i = 1;
    while(rset.next()){
    System.out.println("VALUE : " + rset.getString(i));
    i = i+1;
    ----On execution, the debug messages display :
    Executing..
    Executed..
    Got array
    Got Resultset..
    VALUE : 1
    VALUE : Test
    ERROR : java.sql.SQLException: Invalid column index
    ----But I have populated upto 3 values in th e procedure. Then why this error ?
    PLLLEEEASE help me out on this.
    Thanks, Sathya

    haven't worked with db arrays but I think your problem is here:int i = 1;
    while(rset.next()){
         System.out.println("VALUE : " + rset.getString(i));
         i = i+1;
    }In the first loop you are retrieving the value from column 1(rs.getString(1)), which is OK, but in the second loop, you are trying to retrieve a value from the second column(rs.getString(2)) which doesn't exist. Try this code which only reads from column1:
    while(rset.next()){
         System.out.println("VALUE : " + rset.getString(1));
    }Jamie

  • Type defined array of clusters for holding configuration data - setting default values for each array element

    Hi,
    I was wondering if I could get some information and opinions about using a type defined array of clusters to hold configuration data.  I am creating a program to test multiple DUTs and wanted to have a type defined control for each DUT containing the information needed to create the DAQmx tasks for all of the signals for that DUT.  I am wanting to do this so that the data is hard-coded and not in a file that the user could mess up.
    The type def controls are then put in a subVI that chooses the appropriate one based on the DUT Type enumeration wired to a case structure.  
    I am having problems with the type defined control.  I am seeing issues when attempting to save a unique configuration to each array element in the array of clusters.  Somehow it worked to begin with, but now clicking "Data Operations --> Make Current value default" on individual elements of the cluster or the entire cluster (array element) is not saving the data when I re-open the type def control.  What am I doing wrong?  Am I trying to do something with arrays of clusters that I should not be doing?
    I have attached one of the type defined controls for reference.  I tried changing it to Strict to see if that helped, but no luck.
    To reproduce, change the resource string for array element 0 and make the new value the default value.  Then close the type def, and re-open it.  The old value is still present in that element.  The VI is saved in LabVIEW 2012.
    Solved!
    Go to Solution.
    Attachments:
    CM_AnalogInputs.ctl ‏11 KB

    Values of a typedef are not proprigated to instances of the control. THey will pick it up if created AFTER the data values have been changed. THey will not get updated with future changes. You should either create a VI specifically for hardcoding your values or implement a file based initialization. The file based would be much better and more flexible. If you don't want users to modify the data simply encrypt it. There is a noce blowfish library you can download.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • How can I set the caption text of picture controls inside an array or how can I choose which array element is assigned using the array elements caption text property.

    I have 8 picture controls inside an array and I would like to set the caption text of these controls.
    I have used the property node of the array and used the array elements property caption text to set the text.
    The problem is however that I set the same text to all the picture controls inside the array.
    My question is how to set caption text of specific elements (Picture control) that I have so far only been able to access using the array elements caption text property.

    Some more help
    1 You could use the caption of the array and place it in front of the selected picture and update that using property nodes.
    2 Like Norbett said if you use a cluster of pictures then their caption can be updated individually.
    Here is a an example that demonstrates the above
    David
    Attachments:
    Modify the Captions Of Pictures.vi ‏83 KB

  • Found Stale Data Exception while Editing User form & process form

    Found Stale Data Exception only when I try to edit a set of 40 users that I created long ago. The other users are fine - they are getting provisioned and created in OIM. Has any body has an idea as to why this error is coming? and how to resolve as it is coming only for a limited set of users. ???
    ERROR [ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)' XELLERATE.WEBAPP - Class/Method: tcManageUserAction/editUser encounter some problems: {1}
    Thor.API.Exceptions.tcStaleDataUpdateException
         at com.thortech.xl.ejb.beansimpl.tcUserOperationsBean.updateUserData(Unknown Source)
         at com.thortech.xl.ejb.beansimpl.tcUserOperationsBean.updateUser(Unknown Source)
         at com.thortech.xl.ejb.beans.tcUserOperationsSession.updateUser(Unknown Source)
         at com.thortech.xl.ejb.beans.tcUserOperations_voj9p2_EOImpl.updateUser(tcUserOperations_voj9p2_EOImpl.java:3474)
         at Thor.API.Operations.tcUserOperationsClient.updateUser(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at Thor.API.Base.SecurityInvocationHandler$1.run(Unknown Source)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(Unknown Source)
         at weblogic.security.Security.runAs(Security.java:41)
         at Thor.API.Security.LoginHandler.weblogicLoginSession.runAs(Unknown Source)
         at Thor.API.Base.SecurityInvocationHandler.invoke(Unknown Source)
         at $Proxy59.updateUser(Unknown Source)
         at com.thortech.xl.webclient.actions.tcManageUserAction.editUser(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:280)
         at com.thortech.xl.webclient.actions.tcLookupDispatchAction.execute(Unknown Source)
         at com.thortech.xl.webclient.actions.tcActionBase.execute(Unknown Source)
         at com.thortech.xl.webclient.actions.tcAction.execute(Unknown Source)
         at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
         at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at com.thortech.xl.webclient.security.SecurityFilter.doFilter(Unknown Source)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3496)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(Unknown Source)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2180)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2086)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    ERROR [ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)' XELLERATE.WEBAPP - Class/Method: tcManageUserAction/editUser encounter some problems: {1}
    Thor.API.Exceptions.tcStaleDataUpdateException
         at com.thortech.xl.ejb.beansimpl.tcUserOperationsBean.updateUserData(Unknown Source)
         at com.thortech.xl.ejb.beansimpl.tcUserOperationsBean.updateUser(Unknown Source)
         at com.thortech.xl.ejb.beans.tcUserOperationsSession.updateUser(Unknown Source)
         at com.thortech.xl.ejb.beans.tcUserOperations_voj9p2_EOImpl.updateUser(tcUserOperations_voj9p2_EOImpl.java:3474)
         at Thor.API.Operations.tcUserOperationsClient.updateUser(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at Thor.API.Base.SecurityInvocationHandler$1.run(Unknown Source)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManage
    Thanks,
    - oidm

    Stale data exception means something has changed about the user when you are updating them. So if you get a result set that has 50 users in it, then you go through each row and update, you will get this error because you have modified the over all result set.
    You need to do a findUsers for each user row, and then perform the update on that result set. Then move on to the next user and do the same thing. Don't update a result set that has more than 1 row.
    -Kevin

  • Deleting array elements

    Hi!
    I have a problem with my program. i have an array and in this array a several numbers. With the "In Range and Coerce" function i want to prove if the the array element is inside or outside of my limitations. If my array element is in the outside of my limitation, the code in the case structure should delete this element.
    I need this program, because the array is displayed on a graph and i want only display the date, which is in the limitations.
    I hope somebody could help me!
    Best regards,
    Peter
    Labview 7.1 on Windows 2000
    Attachments:
    array.jpg ‏54 KB

    Hallo Peter
    Das Problem tritt auf, weil du immer wieder das selbe Array liest.
    Die Knoten am Loop sollten Shift-Register sein, damit das Array, bei dem das Element gelöscht wurde, bei der nächsten Iteration gelesen wird. Allerdings musst du dann auf einen While-Loop umstellen, da du ansonsten Elemente lesen willst, die es im Array nicht mehr gibt.
    Anbei eine mögliche Lösung.
    Hoffe es hilft weiter.
    Thomas
    Using LV8.0
    Don't be afraid to rate a good answer...
    Attachments:
    RemoveElements.vi ‏32 KB

  • Accessing a user array elements in Captivate 6

    Hi guys I have a piece of code that's not working I was hoping someone had any clue as to why, I've wasted too many hours trying to figure this out.  Here's the code, explanation below.
    var objCP = document.Captivate;
    objCP.cpEISetValue("m_VarHandle.questionList", new Array(7));
    objCP.cpEISetValue("m_VarHandle.questionList[0]", 1);
    objCP.cpEISetValue("m_VarHandle.questionList[1]", 2);
    objCP.cpEISetValue("m_VarHandle.questionList[2]", 1);
    objCP.cpEISetValue("m_VarHandle.questionList[3]", 2);
    objCP.cpEISetValue("m_VarHandle.questionList[4]", 1);
    objCP.cpEISetValue("m_VarHandle.questionList[5]", 2);
    var cat1Len = 0;
    var cat2Len = 0;
    for (var i=0;i<objCP.cpEIGetValue("m_VarHandle.questionList.length");i++){
    var value = objCP.cpEIGetValue("m_VarHandle.questionList[i]");
    if (value == 1)
       {cat1Len++;}
    if (value) == 2)
       {cat2Len++;}
    alert(i);
    alert(objCP.cpEIGetValue("m_VarHandle.questionList[2]"));
    alert(value);
    I'm attempting to create a list using a captivate variable I've created called "questionList".
    I fill questionList with data and and then use that data to count, in this instance with cat1Len and cat2Len.
    After that I attempt to verify that the data is being returned correctly with a series of alerts.
    Here's the problem:
    alert(i) correctly reports the number my incrementer should be at.
    alert(objCP.cpEIGetValue("m_VarHandle.questionList[2]")) correctly reports the data in cell [2] of questionList
    but...
    alert(value) reports undefined.  How can this be? I know that I can access array elements from inside this loop and I know that I my incrementer is at the correct location so what's the deal?
    Thanks for any help!

    should be:
    var objCP = document.Captivate;
    objCP.cpEISetValue("m_VarHandle.questionList", new Array(7));
    objCP.cpEISetValue("m_VarHandle.questionList[0]", 1);
    objCP.cpEISetValue("m_VarHandle.questionList[1]", 2);
    objCP.cpEISetValue("m_VarHandle.questionList[2]", 1);
    objCP.cpEISetValue("m_VarHandle.questionList[3]", 2);
    objCP.cpEISetValue("m_VarHandle.questionList[4]", 1);
    objCP.cpEISetValue("m_VarHandle.questionList[5]", 2);
    var cat1Len = 0;
    var cat2Len = 0;
    for (var i=0;i<objCP.cpEIGetValue("m_VarHandle.questionList.length");i++){
    var value = objCP.cpEIGetValue("m_VarHandle.questionList["+i+"]");
    if (value == 1)
       {cat1Len++;}
    if (value) == 2)
       {cat2Len++;}
    alert(i);
    alert(objCP.cpEIGetValue("m_VarHandle.questionList[2]"));
    alert(value);
    i is only defined local to the javascript eval, not a global variable.  You have to pass the value, not the name of the index...
    (I just realized that this question was from 2012, but maybe it might still benefit someone...  I saw it while I was looking for something else)

  • Retrieve captivate array elements in Captivate 6

    Hi guys I have a piece of code that's not working I was hoping someone had any clue as to why, I've wasted too many hours trying to figure this out.  Here's the code, explanation below.
    var objCP = document.Captivate;
    objCP.cpEISetValue("m_VarHandle.questionList", new Array(7));
    objCP.cpEISetValue("m_VarHandle.questionList[0]", 1);
    objCP.cpEISetValue("m_VarHandle.questionList[1]", 2);
    objCP.cpEISetValue("m_VarHandle.questionList[2]", 1);
    objCP.cpEISetValue("m_VarHandle.questionList[3]", 2);
    objCP.cpEISetValue("m_VarHandle.questionList[4]", 1);
    objCP.cpEISetValue("m_VarHandle.questionList[5]", 2);
    var cat1Len = 0;
    var cat2Len = 0;
    for (var i=0;i<objCP.cpEIGetValue("m_VarHandle.questionList.length");i++){
    var value = objCP.cpEIGetValue("m_VarHandle.questionList[i]");
    if (value == 1)
       {cat1Len++;}
    if (value) == 2)
       {cat2Len++;}
    alert(i);
    alert(objCP.cpEIGetValue("m_VarHandle.questionList[2]"));
    alert(value);
    I'm attempting to create a list using a captivate variable I've created called "questionList".
    I fill questionList with data and and then use that data to count, in this instance with cat1Len and cat2Len.
    After that I attempt to verify that the data is being returned correctly with a series of alerts.
    Here's the problem:
    alert(i) correctly reports the number my incrementer should be at.
    alert(objCP.cpEIGetValue("m_VarHandle.questionList[2]")) correctly reports the data in cell [2] of questionList
    but...
    alert(value) reports undefined.  How can this be? I know that I can access array elements from inside this loop and I know that I my incrementer is at the correct location so what's the deal?
    Thanks for any help!

    should be:
    var objCP = document.Captivate;
    objCP.cpEISetValue("m_VarHandle.questionList", new Array(7));
    objCP.cpEISetValue("m_VarHandle.questionList[0]", 1);
    objCP.cpEISetValue("m_VarHandle.questionList[1]", 2);
    objCP.cpEISetValue("m_VarHandle.questionList[2]", 1);
    objCP.cpEISetValue("m_VarHandle.questionList[3]", 2);
    objCP.cpEISetValue("m_VarHandle.questionList[4]", 1);
    objCP.cpEISetValue("m_VarHandle.questionList[5]", 2);
    var cat1Len = 0;
    var cat2Len = 0;
    for (var i=0;i<objCP.cpEIGetValue("m_VarHandle.questionList.length");i++){
    var value = objCP.cpEIGetValue("m_VarHandle.questionList["+i+"]");
    if (value == 1)
       {cat1Len++;}
    if (value) == 2)
       {cat2Len++;}
    alert(i);
    alert(objCP.cpEIGetValue("m_VarHandle.questionList[2]"));
    alert(value);
    i is only defined local to the javascript eval, not a global variable.  You have to pass the value, not the name of the index...
    (I just realized that this question was from 2012, but maybe it might still benefit someone...  I saw it while I was looking for something else)

  • Find and replace several array elements

    I have a 2d array and want to subsitute any negitive value with a marker e.g "**" or any indicator which would be identified easily. I am using Labview 5.1

    Hi,
    The data type of you array is probably numerical. If you haven't already
    done this, the first step would be to convert the data to a character
    data type. This is easy done with 'Number to Decimal String'. Tie the
    output to a 'For Loop' and the search and modify each element in the
    array using a combination of 'Search 1D Array', 'Replace Array Subset',
    and shift registers.
    The first iteration of the 'For Loop' will give you the first index of
    the first '-1' found. Use that index value to replace the the '-1' with
    your '**'. Increment the index and pass it to the shift register to use
    as a starting point for the next interation's search and replace process.
    There may be a more "packaged" way of doing this but I just love For
    Loops.
    Hope this helps ...
    - Kevin
    In article <[email protected]>,
    "Gorelick" wrote:
    > I have a 2d array and want to subsitute any negitive value with a marker
    > e.g "**" or any indicator which would be identified easily. I am using
    > Labview 5.1

  • Reference to Array of Clusters with an array element

    Hi,
    I have an array of clusters CONTROL (calling it as "top level cluster array") with one of the cluster elements being a cluster array (please see attached).
    I plan to pass "Reference" of this top level cluster to different VIs (like add element VI, insert element VI, delete element VI etc) and access (add/modify delete) the elements in this array.
    In my code, how do I typecast the Array Element (cluster) to the inner cluster (as shown in the figure) ?
    I am using LV RT on PXI.
    Solved!
    Go to Solution.

    You cannot use references in the same way that you use pointers around in C. LabVIEW does not manage memory in the same way that C does. This is actually a good thing, though C programmers find it "cumbersome" or "restrictive". I have also programmed in C, and frankly I prefer LabVIEW's memory management any day of the week.
    You had not initially mentioned that this was going to be done in multiple places at (potentially) the same time. Given that, my recommendation is to look into using Action Engines. They provide a means of basically providing a one-location acccess for your data. By using a single VI to access/modify your data you preclude the generation of race conditions. You may also want to join this with the concept of using variants to provide a means to quickly find your data rather than looping to find the element you're interested in. This technique has been around for a while and it has been discussed before. There are examples floating around. Will need to check to find one. 
    As for your question regarding using the reference method which you tried to employ in your initial approach, that's simply not going to gain you anything. You will still be creating buffers when you try to access the cluster elements. But you already have this information in the array inside the outer for loop, so you're just creating unnecessary extra programming for yourself. 

Maybe you are looking for