Passing an array argument to a function by referance

Below is my function I want to call my function but there seems to be an error in the way I am calling it can you tell me the right syntax to use?
The function accepts 3 arguments an array of ints, an array of booleans and an int.
I am calling it as
findamobileset ( citys, pointers, sizeofarrays);
public void findamobileset (int citys[], boolean[] pointers, int sizeofarrays)
int maxarraynumber = -1;
int tempswap = -1 ;
boolean runagain = false;
for(int i = 0;i < sizeofarrays; i++){
//if the mobile flag is pointing to the right: look at the +1 current position where on and if its bigger then make that the biggest k so far
//ALSO check if its not pointing off the array
if(pointers[i] == true && i !=citys[sizeofarrays] && citys[i+1] < citys[i] && citys[i] > maxarraynumber){
maxarraynumber = citys;
//if the mobile flag is pointing to the left: look at the +1 current position where on and if its bigger then make that the biggest k so far
if(pointers[i] ==false && i != citys[0] && citys[i-1] < citys[i] && citys[i] > maxarraynumber){
maxarraynumber = citys[i];
//swap k with an ajacent integer the arrow is pointing too
if(pointers[maxarraynumber] == true)
tempswap = citys[maxarraynumber+1];
citys[maxarraynumber+1] =citys[maxarraynumber];
citys[maxarraynumber] = tempswap;
else
{  tempswap = citys[maxarraynumber-1];
citys[maxarraynumber-1] =citys[maxarraynumber];
citys[maxarraynumber] = tempswap;
//reverse all numbers greater then k
for(int i = 0;i < sizeofarrays; i++){
if(citys[i] > maxarraynumber){
if(pointers[i] == true){
pointers[i]= false;}
else
pointers[i] = true;
// print out the array
for(int i = 0;i < sizeofarrays; i++){
System.out.print(citys[i] + " ");
System.out.println(" ");
//test if theres a mobile integer left to redo it and flip the flag if there is
for(int i = 0;i < sizeofarrays; i++){
if(pointers[i] == true && i !=citys[sizeofarrays] && citys[i+1] < citys[i] ){
runagain = true;
if(pointers[i] ==false && i != citys[0] && citys[i-1] < citys[i] ){
runagain = true;
//recurviely call the algorithm again
if(runagain == true){
findamobileset ( citys, pointers, sizeofarrays);
else
{/terminate}

1) There is no pass-by-reference in Java. At best, you have a reference that's passed.by-value (a copy of this reference, pointing to the same object).
2) I won't read all of your code
3) Which is unformatted anyway
4) so I don't know what the error is. Maybe you care to tell me?

Similar Messages

  • Using BC4J to pass an array to a stored function

    I have successfully implemented the use of BC4J view objects to pass and retrive values from a stored database procedure/function as per Steve Muench's paper.
    What I am having difficulty achieving is passing through an array to a stored function. I have a multiple selection table where on submit, I retrieve the selected values and want to be able to put them in a array and pass them to a stored function.
    At the database level, I have created a nested table with one of the columns being a table of numbers. A wrapper function is called with the array type being one of the in parameters and the database updated.
    I am however having no luck building the array in my Java code and passing it to the database through an expert-only view object.
    I have :
    1. Database wrapper function has an extra parameter for the table of numbers (number(10))
    2. Changed the view object query to include the extra parameter (of type Number[])
    3. Changed the relevant view object and transaction Impl classes to pass through an array of oracle.jbo.domain.Number
    4. Update my test module class to
    -- Test module class
    String _am = "transaction2.transaction2module", _cf = "Transaction2ModuleLocal";
        String str1 = "String1";
        String str2 = "String2";
        String str3 = "String3";
        Number[] num4 = {new Number(1001),new Number(1002),new Number(1003),new Number(1004)};
        Transaction2Module testModule = (Transaction2Module)Configuration.createRootApplicationModule(_am,_cf);
        TxnResultType txnResult = testModule.getTxnResult(str1,str2,str3,num4);
    -- Transaction2ModuleImpl.java
    public ProcessTransactionImpl getProcessTxn()
        return (ProcessTransactionImpl)findViewObject("ProcessTxn");
      public TxnResultType getTxnResult(String p1, String p2, String p3, Number[] p4)
        return getProcessTxn().getTxnResult(p1, p2, p3, p4);
    -- ProcessTxnImpl.java
    public TxnResultType getTxnResult(String p1, String p2, String p3, Number[] p4)
        setWhereClauseParam(0,p1);
        setWhereClauseParam(1,p2);
        setWhereClauseParam(2,p3);
        setWhereClauseParam(3,p4);
        executeQuery();
        return ((ProcessTransactionRowImpl)first()).getTxnResult();
      }but the error message given is :
    oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation. Statement: select transaction_wrapper(:0, :1, :2, :3) as txn_result from dual
    java.sql.SQLException: Invalid column type
         void oracle.jdbc.dbaccess.DBError.throwSqlException(java.lang.String, java.lang.String, int)
    Can anyone offer some suggestions ?
    Thanks,
    Brent

    Thanks for the reply - I had nearly given up on this ! I did add the setWhereClause statement as you suggested
    setWhereClause("p1=:0 and p2=:1 and p3=:2 and p4=:3");but still got the same error. I have posted the entire output which may help you see what's still going wrong (hopefully!)
    oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation. 
    Statement: SELECT * FROM (select test_array(:0,:1,:2,:3) as result from dual) QRSLT  WHERE (p1=:0 and p2=:1 and p3=:2 and p4=:3)
         void oracle.jbo.server.QueryCollection.executeQuery(java.lang.Object[], int)
              QueryCollection.java:541
         void oracle.jbo.server.ViewObjectImpl.executeQueryForCollection(java.lang.Object, java.lang.Object[], int)
              ViewObjectImpl.java:2650
         void oracle.jbo.server.ViewRowSetImpl.execute(boolean, boolean)
              ViewRowSetImpl.java:523
         void oracle.jbo.server.ViewRowSetImpl.executeQuery()
              ViewRowSetImpl.java:564
         void oracle.jbo.server.ViewObjectImpl.executeQuery()
              ViewObjectImpl.java:2614
         java.lang.String mypackage5.TxnViewImpl.getResult(java.lang.String, java.lang.String, java.lang.String, oracle.jbo.domain.Number[])
              TxnViewImpl.java:25
         java.lang.String mypackage5.TransModuleImpl.getResult(java.lang.String, java.lang.String, java.lang.String, oracle.jbo.domain.Number[])
              TransModuleImpl.java:29
         void mypackage5.TestArray.main(java.lang.String[])
              TestArray.java:17
    ## Detail 0 ##
    java.sql.SQLException: Invalid column type
         void oracle.jdbc.dbaccess.DBError.throwSqlException(java.lang.String, java.lang.String, int)
              DBError.java:187
         void oracle.jdbc.dbaccess.DBError.throwSqlException(int, java.lang.Object)
              DBError.java:229
         void oracle.jdbc.dbaccess.DBError.throwSqlException(int)
              DBError.java:292
         void oracle.jdbc.driver.OraclePreparedStatement.setObject(int, java.lang.Object, int, int)
              OraclePreparedStatement.java:2782
         void oracle.jdbc.driver.OraclePreparedStatement.setObject(int, java.lang.Object)
              OraclePreparedStatement.java:2905
         boolean oracle.jbo.server.ViewRowSetImpl.bindParameters(java.lang.Object[], java.sql.PreparedStatement)
              ViewRowSetImpl.java:1313
         void oracle.jbo.server.QueryCollection.executeQuery(java.lang.Object[], int)
              QueryCollection.java:511
         void oracle.jbo.server.ViewObjectImpl.executeQueryForCollection(java.lang.Object, java.lang.Object[], int)
              ViewObjectImpl.java:2650
         void oracle.jbo.server.ViewRowSetImpl.execute(boolean, boolean)
              ViewRowSetImpl.java:523
         void oracle.jbo.server.ViewRowSetImpl.executeQuery()
              ViewRowSetImpl.java:564
         void oracle.jbo.server.ViewObjectImpl.executeQuery()
              ViewObjectImpl.java:2614
         java.lang.String mypackage5.TxnViewImpl.getResult(java.lang.String, java.lang.String, java.lang.String, oracle.jbo.domain.Number[])
              TxnViewImpl.java:25
         java.lang.String mypackage5.TransModuleImpl.getResult(java.lang.String, java.lang.String, java.lang.String, oracle.jbo.domain.Number[])
              TransModuleImpl.java:29
         void mypackage5.TestArray.main(java.lang.String[])
              TestArray.java:17
    Exception in thread main
    Process exited with exit code 1.I had to do a new example as I could not find the code I was using earlier. This is my java class
    import oracle.jbo.client.Configuration;
    import oracle.jbo.domain.Number;
    import mypackage5.common.TransModule;
    public class TestArray
      public static void main(String[] args)
        String _am = "mypackage5.TransModule", _cf = "TransModuleLocal";
        String str1 = "String1";
        String str2 = "String2";
        String str3 = "String3";
        Number[] num4 = {new Number(1001),new Number(1002),new Number(1003),new Number(1004)};
        TransModule testModule = (TransModule)Configuration.createRootApplicationModule(_am,_cf);
        String txnResult = testModule.getResult(str1,str2,str3,num4);
        System.out.println("Result = " + txnResult);

  • [C] Passing an array in to a function [SOLVED]

    Hello, everyone,
    I'm writing a small unit testing library for myself for various C projects I've got on the go at the moment. Right now, it just consists of one function which accepts an array of tests (structs) and runs each one. The problem is that the array seems to disappear once I pass it in to the library function.
    The library's only test code at the moment is:
    #include "test.h"
    enum TestResult testPass();
    enum TestResult testFail();
    int main()
    struct Test tests[] = {
    {"pass", testPass},
    {"fail", testFail},
    testRun(tests);
    return 0;
    enum TestResult testPass()
    return PASS;
    enum TestResult testFail()
    return FAIL;
    test.h:
    #ifndef TEST_H
    #define TEST_H
    enum TestResult
    PASS,
    FAIL,
    struct Test
    char* name;
    enum TestResult (*test)();
    void testRun(struct Test*);
    #endif /* TEST_H */
    And test.c, which compiles to libtest.so:
    #include <stdio.h>
    #include "test.h"
    #define ARRAY_LENGTH(array) ((int) (sizeof(array) / sizeof(*array)))
    void testRun(struct Test* tests)
    enum TestResult result;
    int i;
    for(i = 0; i < ARRAY_LENGTH(tests); i++)
    if((result = tests[i].test()) == PASS)
    fprintf(stderr, ".");
    else if(result == FAIL)
    fprintf(stderr, "F");
    else
    fprintf(stderr, "?");
    fprintf(stderr, "\n");
    I get a single newline as output for running the test code. (that last fprintf() call). In other words, ARRAY_LENGTH(tests) == 0.
    I've tried several different ways of making the array accessible to the library, including making an extern variable in test.h (couldn't use the automatic array sizing declaration), making a static variable in test.c and initializing it with a function (the array still disappeared), and just passing it in to the function, as shown. What am I overlooking? The way I figure, an array is a pointer, meaning they (arrays) are always passed by reference, and I can therefore declare testRun() as taking a struct Test* without any using any complicated data structures to preserve the contents and make the client interface as simple as possible.
    Last edited by Michael C. (2010-04-10 21:28:02)

    Another widely used way of doing it, without having to pass the size, is to use null-terminated arrays.
    You probably know that strings are null-terminated arrays of characters?
    Well you can do the same with arrays that you define.
    You would have something like:
    struct Test tests[] = {
    {"pass", testPass},
    {"fail", testFail},
    {NULL, NULL},
    Then instead of using the size of the array, you just loop on its elements until you have the null element, then break.
    You just have to make sure you always put this null element at the end of your arrays. And that the null element is really a null element, I mean you can choose anything but of course it shouldn't be a possible normal value of the array.

  • How do you invoke a method with native int array argument?

    Hi,
    Will someone help me to show me a few codes samples on how to invoke a method which has only one argument, an int [] array.
    For exampe:
    public void Method1(int [] intArray) {...};
    Here is some simple code fragment I used:
    Class<?> aClass = Class.forName("Test2");
    Class[] argTypes = new Class[] {int[].class};
    Method method = aClass.getDeclaredMethod("Method_1", argTypes);
    int [] intArray = new int[] {111, 222, 333};
    Object [] args = new Object[1];
    args[0] = Array.newInstance(int.class, intArray);
    method.invoke(aClass, args);I can compile without any error, but when runs, it died in the "invoke" statement with:
    Exception in thread "main" java.lang.IllegalArgumentException: object is not an instance of declaring class
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at Test1.invoke_Method_1(Test1.java:262)
         at Test1.start(Test1.java:33)
         at Test1.main(Test1.java:12)
    Any help is greatly appreciated!
    Jeff

    Sorry, my bad. I was able to invoke static methods and instance methods with all data types except native int, short, double and float, not sure the proper ways to declare them.
    After many frustrating hours, I posted the message for help, but at that time, my mind was so numb that I created a faulted example because I cut and pasted the static method invocation example to test the instance method passing int array argument.
    As your post suggested, "args[0] = intArray;", that works. Thanks!
    You know, I did tried passing the argument like that first, but because I was not declaring the type properly, I ended up messing up the actual passing as well as the instantiation step.
    I will honestly slap my hand three times.
    jml

  • Passing an array as parameter from java (java controls) to stored procedure

    Hi,
    I'm using java controls (BEA Weblogic Workshop 8.1) to call a stored procedure and send an array as a parameter to the stored procedure from java. The following code below throws an exception "Fail to convert to internal representation".
    Java code
    import com.bea.control.DatabaseControl.SQLParameter;
    // Here i create the java array
    int[] javaArray={12,13,14};
    //The code below is used to create the oracle sql array for the procedure
    SQLParameter[] params = new SQLParameter[1];
    Object obj0=javaArray;
    params[0] = new SQLParameter(obj0, oracle.jdbc.OracleTypes.ARRAY, SQLParameter.IN);
    // the code below calls the testFunc method in OJDBCtrl.jcx file
    String succ= dbControl.testFunc(params);
    OJDBCtrl.jcx
    * @jc:sql statement="call CMNT_TST_PROC(?))"
    String testFunc(SQLParameter[] param);
    The stored procedure used:
    TYPE SL_tab IS TABLE OF number INDEX BY PLS_INTEGER;
    Procedure cmnt_tst_proc (cmnt_tst sl_tab);
    Procedure cmnt_tst_proc (cmnt_tst sl_tab) is
    BEGIN
    dbms_output.put_line('Hello');
    END;
    I am getting the following exception
    Failure=java.sql.SQLException: Fail to convert to internal representation: [I@438af4 [ServiceException]>
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:162)
    at oracle.jdbc.driver.DatabaseError.check_error(DatabaseError.java:861)
    at oracle.sql.ARRAY.toARRAY(ARRAY.java:210)
    at oracle.jdbc.driver.OraclePreparedStatement.setObjectCritical(OraclePreparedStatement.java:7768)
    at oracle.jdbc.driver.OraclePreparedStatement.setObjectInternal(OraclePreparedStatement.java:7449)
    at oracle.jdbc.driver.OraclePreparedStatement.setObjectInternal(OraclePreparedStatement.java:7837)
    at oracle.jdbc.driver.OracleCallableStatement.setObject(OracleCallableStatement.java:4587)
    at weblogic.jdbc.wrapper.PreparedStatement.setObject(PreparedStatement.java:244)
    at com.bea.wlw.runtime.core.control.DatabaseControlImpl._setParameter(DatabaseControlImpl.jcs:1886)
    at com.bea.wlw.runtime.core.control.DatabaseControlImpl.getStatement_v2(DatabaseControlImpl.jcs:1732)
    at com.bea.wlw.runtime.core.control.DatabaseControlImpl.invoke(DatabaseControlImpl.jcs:2591)
    at com.bea.wlw.runtime.core.dispatcher.DispMethod.invoke(DispMethod.java:377)
    at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:433)
    at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:406)
    at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:249)
    at com.bea.wlw.runtime.jcs.container.JcsContainer.invoke(JcsContainer.java:85)
    at com.bea.wlw.runtime.core.bean.BaseContainerBean.invokeBase(BaseContainerBean.java:224)
    at com.bea.wlw.runtime.core.bean.SLSBContainerBean.invoke(SLSBContainerBean.java:109)
    at com.bea.wlwgen.StatelessContainer_ly05hg_ELOImpl.invoke(StatelessContainer_ly05hg_ELOImpl.java:153)
    Can you please let me know, what i'm doing wrong and how i can pass an array to a procedure/function using java controls.
    Any help will be highly appreciated.
    Edited by: user12671762 on Feb 24, 2010 5:03 AM
    Edited by: user9211663 on Feb 24, 2010 9:04 PM

    Thanks Michael.
    Here's the final code that i used, this might be helpful for those who face this problem
    Java Code
    // Following code gets the connection object
    InitialContext ctx = new InitialContext();
    dataSource = (DataSource)ctx.lookup("<DataSourceName>");
    conn=dataSource.getConnection();
    // Following code is used to create the array type from java
    String query="CREATE OR REPLACE TYPE STR_ARRAY AS VARRAY(3) OF NUMBER";
    dbControl.runTypeQuery(query);
    // Following code is used to obtain the oracle sql array as SQLParameter
    ArrayDescriptor desc = ArrayDescriptor.createDescriptor("<schemaName>.STR_ARRAY", conn);
    Object[] elements = new Object[3];
    elements[0] = new Integer(12);
    elements[1] = new Integer(13);
    elements[2] = new Integer(14);
    oracle.sql.ARRAY newArray = new oracle.sql.ARRAY( desc, conn, elements);
    SQLParameter[] params = new SQLParameter[1];
    params[0] = new SQLParameter(newArray, oracle.jdbc.OracleTypes.ARRAY, SQLParameter.IN);
    String succ= dbControl.testFunc(params);

  • Passing multidim array to c function

    Hi all,
    I am very new to JNI, so please excuse if asking something stupid. I want to pass amultidimensional array (double[][]) to a c++ function. The array holds a large matrix for a linear equation system, the c++ function is a solver.
    I can run "Hello World" using JNI, and I can pass a 1-dim double[] Array to a c++ function.
    If changing the native method argument from double[] to double[][], javah produces a c++ header file with jobjectArray as argument type. I don't understand, how to access the array within the c++ code.
    Can anyone give me a tip, how to do it? Most helpfull would be a c++ code line, that fetches an array...
    Thanks a lot,
    Clemente
    The generated header file:
    /* DO NOT EDIT THIS FILE - it is machine generated */
    #include <jni.h>
    /* Header for class Solver */
    #ifndef IncludedSolver
    #define IncludedSolver
    #ifdef __cplusplus
    extern "C" {
    #endif
    * Class: Solver
    * Method: solve
    * Signature: ([[DI)[D
    JNIEXPORT jdoubleArray JNICALL Java_Solver_solve
    (JNIEnv *, jobject, jobjectArray, jint);
    #ifdef __cplusplus
    #endif
    #endif
    Edited by: Clemente on Oct 15, 2007 2:15 AM
    Edited by: Clemente on Oct 15, 2007 3:37 AM
    Edited by: Clemente on Oct 15, 2007 3:42 AM
    Edited by: Clemente on Oct 15, 2007 3:43 AM

    Finally, I figured to access all dimensions. For the archive and anyone with similar problems:
    Assumed, that the provided jobjectArray is called "array", means the method looks something like:
    JNIEXPORT jdoubleArray JNICALL Java_de_vonmusil_vs_wqn_solver_Solver_solve(JNIEnv *env, jobject ob, jstring path, jobjectArray array) { [...] }
    following snippet lists the first two rows of the array of doubles:
         int j;
         jdoubleArray darray = (jdoubleArray) env->GetObjectArrayElement(array, 0);
         jdouble* first_element = env->GetDoubleArrayElements(darray, NULL);
         for (j=0; j<env->GetArrayLength(darray); j++)
              std::cout << "->" << first_element[j] << std::endl;
         darray = (jdoubleArray) env->GetObjectArrayElement(array, 1);
         first_element = env->GetDoubleArrayElements(darray, NULL);
         for (j=0; j<env->GetArrayLength(darray); j++)
              std::cout << "->" << first_element[j] << std::endl;
    Besides all the casting things, it works this way: A double[][] array is an array (a) of arrays (b). One can get a b-array with env->GetObjectArrayEalement(array, 0);.
    env->GetDoubleArrayElements(darray, NULL); fetches a pointer to the first double value and using the pointerarithmetic pointer[], one can iterate over the whole array.
    Thank you for all your help,
    Clemente
    Edited by: Clemente on Oct 15, 2007 1:26 PM

  • Passing an array as IN parameter to call a function

    I have a function the definition is
    TYPE VAR_VALUE_RECORD IS RECORD(VAR VARCHAR2(100),
                   VALUE VARCHAR2(100));
    TYPE VAR_VALUE_TAB IS TABLE OF VAR_VALUE_RECORD;
    FUNCTION GENERIC_WF(P_MSG_TYPE IN VARCHAR2,P_CDCS_NBR IN VARCHAR2, P_CDCS_SEQ IN VARCHAR2, P_DEBTORID IN NUMBER,
    P_EXTRAS IN VAR_VALUE_TAB) RETURN VARCHAR2;
    I am trying to call this function
    select WF_NOTIFICATIONS_PKG.GENERIC_WF('Manual Debt Establish Notification','2009A13636','001',105195359,'this is a test') from dual
    ERROR at line 1:
    ORA-06553: PLS-306: wrong number or types of arguments in call to 'GENERIC_WF'
    I am getting the above error, how do I pass the array as parameter.
    I will appreciate your help.
    Thnaks

    Hi,
    try this,
    Create OR Replace Package WF_NOTIFICATIONS_PKG Is
       Type VAR_VALUE_RECORD Is Record( VAR   Varchar2(100)
                                      , Value Varchar2(100));
       Type VAR_VALUE_TAB Is Table Of VAR_VALUE_RECORD Index BY Pls_Integer;
       Function GENERIC_WF( P_MSG_TYPE IN Varchar2
                          , P_CDCS_NBR IN Varchar2
                          , P_CDCS_SEQ IN Varchar2
                          , P_DEBTORID IN Number
                          , P_EXTRAS   IN VAR_VALUE_TAB ) Return Varchar2;
    End WF_NOTIFICATIONS_PKG;
    Create OR Replace Package Body WF_NOTIFICATIONS_PKG Is
       Function GENERIC_WF( P_MSG_TYPE IN Varchar2
                          , P_CDCS_NBR IN Varchar2
                          , P_CDCS_SEQ IN Varchar2
                          , P_DEBTORID IN Number
                          , P_EXTRAS   IN VAR_VALUE_TAB ) Return Varchar2 Is
       Begin
          Return ( P_EXTRAS(P_EXTRAS.First).var || ' - ' || P_EXTRAS(P_EXTRAS.First).Value );
       End GENERIC_WF;
    End WF_NOTIFICATIONS_PKG;
    SQL> Declare
      2     v_value_Tab WF_NOTIFICATIONS_PKG.VAR_VALUE_TAB;
      3     v_return    Varchar2(100);
      4  Begin
      5     v_value_Tab(1).var   := 'this is a test 1';
      6     v_value_Tab(1).value := 'this is a test 2';
      7 
      8     v_return := WF_NOTIFICATIONS_PKG.GENERIC_WF( 'Manual Debt Establish Notification'
      9                                                , '2009A13636'
    10                                                , '001'
    11                                                , 105195359
    12                                                , v_value_Tab );
    13 
    14     Dbms_Output.put_line(v_return);
    15  End;
    16  /
    this is a test 1 - this is a test 2
    PL/SQL procedure successfully completedRegards,
    Christian Balz

  • How do I pass an array of structs to a C function using the dll flexible prototype adapter?

    What I want to do is pass into a C dll function a variably sized Array of structs of type TPS_Data. My Code compiles but when I run it in TestStand, I get an error -17001; Program Error. "Cannot allocate 0 size buffer Error in parameter 2, 'OpenFrdData'."
    I've allocated the Array of structs, and all of the information is there before I call my function, so is it my prototype? Or am I asking too much of the DLL Flexible Prototype Adapter to pass an Array of Structs?
    I can pass in a single struct of type TPS_Data and that works, but not an array.
    Here's the relevent code:
    typedef struct TPS_DATA
    char Report_Number[256];
    char System_Name[256];
    char Open_Date[256];
    char UUT_Part_Number[256];
    char UUT_Serial_Number[256];
    char UUT_Name[256];
    char Open_Employee_Name[256];
    char Open_Employee_Number[256];
    char Close_Employee_Name[256];
    char Close_Employee_Number[256];
    char Close_Date[256];
    } TPS_Data;
    typedef struct TPS_DATA_ARRAY
    TPS_Data DataRecord;
    } TPS_DataArray;
    long __declspec(dllexport) __stdcall OpenDialog (CAObjHandle Context, TPS_DataArray *TpsData[], const char *psFaultStr, char *sComments, const int nCount);

    OK,
    I can pass the data to the DLL function, using the following types:
    typedef struct StringArrayType
    char string[10][256];
    } StringArray;
    typedef struct MultiStringArrayType
    StringArray Record[10];
    } MultiStringArray;
    void __declspec(dllexport) __stdcall ATP_TestStructPassing(StringArray Strings)
    return;
    void __declspec(dllexport) __stdcall ATP_TestMultiStructPassing(MultiStringArray *Strings)
    return;
    But when the MultiStruct function Exits, TestStand reports an Error:
    -17501 "Unexpected Operating System Error" Source: 'TSAPI'
    There doesn't seem to be a way around this, and once the error occurs, I have to force quit TestStand. I've included the sequence file, and the dll code can be compiled from the fun
    ctions shown above.
    Any thoughts on how to get around this error would be greatly appreciated.
    Attachments:
    StructArrayPassing.seq ‏16 KB

  • How to pass an array to a function from a SELECT statement

    Hi all. I have a problem with passing an array to a function directly from a SELECT statement.
    Here is what I want. If I have a function
    function AAA(arrayVar <ArrayType>) return number;
    I want to be able to call this function this way
    select AAA((2,3,4))
    from dual
    or this way
    select AAA((10,12))
    from dual
    In other words I want to be able to pass an arbitrary number of numbers to the function. And I want this to work in a SELECT statement.
    Does anyone have any ideas how to implement this? What <ArrayType> should I use?(I've read about VARRAY, nested tables in the Oracle documentation but as far as I've understood these array types are meant to be used within PL/SQL blocks).
    I found only this http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:208012348074 through Google but it didn't help me.
    Thank you in advance.

    > What <ArrayType> should I use?
    SQL data types - as 3360 showed above. You cannot use PL/SQL structures and user types in the SQL Engine.
    You can however use all SQL structures and types in PL/SQL.
    Arrays in SQL is created as collection type - basic o-o. The collection type (or class) serve as a container for instantiated objects or scalar type.
    This is covered in detail in [url http://download-uk.oracle.com/docs/cd/B19306_01/appdev.102/b14260/toc.htm]
    Oracle® Database Application Developer's Guide - Object-Relational Features

  • How to pass argument in main function ?

    How to pass arguments in main function of one class from another class ?
    I don't want to pass argument from command prompt.
    I want to try something like this -
    class Test{
    public static void main(String args[]){
    for(int i=0;i<args.length;i++)
         System.out.println(args);
    class Fun{
    public static void main(String args[]){
         Test t=new Test("Hello","good bye");
    when i run Fun class it gives error.
    Suggest me how can i do that.

    In Fun class main method does not take arguments that is fine. In Test class instead of main method you can have constructor to take input parameters as suggested by BalusC
    However, if you want to make your existing code work, you can call (though not appropriate) main() method of Test class from main() method of Fun class (As main() method is static object is not required to invoke this):
    Test.main(new String[]{"Hello","good bye"});Here is your code:
    class Test{
    public static void main(String args[]){
    for(int i=0;i<args.length;i++)
    System.out.println(args);
    public class Fun{
    public static void main(String args[]){
    //Test t=new Test("Hello","good bye");
    Test.main(new String[]{"Hello","good bye"});
    } Thanks,
    Mrityunjoy                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to pass OAF filed data as a argument to custom function

    Hi All,
    I am doing controller extension. I have the following doubt will you please solve my doubt.
    My doubt is how to pass the standard page filed data as an argument to custom function.
    Let us assume that in my standard page i have item details (item number, description and uom.......)
    and i need to pass item number as an argument to my custom function.
    How to do this?
    Please help me on this.
    Regards
    Zaheer.

    Hi
    Thanks a lot for replying me, Thanks again and again.
    The error which i am getting is as follows:
    Actually iam extending egocancelapplypagebuttonbarco.
    in this co we have code on Apply button iam writing my code there.
    My code is as follows:
    package oracle.apps.ego.common.webui;
    import java.sql.*;
    import oracle.apps.ego.item.eu.util.EgoItemContext;
    import oracle.apps.fnd.framework.OAApplicationModule;
    import oracle.apps.fnd.framework.server.OADBTransaction;
    import oracle.apps.fnd.framework.webui.OAPageContext;
    import oracle.apps.fnd.framework.webui.beans.OAWebBean;
    import oracle.apps.fnd.framework.webui.beans.form.OAFormValueBean;
    import oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean;
    import oracle.apps.fnd.framework.webui.beans.nav.OAButtonBean;
    import oracle.apps.fnd.framework.webui.beans.nav.OABreadCrumbsBean;
    import oracle.jbo.Transaction;
    import oracle.cabo.ui.beans.layout.PageLayoutBean;
    import oracle.cabo.ui.beans.nav.LinkBean;
    import oracle.jbo.ApplicationModule;
    // Referenced classes of package oracle.apps.ego.common.webui:
    // EgoCancelApplyPGButtonBarCO
    public class EgoCancelApplyPGButtonBarEXTCO extends EgoCancelApplyPGButtonBarCO
    public EgoCancelApplyPGButtonBarEXTCO()
    public void processRequest(OAPageContext oapagecontext, OAWebBean oawebbean)
    super.processRequest(oapagecontext, oawebbean);
         String s = null;
    OAFormValueBean oaformvaluebean = (OAFormValueBean)oapagecontext.getPageLayoutBean().findChildRecursive("cancelDestinationHidden");
    if(oaformvaluebean != null)
    s = (String)oaformvaluebean.getValue(oapagecontext);
    if(s == null)
    OABreadCrumbsBean oabreadcrumbsbean = (OABreadCrumbsBean)oapagecontext.getPageLayoutBean().getLocation();
    if(oabreadcrumbsbean != null)
    int i = oabreadcrumbsbean.getLinkCount();
    if(i >= 2)
    s = oabreadcrumbsbean.getLinkDestination(i - 2);
    if(oapagecontext.getSessionValue("EgoCritTempListPgUrl") != null && s == null)
    s = (String)oapagecontext.getSessionValue("EgoCritTempListPgUrl");
    if(s == null)
    s = oapagecontext.getCurrentUrlForRedirect();
    OAButtonBean oabuttonbean = (OAButtonBean)oawebbean.findIndexedChildRecursive("cancelButton");
    oabuttonbean.setWarnAboutChanges(false);
    oabuttonbean.setDestination(s);
    public void processFormRequest(OAPageContext oapagecontext, OAWebBean oawebbean)
    byte byte0 = 4;
    super.processFormRequest(oapagecontext, oawebbean);
    OAApplicationModule oaapplicationmodule = oapagecontext.getApplicationModule(oawebbean);
    if(oapagecontext.getParameter("applyButton") != null)
    oapagecontext.getApplicationModule(oawebbean).getTransaction().commit();
    String s = null;
    if(oapagecontext.getTransactionTransientValue("OverrideEgoCancelApplyPGButtonBarCODestination") == null)
    OAFormValueBean oaformvaluebean = (OAFormValueBean)oapagecontext.getPageLayoutBean().findChildRecursive("applyDestinationHidden");
    if(oaformvaluebean != null)
    s = (String)oaformvaluebean.getValue(oapagecontext);
    if(s == null)
    OAButtonBean oabuttonbean = (OAButtonBean)oawebbean.findIndexedChildRecursive("cancelButton");
    s = oabuttonbean.getDestination();
    try
    oapagecontext.sendRedirect(s);
    return;
    catch(Exception exception)
    return;
    if(byte0 == 4)
    EgoItemContext egoitemcontext = EgoItemContext.getItemContextObject(oapagecontext);
    String s1 = egoitemcontext.getItemNumber();
    try
    CallableStatement callablestatement = oaapplicationmodule.getOADBTransaction().getJdbcConnection().prepareCall("{XXNRITEMUPDATE(?)}");
    callablestatement.setString(1, s1);
    callablestatement.execute();
    callablestatement.close();
    catch(SQLException sqlexception)
    sqlexception.printStackTrace();
    And my error is as follows
    oracle.apps.fnd.framework.OAException: java.lang.NullPointerException at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:891) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:603) at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247) at oracle.apps.fnd.framework.webui.beans.nav.OAPageButtonBarBean.processRequest(OAPageButtonBarBean.java:351) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:980) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:926) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:646) at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247) at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processRequest(OAPageLayoutHelper.java:1136) at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processRequest(OAPageLayoutBean.java:1569) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:959) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:926) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:646) at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247) at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processRequest(OAFormBean.java:385) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:959) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:926) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:646) at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247) at oracle.apps.fnd.framework.webui.beans.OABodyBean.processRequest(OABodyBean.java:353) at oracle.apps.fnd.framework.webui.OAPageBean.processRequest(OAPageBean.java:2336) at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1735) at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:509) at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:430) at oa_html._OA._jspService(_OA.java:82) at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119) at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:385) at oracle.jsp.JspServlet.doDispatch(JspServlet.java:259) at oracle.jsp.JspServlet.internalService(JspServlet.java:178) at oracle.jsp.JspServlet.service(JspServlet.java:148) at javax.servlet.http.HttpServlet.service(HttpServlet.java:588) at oracle.jsp.provider.Jsp20RequestDispatcher.forward(Jsp20RequestDispatcher.java:162) at oracle.jsp.runtime.OraclePageContext.forward(OraclePageContext.java:175) at oa_html._OA._jspService(_OA.java:92) at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119) at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:385) at oracle.jsp.JspServlet.doDispatch(JspServlet.java:259) at oracle.jsp.JspServlet.internalService(JspServlet.java:178) at oracle.jsp.JspServlet.service(JspServlet.java:148) at javax.servlet.http.HttpServlet.service(HttpServlet.java:588) at oracle.jsp.provider.Jsp20RequestDispatcher.forward(Jsp20RequestDispatcher.java:162) at oracle.jsp.runtime.OraclePageContext.forward(OraclePageContext.java:175) at oa_html._OA._jspService(_OA.java:92) at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119) at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:385) at oracle.jsp.JspServlet.doDispatch(JspServlet.java:259) at oracle.jsp.JspServlet.internalService(JspServlet.java:178) at oracle.jsp.JspServlet.service(JspServlet.java:148) at javax.servlet.http.HttpServlet.service(HttpServlet.java:588) at org.apache.jserv.JServConnection.processRequest(JServConnection.java:456) at org.apache.jserv.JServConnection.run(JServConnection.java:294) at java.lang.Thread.run(Thread.java:595) ## Detail 0 ##
    java.lang.NullPointerException at oracle.apps.ego.common.webui.EgoCancelApplyPGButtonBarCO.processRequest(EgoCancelApplyPGButtonBarCO.java:81) at oracle.apps.ego.common.webui.EgoCancelApplyPGButtonBarEXTCO.processRequest(EgoCancelApplyPGButtonBarEXTCO.java:31) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:587) at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247) at oracle.apps.fnd.framework.webui.beans.nav.OAPageButtonBarBean.processRequest(OAPageButtonBarBean.java:351) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:980) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:926) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:646) at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247) at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processRequest(OAPageLayoutHelper.java:1136) at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processRequest(OAPageLayoutBean.java:1569) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:959) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:926) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:646) at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247) at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processRequest(OAFormBean.java:385) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:959) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:926) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:646) at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247) at oracle.apps.fnd.framework.webui.beans.OABodyBean.processRequest(OABodyBean.java:353) at oracle.apps.fnd.framework.webui.OAPageBean.processRequest(OAPageBean.java:2336) at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1735) at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:509) at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:430) at oa_html._OA._jspService(_OA.java:82) at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119) at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:385) at oracle.jsp.JspServlet.doDispatch(JspServlet.java:259) at oracle.jsp.JspServlet.internalService(JspServlet.java:178) at oracle.jsp.JspServlet.service(JspServlet.java:148) at javax.servlet.http.HttpServlet.service(HttpServlet.java:588) at oracle.jsp.provider.Jsp20RequestDispatcher.forward(Jsp20RequestDispatcher.java:162) at oracle.jsp.runtime.OraclePageContext.forward(OraclePageContext.java:175) at oa_html._OA._jspService(_OA.java:92) at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119) at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:385) at oracle.jsp.JspServlet.doDispatch(JspServlet.java:259) at oracle.jsp.JspServlet.internalService(JspServlet.java:178) at oracle.jsp.JspServlet.service(JspServlet.java:148) at javax.servlet.http.HttpServlet.service(HttpServlet.java:588) at oracle.jsp.provider.Jsp20RequestDispatcher.forward(Jsp20RequestDispatcher.java:162) at oracle.jsp.runtime.OraclePageContext.forward(OraclePageContext.java:175) at oa_html._OA._jspService(_OA.java:92) at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119) at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:385) at oracle.jsp.JspServlet.doDispatch(JspServlet.java:259) at oracle.jsp.JspServlet.internalService(JspServlet.java:178) at oracle.jsp.JspServlet.service(JspServlet.java:148) at javax.servlet.http.HttpServlet.service(HttpServlet.java:588) at org.apache.jserv.JServConnection.processRequest(JServConnection.java:456) at org.apache.jserv.JServConnection.run(JServConnection.java:294) at java.lang.Thread.run(Thread.java:595)
    I hope that u will help me untill i got the solution for this issue.
    Regards
    Zaheer.

  • Passing split array to function

    Anyone know how to pass an array to a function as seperate
    parameters i.e
    _array = [param1,param2,param3]
    functionToCall(param1,param2,param3)
    instead of: functionToCall(_array[0],_array[1],_array[2]);
    of having to go
    var1 = _array[0];
    var2 = _array[1];
    var3= _array[2];
    functionToCall(var1,var2,var3)
    Cheers, burnside

    DCIBurnside,
    > Marco Mind wrote:
    > Can't you just pass the array and indexs as a second
    array?
    That would only work if the desired function is written to
    accept two
    parameters formatted as arrays. DCIBurnside could certainly
    write an
    intermediary function, I suppose; but for that effort, it
    would be just as
    easy to pass in the parameters as already shown:
    functionToCall(_array[0],_array[1],_array[2]);
    Check out the methods of the Fuction class -- in particular
    Function.apply() -- which might be exactly what DCIBurnside
    is looking for.
    David Stiller
    Co-author, ActionScript 3.0 Quick Reference Guide
    http://tinyurl.com/dpsAS3QuickReferenceGuide
    "Luck is the residue of good design."

  • Passing array to call library function running on VxWorks (cRIO)

    Hello,
    I am using a cRIO 9012 running VxWorks.
    I have a Call library function VI in my application and I want to pass arrays of doubles to this function.
    The problem is that I can not access the values in the array.
    Here is the source code of my function:
    #include "D:\\Programme\\National Instruments\\LabVIEW 8.5\\cintools\\extcode.h"
    double avg_num(double *in1, double *out1)
        double ret;
        ret = in1[0] + out1[0];
        return ret;
    The value of in1[0] and out1[0] is always.
    When passing no arrays but single values, all is fine. But since my application is more complex than this example, I need to pass arrays.
    The block diagram and parameter specification is as shown in the attached screenshots.
    I am compiling the source code with the Gcc 6.3 which is available here:
    http://zone.ni.com/devzone/cda/tut/p/id/5694
    What am I doing wrong?
    Or is passing arrays not supported on cRIO?
    Maybe the makefile needs to be modified?
    Thank you.
    Best regards,
    Christian
    Attachments:
    vi.JPG ‏88 KB
    parameter.JPG ‏41 KB

    I guess I have solved the problem.
    The key was to set the parameter "Minimum size" for all function parameters to <None>.
    Having this, I can read the passed arrays. I do not know why this works but at the moment, it is ok for me.
    Thank you all.

  • Is it possible to pass an argument to the function triggered by an event handler?

    Hello All,
    Trying to migrate my way of thinking from AS2 to CS4/AS3.
    Ok, I have 2 buttons on the stage. Each button does almost
    the same thing, so I want to create a single function, and each
    button calls that same function (we'll name that function
    "Navigate")... however, the function will need to end up doing
    something different dependant on which button was clicked.
    So, previously, in AS2, I would've added some code onto the
    buttons themselves with on(release) methods (see CODE EXAMPLE 1)
    So, each button effectively calls the Navigate function, and
    passes a different frame label to the function.
    Now, I'm trying to recreate this functionality in AS3. As you
    all know, on(release) has been done away with (still don't know
    why), but we now have to use event handlers, so I'm trying to
    figure out a way to pass a different frame label argument to the
    Navigate function. Currently I can achieve that by using a switch
    statement to test which button was clicked, and act accordingly
    (see CODE EXAMPLE 2).
    In this over-simplified example, this works fine, but in the
    real world I'm going to have more than 2 buttons, and the Navigate
    function would probably be much more complicated...
    So, I would like to be able to pass an argument(s) (like in
    the AS2 example) to the Navigate function... perhaps in the
    addEventListener() method? I tried this, but got compiler errors
    (see CODE EXAMPLE 3):
    The Million Dollar Question:
    Is it possible to dynamically pass/change an argument(s) to a
    function which is triggered by an event listener? (Or is the event
    that triggered the function the only argument you can have?)
    If this isn't possible, I'd greatly like to hear how you
    folks would handle this (other than having a switch statement with
    12 cases in it)???

    I've found a couple solutions that I'll post below for
    prosperity...
    You could create a Dictionary keyed by the prospective event
    targets and store any information in there you want associated with
    them. Then the navigate function can check that dictionary to get
    it's parameters:
    // Code //
    Button1.addEventListener(MouseEvent.CLICK, Navigate, false,
    0, true);
    Button2.addEventListener(MouseEvent.CLICK, Navigate, false,
    0, true);
    var buttonArgs:Dictionary = new Dictionary();
    buttonArgs[Button1] = "FrameLabel1";
    buttonArgs[Button2] = "FrameLabel2";
    function Navigate(e:MouseEvent):void{
    gotoAndStop(buttonArgs[e.target]);
    This in my eyes, is about the same amount of work as writing
    a long switch statement, but a little more elegant I suppose.
    I had a little trouble understanding the next solution,
    because I didn't quite understand an important piece of information
    about event listeners. The addEventListener () requires a Function
    as the 2nd argument passed to it.
    It didn't quite click until someone pointed it out to me:
    Navigate is a Function...
    Navigate("FrameLabel1") is a Function
    call...
    So by writing just
    Navigate, I'm not actually calling the function at the time
    of the addEventListener call, I'm just supplying the event listener
    with a reference to the name of the function. Then, when the
    listener is triggered, the listener will call (and pass a
    MouseEvent argument to) the Navigate function.
    Conversely, by writing
    Navigate("FrameLabel1") as the 2nd argument, the event
    listener trys to execute the Navigate function at the time the
    addEventListener is instantiated. And, since, in this example, the
    Navigate function returned as ":void" a compile error would occur
    because as I stated, an event listener requires a Function data
    type as the 2nd argument. This would basically be like writing
    addEventListener(MouseEvent.Click,
    void, false, 0, true)
    However, there is a way around this... basically, instead of
    defining the Navigate function as returning a void data type, you
    define it as returning a Function data type, and then nest another
    function (which actually contains the actions you want to perform)
    inside of it.
    Button1.addEventListener(MouseEvent.CLICK,
    Navigate("FrameLabel1"), false, 0, true);
    Button2.addEventListener(MouseEvent.CLICK,
    Navigate("FrameLabel2"), false, 0, true);
    function Navigate(myLabel:String):Function{
    return function(evt:MouseEvent):void{
    gotoAndStop(myLabel);

  • How do you pass an array of characters using the DLL functions

    I have exported C code into my DLL and I want to know how to pass an array of characters using LabVIEW.

    Mont;
    If you want to pass a string from LabVIEW to your dll, and you do NOT change size of the string, you can use a C String pointer (CStr), which is equivalent to (unsigned) char *.
    If you do modify size of the string, pass string as a LabVIEW structure (LStrHandle).
    The example "Passing a Variety of Data Types from DLL to LabVIEW" is an excellent starting point. Also make sure you check the manual "Using External Code in LabVIEW".
    Regards;
    Enrique
    www.vartortech.com

Maybe you are looking for

  • Lightroom catalog in network

    In my studio we have 3 capture positions where we use EOS utility + Adobe bridge to capture images and then we have 2 post-processing positions with bridge + photoshop. The photos are stored on a server where the 5 macpros are connected. We are think

  • NetWeaver 7.01 ABAP Trial Version License

    Hello I'm new to SAP and I installed a few time ago the trial version. Now the version has expired and I got a new license file NSP.txt from SAP. When I go to SAPLICENSE, I can install the license file. I t shows me under Installierte Lizenzen the ne

  • Siebel Sample Data base for OBIA

    Hi Can Siebel Sample DB which is in SQL Anywhere be treated as OLTP Source and can it be used to load warehouse tables for demo purposes. In DAC i only see support for Teardata DB2 and SQL server.

  • Python sapnwrfc FUNCTION CALL ERROR

    Hi everyone, I am trying an external rfc connection with sapnwrfc-0.05 for Python. I have the latest nwrfcsdk from SAP. It took me a while to figure out the new python module methods, but I am now able to connect successfuly. I have a function module

  • Selective streaming to ATV

    I have a mix of equipment, some WinXP machines, Win 2003 server, some MacBooks and my MacMini along with 2 ATV's (setup for streaming) at home. I have a photo library on my mini that I would like to allow access to from the ATV's in the house, howeve