Undefined number of parameters in a function

Hi!
Recenlty I've seen in somewhere that new verions of java enable functions to recieve an undefined number of parameters; something like (see the ...)
public static void createList(int p1, ...){
}But I don't know where can I find information about this, and I have not be able to find it anywhere.
Thanks in advance.

VarArgs

Similar Messages

  • Is there a max number of parameters that can be passed to a C function in test stand v. 1.0.1

    I have had an issue with test stand version 1.0.1 (yes, I know; it's quite old) and calling a C function thru an action step. when I call this function with 18 parameters, it seems to hang. I have called a function with 16 and it seems to work. Is this a limit of the software? I am calling the function from a windows DLL that we've created. When I try to pull the function from the dll into test stand I also get a { error...but I get that in the other function's call and it seems to work fine. Any ideas?

    ok, upon re-reading what I posted I can clearly see your confusion. haha. I think there are two separate issues.
    1) Are there a maximum number of parameters one can use when calling a C function from a DLL? Yes, i'm trying to call a C function from test stand.
    2) when I select the "module" tab, and select which DLL contains my function, the prototype has no information associated with it (by clicking the reload prototype button). I'm not sure why, as I'm using a declspec to send the function information out of the dll, but that's another topic. So I click on the source file tab and point the window to the .cpp of my function (within the DLL's project workspace) and when it begins to parse the file, I get an error about mis-matched curly brackets and if I wish to continue, and skip the rest of the parsing.
    I click "OK" and when I go back to the module tab, I am able to see all my functions, along with the parameters in the drop down menu below. I fill in all the parameters and everything looks ok; no syntax errors, or anything else seemingly suspicious. I then run my test stand code and when I get to the step which calls this function, the system hangs and cannot proceed.
    Any thoughts as to what might cause these issues? 

  • Function Modules: maximum number of parameters ?

    Q: Is there a limit of maximum number of  parameters  existing, while calling a function module.
    I didn't find a hint in the ABAP-Documentation.
    We have a function module, with 120 parameters and this should be enlarged by about 25 new parameters.
    Can this cause a problem ?

    hi,
    why do you want to go for such an approach?
    instead create a Table Type in the Data dictionary and create fields in it. Populate this Table type in your program and pass it to the FM.
    doesnt it sounds a neat way of development??
    ags.

  • Remembering an undefined number of arrays.

    I have an undefined number of arrays (usually 3-5, but can be different) which i need to 'remember' within a LabVIEW VI. Each array may need to be called up in the future for a variety of things, or even overwritten.
    I am currently storing the default (3 arrays) in three seperate shift registers in the main while loop of my VI but this arrangement is unsatisfactory when the number of arrays to be stored is unknown. The array size is not set in stone and can vary up to 200 points. However, the arrays should be the same size as each other.
    Does anyone have ideas on how this can be done? The only idea i've had is to use 'functional globals' but i don't know how to create Reentrant VIs with my version of LabVIEW (if it's even possible). I use LabVIEW 6.1 - the Full development system (i think that's what it's called).
    Thank you in advance.
    James
    P.S. I can view VIs up to LabVIEW 8.5
    P.P.S.  Perhaps i should add that each array is allocated a name in a 1D array of strings (the number of arrays is changed by adding or removing elements in this array) and are initialised 'blank'. Only one array is edited or used at a time and the 'active' array is selected using a menu ring.
    Message Edited by James Mamakos on 06-16-2009 03:01 PM
    Never say "Oops." Always say "Ah, interesting!"

    I do not know how many arrays i may have. I currently have a default of 3, but this could eventually be anything up to 50 or more - i really don't know. The user defines this themselves.
    I need to know (programmatically) exactly how many arrays there are, and also the size of the largest array. At the moment, i have a default size of 80 elements, but this could eventually be anything up to 200 or more.
    Each array is acted on separately (one at a time) whether this is to read, write, or overwrite the elements within it.
    I want to be able to change the associated name of an array without altering any data stored in it. I may need each array to have the option of differing in size to the others (one reason why i cannot merely store them as rows in a 2D array), though this is not essential for now.
    Basically, i want to create a generic method of storing an undefined number of arrays of an undefined size, and being able to call up and edit them in the future without constantly reading and writing from a data file. The details i've given above are just to give an idea of the limitations and requirements i have.
    If anything is still unclear, i will try to find another way of saying it.
    James
    P.S. As a background of the intended use, i am running a series of identical tests at different temperatures. Each test produces a 1D array of datapoints, and each array is associated to a particular temperature. Each array has its own associated name (to aid selection and viewing both after and during the tests) which will usually be the temperature that the data was collected at. However, there may well be a need for the user to manually name some or all arrays.
    Their names are currently stored in a seperate array of strings, and each array is selected using a menu ring. The size of the data arrays is determined by the number of datapoints inputted. When a new array name is created (as a new element in the array of strings), a new 'blank' array is then created ready for data to be stored in it.
    The data from the arrays is then displayed on graphs on the FP, and can be written into excel.
    Never say "Oops." Always say "Ah, interesting!"

  • Passing large number of parameters

    In chapter 6 of the reports 6i documentation it states that one of the advantages of using a ref cursor is to "avoid the use of lexical parameters in your reports". I am not clear how it does this. Can anyone explain how this would work?
    In my application, I would like to print an exception report (ie use run_report) when an item in the base report exceeds a threshold amount. I would rather not pass all the subtotal values, as that would require passing a large number of parameters to the exception report. I can do it, but it seems like there should be an easier way. Passing a parameter of type RECORD would do it, but isn't allowed, right?
    null

    1. In some cases, you can avoid the use of lexical parameters in your reports
    with "static" ref cursor.
    Example for "static" ref cursor:
    1.1 Stored package
    CREATE OR REPLACE PACKAGE report_static IS
    TYPE type_ref_cur_sta IS REF CURSOR RETURN dept%ROWTYPE;
    FUNCTION func_sta (p_order_by VARCHAR2) RETURN type_ref_cur_sta;
    END;
    CREATE OR REPLACE PACKAGE BODY report_static IS
    FUNCTION func_sta (p_order_by VARCHAR2) RETURN type_ref_cur_sta IS
    ref_cur_sta type_ref_cur_sta;
    BEGIN
    IF p_order_by = 'dname' THEN
    OPEN ref_cur_sta FOR
    SELECT * FROM dept ORDER BY dname;
    ELSE
    OPEN ref_cur_sta FOR
    SELECT * FROM dept ORDER BY deptno;
    END IF;
    RETURN ref_cur_sta;
    END;
    END;
    1.2 Query PL/SQL in Reports
    function QR_1RefCurQuery return report_static.type_ref_cur_sta is
    begin
    return report_static.func_sta (:p_order_by);
    end;
    2. But if you need (for example) dynamic where, you (practically)
    can't use "static" ref cursor. In this case, you can use "dynamic" ref cursor
    (available from Oracle 8.1.5).
    Example for "dynamic" ref cursor (note that Reports need
    "static" ref cursor type for building Report Layout):
    2.1 Stored package
    CREATE OR REPLACE PACKAGE report_dynamic IS
    TYPE type_ref_cur_sta IS REF CURSOR RETURN dept%ROWTYPE; -- for Report Layout only
    TYPE type_ref_cur_dyn IS REF CURSOR;
    FUNCTION func_dyn (p_where VARCHAR2) RETURN type_ref_cur_dyn;
    END;
    CREATE OR REPLACE PACKAGE BODY report_dynamic IS
    FUNCTION func_dyn (p_where VARCHAR2) RETURN type_ref_cur_dyn IS
    ref_cur_dyn type_ref_cur_dyn;
    BEGIN
    OPEN ref_cur_dyn FOR
    'SELECT * FROM dept WHERE ' | | NVL (p_where, '1 = 1');
    RETURN ref_cur_dyn;
    END;
    END;
    2.2 Query PL/SQL in Reports
    function QR_1RefCurQuery return report_dynamic.type_ref_cur_sta is
    begin
    return report_dynamic.func_dyn (:p_where);
    end;
    Regards

  • Maximum Number of Parameters

    Hi,
    Is there any limit for the maximum number of Parameters i can pass to a procedure or function.
    Thank you for the help.

    There is a physical limit of 64k (65536) parameters which is based on limits imposed by PL/SQLs intermediate parsed form, DIANA. See
    http://download-west.oracle.com/docs/cd/B14117_01/appdev.101/b10807/e_limits.htm#LNPLS018
    However passing more than a handful is often considered a 'bad practice' - in such cases you might consider alternatives such as aggregating variables into composite types such as collections or record types in order to pass them around effectively.

  • How to pass variable number of parameters to a FORM.

    Hi,
    What is the correct syntax to pass variable number of parameters to a subroutine?
    PERFORM TEST TABLES BRETURN USING TEST_NAME CHANGING MY_OUTPUT.
    FORM TEST TABLES RETURN STRUCTURE BAPIRET2
              ITAB STRUCTURE ITABLE_LINE OPTIONAL
              USING VALUE(NAME) TYPE STRING
              CHANGING VALUE(OUTPUT) TYPE STRING.
    The above code does not work. How can we specify an optional parameter?
    Thanks and Regards,
    Sheetal
    Message was edited by: Sheetal Pisolkar

    Hi,
    I am trying to use a subroutine instead of function.A FUNCTION understands optional keyword.
    How can this work for a FORM?
    CALL FUNCTION 'TEST'
         EXPORTING
              MY_OUTPUT = 'output'
         IMPORTING
              TEST_NAME = 'mytest'.     
    FUNCTION TEST
    *     EXPORTING
    *          VALUE(OUTPUT) TYPE STRING
    *     IMPORTING
    *          VALUE(NAME) TYPE STRING
    *     TABLES
    *          RETURN STRUCTURE BAPIRET2 OPTIONAL
    *          ITAB STRUCTURE ITABLE_LINE OPTIONAL          
    ENDFUNCTION.
    PERFORM TEST USING TEST_NAME CHANGING MY_OUTPUT.
    FORM TEST TABLES RETURN STRUCTURE BAPIRET2 OPTIONAL
    ITAB STRUCTURE ITABLE_LINE OPTIONAL
    USING VALUE(NAME) TYPE STRING
    CHANGING VALUE(OUTPUT) TYPE STRING.
    ENDFORM.
    Is this be possible?
    Thanks
    Sheetal.

  • Unable to retrieve parameters from RFC Function Module

    Hi All,
    I have created a model for the RFC Enabled function module BAPI_BUPA_CENTRAL_GETDETAIL within my webdynpro program. I am passing parameters to the function module BAPI_BUPA_CENTRAL_GETDETAIL and I have validated that this is being passed correctly by displaying the passed value from the node of the input parameters.
    Code used to pass input parameters -
      IWDMessageManager manager = wdComponentAPI.getMessageManager();
       try
          wdContext.currentBapi_Bupa_Central_Getdetail_InputElement().modelObject().execute();
          size = wdContext.nodeCentraldataperson().size();     
          wdComponentAPI.getMessageManager().reportSuccess(Integer.toString(size));
          wdContext.nodeOutput().invalidate();
       catch(WDDynamicRFCExecuteException e)
          manager.reportException(e.getMessage(), false);
    I also see that it returns 1 record by using the code below:
    IWDMessageManager manager = wdComponentAPI.getMessageManager();
       try
          wdContext.currentBapi_Bupa_Central_Getdetail_InputElement().modelObject().execute();
          size = wdContext.nodeCentraldataperson().size();     
          wdComponentAPI.getMessageManager().reportSuccess(Integer.toString(size));
          wdContext.nodeOutput().invalidate();
       catch(WDDynamicRFCExecuteException e)
          manager.reportException(e.getMessage(), false);
    But, when I try to retrieve the value returned it does not fetch that value -
       Bapi_Bupa_Central_Getdetail_Output getdata = wdContext.nodeBapi_Bupa_Central_Getdetail_Input().nodeOutput().currentOutputElement().modelObject();
       Bapibus1006_Central_Person[] getres = new Bapibus1006_Central_Person[size];
       for(int i=0; i<size; i++){
            wdComponentAPI.getMessageManager().reportSuccess(Integer.toString(i));
            getres<i> = getdata.getCentraldataperson();
              //String fullname = wdContext.nodeBapi_Bupa_Central_Getdetail_Input().nodeOutput().nodeCentraldataperson().getElementAt(i).getAttributeValue("Fullname").toString();
            String fullname = getres<i>.getFullname();
           fullname += Integer.toString(i);
            wdContext.currentContextElement().setFullname(fullname);
            wdComponentAPI.getMessageManager().reportSuccess("fullname:" + fullname);
    It always returns 0 or null. Can someone please help me with this issue. The BAPI returns values in structure format and not internal table and hence I dont see the issue there as well.
    What can be the problem?
    Thanks for all your help in advance.
    Best regards,
    Divya

    Nikhil / Srihari,
    I changed my code and it now looks like -  I am trying get the return value into the context fullname but i still cant get the value although the size of nodeCentraldataperson() is thrown as 1 and the input is being passed correctly as i have validated this in this line of code [wdContext.nodeBapi_Bupa_Central_Getdetail_Input().currentBapi_Bupa_Central_Getdetail_InputElement().getBusinesspartner();]
    IWDMessageManager manager = wdComponentAPI.getMessageManager();
       try
          wdContext.currentBapi_Bupa_Central_Getdetail_InputElement().modelObject().execute();
          size = wdContext.nodeCentraldataperson().size();     
          wdComponentAPI.getMessageManager().reportSuccess(Integer.toString(size));
          wdContext.nodeCentraldataperson().invalidate();
       catch(WDDynamicRFCExecuteException e)
          manager.reportException(e.getMessage(), false);
         for(int i=0; i <size; i++){
              String name = "FullName: ";
              wdContext.nodeBapi_Bupa_Central_Getdetail_Input().nodeOutput().nodeCentraldataperson().setLeadSelection(i);
              name += wdContext.nodeBapi_Bupa_Central_Getdetail_Input().currentBapi_Bupa_Central_Getdetail_InputElement().getBusinesspartner();
              name += wdContext.nodeBapi_Bupa_Central_Getdetail_Input().nodeOutput().nodeCentraldataperson().currentCentraldatapersonElement().getFullname();
              wdContext.currentContextElement().setFullname(name);     
    Any idea what could be wrong?
    Thanks,
    Divya

  • Error executing CFC. Parameter index out of range (2 number of parameters, which is 1)

    Hi,
    My CFC component is defined as:
    <cffunction name="updateNote" output="false" access="remote"  returntype="void" >
         <cfargument name="notedetails" required="true" type="string" >
         <cfargument name="notename" required="true" type="string" />
         <cfquery name="qupdateNote" datasource="notes_db">
               UPDATE
                   notes
               SET
                   notes.notedetails=<CFQUERYPARAM CFSQLTYPE="CF_SQL_VARCHAR" VALUE="#ARGUMENTS.notedetails#">,
               WHERE
                   notename="<CFQUERYPARAM CFSQLTYPE="CF_SQL_VARCHAR" VALUE="#ARGUMENTS.notename#">"
        </cfquery>
    </cffunction>
    In Flash builder when I test the operation I get this error:
    "There was an error while invoking the operation. Check  your server settings and try invoking the operation again.
    Reason:  Server error Unable to invoke CFC - Error Executing Database Query. Parameter  index out of range (2 > number of parameters, which is 1)."
    Im really quessing that this is something small but right now its causing me to pull my hair out of my head!! Argg. Tried a bunch of things but I know thik im stuck.
    Help would be very very appreciated.
    Thanks

    Create test.cfm along these lines:
    <cfset myObj = createObject("component", "dotted.path.to.cfc.file")>
    <cfset myResult = myObj.myMethod(arg=value1, etc)>
    <cfdump var="#myResult#">
    Or, really, you could just browse to this:
    http://your.domain/path/to/your.cfc?method=yourMethod&arg1=value1 [etc]
    Although I dunno which of those two approachs will give you a better error message (indeed, it might be the same).
    Try both.
    Adam

  • What are the different types of parameters available in function builder an

    What are the different types of parameters available in function builder and where do we use them.

    The different type of parameters available in FM are
    Import - They are used to pass the values to the function module.
    Export- They are used by FM to pass the result back to the calling program.
    Changing - The variables are passed to the FM and can be changed during the FM processing.
    Tables - Internal tables can be passed to the FM (it works similar to changing parameter).

  • How to declare Dynamic table in Tables Parameters of a Function Module...

    Hi Gurus,
    I would like to Know how to declare a Dynamic table in Tables parameters of a Function Module.
    so that it should be able to hold any table data ....
    I have tried all possible ways of trying to assign fields-symbol like declarations which doesnt allow here ...
    plz Dont reply with the basics of creating dynamic internal tables, coz my case is not an Internal table it is FM table parameter declaration.....

    Hi,
    If you are requirement is to create a function module with tables parameter having a generic line type i.e. no specific line type
    just declare it with a name under Parameter name with out specifying the type.
    A reference function module with such parameter, i would quote is the standard GUI_UPLOAD/ GUI_DOWNLOAD where the parameters specified under TABLES are generic.
    If you want to process the values passed to these parameters in the source code of function module, field symbols would be a preferable option.
    Regards,
    Sharath Panuganti

  • Passing Variable Number of Parameters to Cobol Stored Procedure

    Hi. I have a web front end that needs to access several different tables via Cobol stored procedures. It seems simple enough to call the stored procedures straight away (DAO Pattern perhaps?) but my boss is insistent on having an intermediate Cobol program that decides which table to access. I think he at a bigger picture than I can see.
    The problem lies in the number of parameters that need to be passed to the stored procedures; some need 3, others needs 5, a few need 4. The only two solutions that I can think of are to pass EVERYTHING (we're talking 50 parameters or so) to the intermediate stored procedure and then pulling only what is needed from that data set to access the desired table. Solution number two involves passing everything to a temp table and then pulling what is needed from it. The former solution seems a little cleaner but still involves passing a lot of parameters. If Cobol could handle some sort of dynamic memory allocation (Vector) there seems to be a possible solution there. Though, as far as I know, that isn't possible.
    Any ideas are much appreciated.
    Thanks in advance,
    Chris

    Hi Saurabh,
    The method in which stored procedures are called on form submit is something as follows.
    Let us take your scenario of a form which has multiple checkboxes and a submit button. On clicking the submit button, this form data is submitted using either get or post. The form's submit action invokes a procedure.
    The HTML form code will look something like this..
    htp.formOpen( curl => 'URL /myProcedure',
    cmethod => 'post' );
    htp.formCheckbox( cname => 'myCheckbox'
    cvalue => 'A');
    htp.formCheckbox( cname => 'myCheckbox'
    cvalue => 'B');
    htp.formCheckbox( cname => 'myCheckbox'
    cvalue => 'C');
    htp.formSubmit( cname => 'myButton',
    cvalue => 'OK');
    Now, whenever the submit button is clicked, all these form values are passed to our stored procedure 'myProcedure'.
    "myProcedure" looks something like this.
    procedure myProcedure
    myCheckbox IN sys.owa_util.vc_arr,
    myButton IN VARCHAR2
    is
    begin
    end myProcedure;
    The point to be noted here is that the name of the variable being passed in the procedure is the same as the name of the HTML element being created in the HTML form. So, there is a direct mapping between the elements in the HTML form and the procedure parameters.
    Another noteworthy point is that since you have multiple checkboxes in your HTML form, it is impractical to name all the checkboxes differently and then pass those many parameters to your procedure (Imagine a scenario where there are a hundred check-boxes in an HTML form!). So portal allows you to give the same name (cname) to all the checkboxes in your HTML form, and if multiple checkboxes are checked, it will return all the checkbox values in an array (Note the usage of "myCheckbox IN sys.owa_util.vc_arr" in myProcedure).
    You can check out this link for more information.
    Re: retrieving data from fields
    Thanks,
    Ashish.

  • Variable number of parameters in a procedure

    Hello !
    I have a form in a procedure with dynamic inputs type "checkbox" (one checkbox by record of a table).
    The action of the form is another procedure. There is a variable number of parameters (depending on checked inputs).
    How can I do for retreiving these variable data within a single variable in my second procedure ?
    Thanks for help and sample
    null

    What u can do is use Javascript and pass all the selected checkbox Ids as a dilimited string..which u can read in second procedure and can perform appropriate action. for example if you have check box named as chk1,chk2,chk3,chk4 n so on..
    now if chk1,chk3,chk4 are checked then pass this string in the hidden field "1|3|4"which is a |(pipe) delimited string..

  • How to create a dynamic query in which I can vary number of parameters

    I am writing a JDBC connector. I want to write a dynamic query in that. The query should be able to proceed variable number of parameters and also in the where clause the and/or/like parameters I want to place dynamically.
    I can't write store procedures as we just have read only access to Database so I want to do it through query only.
    Please help me out in doing that as I am not able to proceed further without it ...

    Hi,
    Have a luk at :placeholder for IN condition in database adapter

  • PreparedStatement - unknown number of parameters

    Help!
    I have to use PreparedStatement to access an oracle database. This statement should be able to handle a number of values for one parameter. For example the parameter is area and there is a number of counties the user can choose...
    So i have a query statment like
    select population from populatn where area IN('BEAVER', 'CACHE'......)
    Here how do I use preparedstatement?
    Sue

    Yeah, that's always what they mean when they ask the
    question. The answer is still no.right. when you have a variable number of parameters than you don't have a prepared statement anymore.
    however if you want to get information about a prepared statement's parameters you can use getParameterMetaData method of PreparedStatement new in 1.4.

Maybe you are looking for

  • ComboBox with Lovs on Jdev 11g r2

    I'm facing this Error on JSF on Jdeveloper 11g r2, Windows7. I'm Using a ComboBox with Lovs on af:table. I'm getting this Error below when I invoke the (Search) option... to see the popup list. it works fine in every other case, if I select from the

  • Can i sing documents on ipad2? Can I make notes and corrections on a powerpoint file with a pen or something similar in the ipad2?

    Some one can help me if there is a way to sign documents on an ipad2 as on a tablet pc? or correct or making notes on a powerpoint file with some kind of pen in Ipad2? Thank you in advance!

  • WS32 - proper location for log4j.properties?

    Greetings, I am running WS3.2 and I have a log4j.properties file located in /resources/* within the IDE. As long as I manually copy the file into the "java/classes" directory the file is picked up at runtime. Ideally, Workshop should be automagically

  • Mobile textarea

    OK, I'm finally trying a mobile project and I've hit a very humbling roadblock. I cannot get text to wordwrap in design view for a textArea for a Flex Mobile project, targeted at iOS, 4.6. That can't be right.

  • IDOC generated a very long time

    Dear all, what reason will cause that IDOC generated a very long time ? My own thinking is this due to one instance's update processes are all running, 'update are all running' is due to 'high lock entries in SM12', but I don't know how to check what