No Pass-by-Value or Copy Constructors

After having used AS3 for some months now, I've realized that
there is no pass-by-value option when passing variables into
functions. The only option is pass-by-reference. Similarly, there
are no default copy constructors. So, if I want to create a copy of
an object, I have to write code to create a new instance of the
object and manually copy all of the source variable's properties to
the new target object.
This lack of a pass-by-value mechanism and copy constructors
leads to some confusing behavior and necessitates writing quite a
bit of extra code. A common case involving confusion is when a
function call changes a property of a passed-in object. The caller
might assume that the object will not be modified and then be
surprised when it is. This is especially likely to happen when
different people are working on the caller and the callee. It
shouldn't be necessary for the caller to be concerned about the
internal workings of an object being used but, because there is no
pass-by-value mechanism, the caller often must take this into
account.
Because of the lack of a pass-by-value mechanism the onus is
on the person writing a function to always make a copy of passed-in
objects if they are going to be modified. Unfortunately, the lack
of default copy constructors makes this an onerous task. The only
way to copy an object is to write code to create a new object and
then copy each property of the object. Where the properties are
objects themselves a deep copy is needed and the amount of code can
become large and the task tedious. To do this amounts to writing a
set of copy constructors for each object and sub-object - each time
a variable is accessed for modify.
To make matters worse, it's not even possible to write a copy
constructor for user-created classes. Consider the following
attempt at writing a copy constructor to copy two instance
variables for a custom Form class:
public function Form(f:Form) {
this._textHeight = f._textHeight;
this._actionURL = f._actionURL;
This causes a "Duplicate function definition" compile error
because a default constructor already exists.
Pass-by-value and built-in copy constructors are standard
features in most OOP languages and their lack in AS3 is a glaring
omission. I hope Adobe will seriously consider adding them to the
next version of ActionScript.

Nitin_Mathur wrote:
at one time i had doubted my own conceptsNote that the type of a parameter may be different from the type of the object you created. However, it is still the same value that is passed, as pointed out by this example:
public class Test {
    public Test() {
        //an object of type "MyClass" is created on the heap with the "new" operator:
        MyClass myClass = new MyClass();
        doSomething(myClass);//the reference to the object is passed by value
    private void doSomething(MyInterface myInterface) {
        //the passed value is a reference to a "MyClass" object,
        //but here it is considered to be a "MyInterface" object
        //and we don't have access to the "MyClass"-method "testClass()"
        myInterface.testInterface();
    public static void main(String[] args) {
        new Test();
interface MyInterface {
    public void testInterface();
class MyClass implements MyInterface {
    public void testInterface() {
        System.out.println("testInterface");
    public void testClass(){
        System.out.println("testClass");
}

Similar Messages

  • Copy constructor and temporary objects in C++

    I'd need some clarification on how constructor works when the argument is  a temporary object. I defined a dummy MyVect class with operator+ and copy constructor:
    class MyVect {
    public:
    MyVect() {
    cout << "Constructor" << endl;
    MyVect(const MyVect &vect){
    cout << "Copy Constructor" << endl;
    ~MyVect() {
    cout << "Destructor" << endl;
    MyVect operator+(const MyVect &v) const {
    cout << "operator+" << endl;
    MyVect result
    return result;
    Then I test it with this very simple code pattern:
    MyVect v1;
    MyVect v2;
    MyVect v3(v1 + v2);
    The output is:
    Constructor
    Constructor
    operator+
    Constructor
    Destructor
    Destructor
    Destructor
    The first two constructor calls are for v1 and v2, then operator+ for  v1+v2 is called, and  inside it there is a constructor call for result object. But then no copy constructor (nor constructor) for v3 is called. In my limited understanding of C++, I guessed that once the temporary object resulting from v1+v2 has been created, then it would be the argument of the copy constructor call. Instead it looks like the compiler transforms the temporary into v3, since v3 is correctly initialized as the sum of v1 and v2 (I tried with a more complicated version of MyVect to verify this). This behavior reminds me of the move semantics introduced with C++11, but I'm not using the -std=c++11 flag (and in fact if I try to define a move constructor the compilation fails).
    Can anyone please help me to understand what's happening under the hood? Thanks.
    Last edited by snack (2013-02-13 10:44:28)

    wikipedia wrote:The following cases may result in a call to a copy constructor:
    When an object is returned by value
    When an object is passed (to a function) by value as an argument
    When an object is thrown
    When an object is caught
    When an object is placed in a brace-enclosed initializer list
    These cases are collectively called copy-initialization and are equivalent to:[2] T x = a;
    It is however, not guaranteed that a copy constructor will be called in these cases, because the C++ Standard allows the compiler to optimize the copy away in certain cases, one example being the return value optimization (sometimes referred to as RVO).
    Last edited by Lord Bo (2013-02-13 13:58:47)

  • To pass by Value

    Hello,
    I know that n JAVA, types are passed by value and that Objects are passed by reference.
    Then, if I need an object to be passed by value, I have to construct a brand new object copied from the original object before passing it to my function.
    What's the best way of doing it? I mean what's the best way of creating a "copy constructor"
    (like in C++)?
    Thanks in advance
    Loic

    Have your object implement the Cloneable interface. Passing a clone, however will not change that it's passed by reference - it's just possible to create that effect - just thought I ought to mention it.

  • Passing multiple values to a parmeters in SQL Query

    Hi friends,
    I have the following requirement -
    I need to pass multiple values to the parameter 'WHERE hou.name = (:id1)' and the query is copied below for your reference .
    SELECT partno part_num,
         customer customer_name,
         hou.name op_name
         FROM hr_organization_units hou,
         oe_transaction_types_all sot,
         ra_customers rc,
         ra_addresses_all ra,
         ra_site_uses_all rsu,
         oe_order_headers_all h,
         oe_order_lines_all l,pwr_sod50 ps
         WHERE hou.name = (:id1)
    -- and hou.name = (:id4)
    --hou.name in ('CPS FRANCE','CPS GERMANY')
    --and hou.name = (:id1,hou.name)
         and trunc(ps.sch_ship_date) between nvl(:id2,trunc(ps.sch_ship_date)) and nvl(to_date(:id3)+.99999,trunc(ps.sch_ship_date))
         and ps.group_id = 9999999
         and hou.organization_id=h.org_id
         and ps.line_id =l.line_id
         and l.header_id =h.header_id
         and h.invoice_to_org_id=rsu.site_use_id
         and rsu.address_id =ra.address_id
         and ra.customer_id =rc.customer_id
         and h.order_type_id =sot.transaction_type_id
    Looking for your help on this.
    Thanks In Advance.
    Thanks & Regards
    Ramya Nomula

    Hi karthik,
    I am sorry for the wrong updation of my anonymus block.
    My requirement is to pass a multiple values to the parameter in SQL query, and here is the code which is working now for the multiple values with ourt single quotes to the values -
    SELECT partno part_num,
         customer customer_name,
         ps.customer_id customer_id,
         avail_qty avail_qty,
         sch_ship_date schedule_Ship_date,
         so_num order_no,
         h.header_id header_id,
         line_num line_no,
         l.ordered_quantity ordered_quantity,
         scd_qty qty_open,
         s_price unit_price,
         part_flag flag,
         sub_inv subinv,
         sbu,
         hold,
         qoh,
         line_detail_id detail_id,
         picking_line_id,
         picking_line_detail_id,
         rc.customer_name cust_name,
         rc.customer_number customer_number,
         rsu.location location,
         sot.attribute5 order_type,
         ps.line_id line_id,
         h.transactional_curr_code transactional_curr_code,
         hou.name op_name
         FROM hr_organization_units hou,
         oe_transaction_types_all sot,
         ra_customers rc,
         ra_addresses_all ra,
         ra_site_uses_all rsu,
         oe_order_headers_all h,
         oe_order_lines_all l,pwr_sod50 ps
         WHERE ','||:id1||',' like '%,'||hou.name||',%'
         and trunc(ps.sch_ship_date) between nvl(:id2,trunc(ps.sch_ship_date)) and nvl(to_date(:id3)+.99999,trunc(ps.sch_ship_date))
         and ps.group_id = 9999999
         and hou.organization_id=h.org_id
         and ps.line_id =l.line_id
         and l.header_id =h.header_id
         and h.invoice_to_org_id=rsu.site_use_id
         and rsu.address_id =ra.address_id
         and ra.customer_id =rc.customer_id
         and h.order_type_id =sot.transaction_type_id;
    Condition for sending multiple Oprtaing Units -
    WHERE ','||:id1||',' like '%,'||hou.name||',%'
    This above condition is working when i am passing multiple values with out single quotes...but not working for multiple values with single quotes.
    Sample queries tested -
    select 1 from dual where ',aa,bb,cc,' like '%,bb,%' (This is working)
    select 1 from dual where ','aa','bb','cc',' like '%,'bb',%'(This is not working).
    Thanks In Advance!
    Looking for Your Great Help.
    Thanks & Regards
    Ramya Nomula

  • Passing in values to a cursor in a package procedure

    Hi all
    I have a package :- test
    i have a procedure in the package :- test_proc
    in the procedure i have a cursor
    which has a select statement
    select jobid,jobname from jobs
    where jobcode = p_job_code; -- i think this is wrong
    when i execute the package i pass the job code to the package as a parameter which i use in the cursor above
    as a parameter i have values(i can select any of the above values )
    job code :-
    10
    20
    10,20
    how can i pass the values to the cursor in the procedure
    it is giving me invaiid number;

    Dear abcdxyz!
    As already stated you should try this with dynamic SQL. Here is an example for you:
    CREATE OR REPLACE PROCEDURE job_cursor(p_job_code VARCHAR2)
    IS
      l_jobid      NUMBER(5);
      l_jobname    VARCHAR2(30);
      c_job_cursor INTEGER;
      l_ignore     INTEGER;
    BEGIN
      -- open cursor on source table
      c_job_cursor := DBMS_SQL.Open_Cursor;
      -- parse the SELECT statement
      DBMS_SQL.parse(c_job_cursor, 'SELECT jobid, jobname FROM job WHERE job_code IN (' || p_job_code || ')', DBMS_SQL.NATIVE);
      -- define the column type
      DBMS_SQL.Define_Column(c_job_cursor, 1, l_jobid);
      DBMS_SQL.Define_Column(c_job_cursor, 2, l_jobname, 30);
      ignore := DBMS_SQL.Execute(c_job_cursor);
      LOOP
      -- Fetch a row from the source table
        IF DBMS_SQL.Fetch_Rows(c_job_cursor) > 0 THEN
            -- get column values of the row
            DBMS_SQL.Column_Value(c_job_cursor, 1, l_jobid);
            DBMS_SQL.Column_Value(c_job_cursor, 2, l_jobname);
        ELSE
           -- No more rows to copy
          EXIT;
        END IF;
      END LOOP;
      DBMS_OUTPUT.PUT_LINE(l_jobid || ', ' || l_jobname);
      DBMS_SQL.Close_Cursor(c_job_cursor);
    EXCEPTION
      WHEN OTHERS THEN
        IF DBMS_SQL.Is_Open(c_job_cursor) THEN
          DBMS_SQL.Close_Cursor(c_job_cursor);
        END IF;
        RAISE;
    END;
    /Yours sincerely
    Florian W.
    P.S. I haven't tested this procedure.

  • Passing a value to Inline View  WHERE clause through JDev...

    Hi ,
    I need to pass a value to inline view which is mentioned in below VIEW query.
    That view is created inside a view using jDev. Note that there are two WHERE clauses one in the Main query and the other in the Inline view.
    How to set the value for the innerView.
    //copied the code from Java
    view.volAlertsHistroyView.setWhereClauseParam(1, new Integer(clientId));
    Gives an error Missing IN or OUT parameter at index:: 1
    SELECT Alerts.SEND_TIME,
         Alerts.STATUS,
         Alerts.TEXT ,
         Groups.NAME,
              VolRoles.ROLE_NAME,
                   VolRoles.ID as vid,
                   Groups.ID as gid
         FROM ALERTS Alerts, ALERTS_GROUPS AlertsGroups, GROUPS Groups, VOL_ROLES VolRoles,
    --Inline view starts
    (SELECT GRP_ID, VRL_ID FROM vol_groups WHERE cli_id = :1) user_group_role
    --Inline view ends
    --Actual WHERE clause starts
         WHERE ((Alerts.ID = AlertsGroups.ALT_ID)AND (AlertsGroups.GRP_ID = Groups.ID))AND (AlertsGroups.VRL_ID = VolRoles.ID)
         AND AlertsGroups.VRL_ID = user_group_role.VRL_ID AND AlertsGroups.GRP_ID = user_group_role.GRP_ID
    Please get back to me .
    Regards
    Mohan
    [email protected]

    What happens when you change your Java code to:
    view.volAlertsHistroyView.setWhereClauseParam(0, new Integer(clientId));
    The ":1" does not directly relate to the where clause param index you use in Java. In your query you could also use a ":2" for example. In BC4J you still use "0" for the first param.
    Sascha

  • Pass Dynamic value to a field in xslt

    Hi,
    I have 5 different bpel processes & 5-10 xslts. I need to pass a hardcoded value(user) to one of the field in xslt which will be common for all xslt files. Now i want not to do hardcoding in every xsl. Rather, i want to make change at a place which will be effective for all others. what's the best approach to achieve this.
    Thanks,
    Vinit

    Hi Vinit
    I hope the following will solve your problem
    1) create variable of type 'parameters'.
    Ex:
    xmlns:ns4="http://schemas.oracle.com/service/bpel/common"
    <variable name="XSLTParam" element="ns4:parameters"/>
    2)
    <assign name="Assign9">
    <copy>
    <from><com:parameters xmlns:com="http://schemas.oracle.com/service/bpel/common">
    <com:item>
    <com:name>USER</com:name>
    <com:value/>
    </com:item>
    </com:parameters></from>
    <to variable="XSLTParam"/>
    </copy>
    <copy>
    <from variable="your_user"
    query="xpath+query of user"/>
    <to variable="XSLTParam"
    query="/ns4:parameters/ns4:item[ns4:name='USER']/ns4:value"/>
    </copy>
    </assign>
    3) pass these values to xsl
    EX:
    <assign name="Assign1">
    <copy>
    <from expression="ora:processXSLT('xsl/Transformation_1.xsl',bpws:getVariableData('Receive1_execute_InputVariable','part1'),bpws:getVariableData('XSLTParam'))"/>
    <to variable="Invoke1_Produce_Message_InputVariable"
    part="body"/>
    </copy>
    </assign>
    4) in xsl file
    define parameter
    EX:
    <xsl:param name="USER"/>
    <xsl:variable name="User_value">
    <xsl:value-of select="$USER"/>
    </xsl:variable>
    <inp1:user>
    <xsl:value-of select="$User_value"/>
    </inp1:user>
    Regards
    Vamsi..

  • How do I pass a value between two selectOneChoice fields

    I have two selectOneChoice (LOV fields) on the same JSF page (trinidad form). How do I pass the value from the first field to the second one?
    AutoSubmit=true;PartialTriggers doesn't work.
    I used SetActionListener to copy the value from the first LOV to a pageflow variable ( #{pageFlowScope.x} ) but that didn't work either. I wasn't sure how to reference it in the second LOV ...
    thanks
    John

    <af:selectonechoice value="#{bindings.select1.inputValue}" id="select1" autoSubmit="true">
    <af:setPropertyListener from="#{row}"
    to="#{pageFlowScope.detail}"
    type="valueChange"/>
    </af:selectonechoice>
    <af:selectonechoice value="#{pageFloScope.detail}" id="select2" partialTriggers="select1"/>
    The above code is a rough example. you can do the same using the valuechangelistener for the first lov and set the value for the second one..
    you can refer this
    How to set value for selectOneChoice

  • 12.4 beta: private copy constructor in base class required to be called from temporary reference when -g option used

    Hi,
    We've got an abstract base class (StringBase) which various types of strings inherit from. The copy constructor for this base class is private, since we don't want to allow copying when this class shouldn't be directly instantiated. A number of our methods take specify the base class as a reference, but take a derived class temporary as a default argument (see code appended).
    This worked fine in 12.3, but in 12.4 beta, this now says:
       Error: StringBase::StringBase(const StringBase&) is not accessible from __dflt_argA().
    This works fine in clang and gcc, and indeed, this GNU document says it was a bug which was fixed in gcc 4.3.0:
        Copy constructor access check while initializing a reference
    which references http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#391
    It only appears to error when the "-g" option is used, however, which doesn't seem right, and compiles fine if the "-g" option is removed, which makes me think it's a bug. Presumably the optimizer is eliding the copy when not using -g, but it's left in for debug mode, causing the compile error?
    Many thanks,
    Jonathan.
    $ clang++ -std=c++11 defaultarg.cpp
    $ g++ -std=c++11 defaultarg.cpp
    $ /opt/SolarisStudio12.4-beta_mar14-solaris-x86/bin/CC -c defaultarg.cpp
    $ /opt/SolarisStudio12.4-beta_mar14-solaris-x86/bin/CC -g -c defaultarg.cpp
    "defaultarg.cpp", line 6: Error: StringBase::StringBase(const StringBase&) is not accessible from __dflt_argA().
    1 Error(s) detected.
    $ cat defaultarg.cpp
    #include "stringbase.h"
    #include "conststring.h"
    static const ConstString S_DEFAULT("default value");
    void SomeMethod( const StringBase& str = S_DEFAULT )
       (void) str;
    int main( void )
       SomeMethod();
    $ cat stringbase.h
    #ifndef STRINGBASE_H
    #define STRINGBASE_H
    class StringBase
    protected:
       StringBase() {}
    private:
       StringBase( const StringBase& );
    #endif
    $ cat conststring.h
    #ifndef CONSTSTRING_H
    #define CONSTSTRING_H
    #include "stringbase.h"
    class ConstString : public StringBase
    public:
       ConstString() {}
       ConstString( const char* ) {}
       ConstString( const ConstString& );
    #endif

    Thanks for reporting the problem!
    This looks like a compiler bug, I think an artifact of creating a helper function for the debugger for the default argument.
    I have filed bug 18505648 for you.

  • Passing date value

    Dear all,
    using java improter i had imported one in oracle forms. in program unit i found this procedure which i need to call
    PROCEDURE setStartDate(
    obj ORA_JAVA.JOBJECT,
    a0 ORA_JAVA.JOBJECT) IS
    BEGIN
    args := JNI.CREATE_ARG_LIST(1);
    JNI.ADD_OBJECT_ARG(args, a0, 'java/util/Date');
    JNI.CALL_VOID_METHOD(FALSE, obj, 'com/yash/exchange/Task', 'setStartDate', '(Ljava/util/Date;)V', args);
    END;
    i think i shoud pass 2 parameters when calling this procedure. each is of ora_java.jobject datatype. a0 in java class was representing the start date which means its a date datatype. so how can i pass a value of date datatype in this parameter?

    Thank you so much, i had imported date package where i found this function:
    -- Constructor for signature (Ljava/lang/String;)V
    FUNCTION new(
    a0 VARCHAR2) RETURN ORA_JAVA.JOBJECT IS
    BEGIN
    args := JNI.CREATE_ARG_LIST(1);
    JNI.ADD_STRING_ARG(args, a0);
    RETURN (JNI.NEW_OBJECT('java/util/Date', '(Ljava/lang/String;)V', args));
    END;
    i think i should pass a date as a string. so what is the formate of the date to be sent?
    thanks

  • Pass a value to a class that extends AbstractTableModel

    Hi
    I have a problem with a table model that I cannot find a way of overcoming.
    I have created a class called MyTableModel that extends AbstractTableModel.
    MyTableModel creates and uses another class that I have defined in order to retrieve records from a database, MyTableModel fills the table with these records.
    However, I wish to alter my class in order to provide an int parameter that will act as a �where� value in the classes sql query.
    The problem is this, I cannot work out how to pass a value into MyTableModel. I have tried creating a simple constructor in order to pass the value but it doesn�t work.
    My code is shown below:
    import BusinessObjects.JobItemClass;
    import DBCommunication.*;
    import java.util.ArrayList;
    import javax.swing.table.AbstractTableModel;
    public class MyJobItemTableModel extends AbstractTableModel
      public MyJobItemTableModel(int j)
          jobNo = j;
      int jobNo;
      JobAllItems jobItems = new JobAllItems(jobNo);
      ArrayList items = jobItems.getItems();
      String columnName[] = { "Item Number", "Item Description", "Cost per item", "Quantity" };
      int c = items.size();
      Class columnType[] = { Integer.class, String.class, Double.class, Integer.class };
      Object table[][] =  new Object[c][4];
      public void fillTable()
          if(c > 0)
            for (int i = 0; i < c; i = i + 1)
              this.setValueAt(((JobItemClass) items.get(i)).getItemNumber(), i, 0);
              this.setValueAt(((JobItemClass) items.get(i)).getDescription(), i, 1);
              this.setValueAt(((JobItemClass) items.get(i)).getCostPerItem(), i, 2);
              this.setValueAt(((JobItemClass) items.get(i)).getQuantity(), i, 3);
      public void setJobNo(int s)
          jobNo = s;
      public int getColumnCount()
          if(c > 0)
            return table[0].length;
          else
              return 0;
      public int getRowCount()
        return table.length;
      public Object getValueAt(int r, int c)
        return table[r][c];
      public String getColumnName(int column)
        return columnName[column];
      public Class getColumnClass(int c)
        return columnType[c];
      public boolean isCellEditable(int r, int c)
        return false;
      public void setValueAt(Object aValue, int r, int c)
          table[r][c] = aValue;
    }Any advice will be appreciated.
    Many Thanks
    GB

    your JobAllItems is created before constructor code is run (since it is initialized in class member declaration)
    use something like
    public MyJobItemTableModel(int j)
          jobNo = j;
          items = (new JobAllItems(jobNo)).getItems();
          c = items.size();
          table =   new Object[c][4];
      int jobNo;
      ArrayList items;
      String columnName[] = { "Item Number", "Item Description", "Cost per item", "Quantity" };
      int c;
      Class columnType[] = { Integer.class, String.class, Double.class, Integer.class };
      Object table[][] ;instead of
    public MyJobItemTableModel(int j)
          jobNo = j;
      int jobNo;
      JobAllItems jobItems = new JobAllItems(jobNo);
      ArrayList items = jobItems.getItems();
      String columnName[] = { "Item Number", "Item Description", "Cost per item", "Quantity" };
      int c = items.size();
      Class columnType[] = { Integer.class, String.class, Double.class, Integer.class };
      Object table[][] =  new Object[c][4];

  • Parameter passing by value or by reference in function module

    hi everybody:
    Im a beginner for abap.
    Below description is described in online help.
    In function module, the CALL FUNCTION statement can pass import, export, and changing parameters either by value or by reference. Table parameters are always transferred by reference.
    I understand parameters passing by value means values carried by parameters are transferred, but I do not understand what is "by reference".
    Please kindly give me a explanation.
    Regards.
    Andy

    hi,
    Function modules are modular units with interfaces. The interface can contain the following elements:
    Import parameters are parameters passed to the function module. In general, these are assigned
    standard ABAP Dictionary types. Import parameters can also be characterized as optional.
    Export parameters are passed from the function module to the calling program. Export parameters
    are always optional and for that reason do not need to be accepted by the calling program.
    Changing parameters are passed to the function module and can be changed by it. The result is
    returned to the calling program after the function module has executed.
    Exceptions are used to intercept errors. If an error triggers an exception in a function module, the
    function module stops. You can assign exceptions to numbers in the calling program, which sets the
    system field SY-SUBRC to that value. This return code can then be handled by the program.
    By reference Passes a pointer to the original memory location.  Very efficient
    By value Allocates a new memory location for use within the subroutine. The memory is freed when the subroutine ends.  Prevents changes to passed variable
    By value and result Similar to pass by value, but the contents of the new memory is copied back into the original memory before returning.  Allows changes and allows a rollback
    When you pass a parameter by reference, new memory is not allocated for the value. Instead, a pointer to the original memory location is passed. All references to the parameter are references to the original memory location. Changes to the variable within the subroutine update the original memory location immediately.
    1  report ztx1804.
    2  data f1 value 'A'.
    3
    4  perform s1 using f1.
    5  write / f1.
    6
    7  form s1 using p1.
    8      p1 = 'X'.
    9      endform.
    The code in Listing produces the following output:
    X
    Hope this helps, Do reward.

  • To pass parameter values to the object reference of action step in sequence file of teststand programatically using C#.

    //Initialize the Engine
                EngineClass myEngine = new EngineClass();
                myEngine.LoadTypePaletteFilesEx(TypeConflictHandlerTypes.ConflictHandler_Prompt, 0);
                Step myStep = myEngine.NewStep(AdapterKeyNames.DotNetAdapterKeyname,StepTypes.StepType_Action);
                myStep.Name = "object";
                DotNetModule dotnetmodule = myStep.Module as DotNetModule;
                dotnetmodule.SetAssembly(DotNetModuleAssemblyLocations.DotNetModule_AssemblyLocation_File,@"C:sequence.dll");
                dotnetmodule.ClassName = "CN";
                dotnetmodule.MemberType = DotNetModuleMemberTypes.DotNetMember_GetProperty;
                dotnetmodule.MemberName = "ISI";  
    mySequence.Locals.NewSubProperty("object", PropertyValueTypes.PropValType_Reference, false, "", 0);        
    Sequence mySequence = myEngine.NewSequence();
                mySequence.Locals.NewSubProperty(varName, PropertyValueTypes.PropValType_Reference, false, String.Empty, 0);
    mySequence.InsertStep(myStep, 0, StepGroups.StepGroup_Main);
                SequenceFile seqFile = myEngine.NewSequenceFile();
                seqFile.InsertSequence(mySequence);
    seqFile.Save("C:\\mySeq.seq");
    I have done this,dynamically creating a sequence file in teststand programatically through c#.
    Problem is
    1.I created an action step and object Reference variable for the step, but i am not able to pass  parameter values to the objectReference 
    2.I am not able to load the sequence in to the main Sequence of the sequence file in the teststand. How can I do these two things.

    Hi,
    have you ever followed on my Links ?!?!?
    If not please jump to this one
    http://forums.ni.com/ni/board/message?board.id=330&thread.id=26880 
    and read the the answer from Mannoch
    starting with this words:
    Anthony -
    Currently, functionality for retrieving the Metadata Token for a class constructor or member is not fully provided in the TestStand .NET Adapter API. The DotNetModule.GetConstructorMetadataToken() and DotNetModule.GetMetadataToken() methods only return the correct Metadata Token when the member/constructor prototypes have already been loaded. Thus, in the case of your code, when you call DotNetModule.GetMetadataToken(), the method is returning -1 because the member prototype for the Step you are referring to has not yet been loaded.
    That means have to do a workaround for your stuff.
    Juergen
    =s=i=g=n=a=t=u=r=e= Click on the Star and see what happens :-) =s=i=g=n=a=t=u=r=e=

  • Subroutine parameters ..by default pass by value or pass by ref

    how parameters pass ?  value or ref
    if we use changing in both perform and form...will it become CALL BY REF?
    Message was edited by:
            balaji velpuri

    Hi,
    <u><b>The Parameter Interface</b></u>
    The USING and CHANGING additions in the FORM statement define the formal parameters of a subroutine. The sequence of the additions is fixed. Each addition can be followed by a list of any number of formal parameters. When you call a subroutine, you must fill all formal parameters with the values from the actual parameters. At the end of the subroutine, the formal parameters are passed back to the corresponding actual parameters.
    Within a subroutine, formal parameters behave like dynamic local data. You can use them in the same way as normal local data objects that you would declare with the DATA statement. They mask global data objects with the same name. The value of the parameters at the start of the subroutine is the value passed from the corresponding actual parameter.
    Subroutines can have the following formal parameters:
    <u><b>Parameters Passed by Reference</b></u>
    You list these parameters after USING or CHANGING without the VALUE addition:
    FORM <subr> USING ... <pi> [TYPE <t>|LIKE <f>] ...
    CHANGING ... <pi> [TYPE <t>|LIKE <f>] ...
    The formal parameter occupies no memory of its own. During a subroutine call, only the address of the actual parameter is transferred to the formal parameter. The subroutine works with the field from the calling program. If the value of the formal parameter changes, the contents of the actual parameter in the calling program also change.
    For calling by reference, USING and CHANGING are equivalent. For documentation purposes, you should use USING for input parameters which are not changed in the subroutine, and CHANGING for output parameters which are changed in the subroutine.
    To avoid the value of an actual parameter being changed automatically, you must pass it by value.
    <u><b>Input Parameters That Pass Values</b></u>
    You list these parameters after USING with the VALUE addition:
    FORM <subr> USING ... VALUE(<pi>) [TYPE <t>|LIKE <f>] ...
    The formal parameter occupies its own memory space. When you call the subroutine, the value of the actual parameter is passed to the formal parameter. If the value of the formal parameter changes, this has no effect on the actual parameter.
    <u><b>Output Parameters That Pass Values</b></u>
    You list these parameters after CHANGING with the VALUE addition:
    FORM <subr> CHANGING ... VALUE(<pi>) [TYPE <t>|LIKE <f>] ...
    The formal parameter occupies its own memory space. When you call the subroutine, the value of the actual parameter is passed to the formal parameter. If the subroutine concludes successfully, that is, when the ENDFORM statement occurs, or when the subroutine is terminated through a CHECK or EXIT statement, the current value of the formal parameter is copied into the actual parameter.
    If the subroutine terminates prematurely due to an error message, no value is passed. It only makes sense to terminate a subroutine through an error message in the PAI processing of a screen, that is, in a PAI module, in the AT SELECTION-SCREEN event, or after an interactive list event.
    <u><b>Specifying the Type of Formal Parameters</b></u>
    Formal parameters can have any valid ABAP data type. You can specify the type of a formal parameter, either generically or fully, using the TYPE or LIKE addition. If you specify a generic type, the type of the formal parameter is either partially specified or not specified at all. Any attributes that are not specified are inherited from the corresponding actual parameter when the subroutine is called. If you specify the type fully, all of the technical attributes of the formal parameter are defined with the subroutine definition.
    The following remarks about specifying the types of parameters also apply to the parameters of other procedures (function modules and methods). If you have specified the type of the formal parameters, the system checks that the
    corresponding actual parameters are compatible when the subroutine is called. For internal subroutines, the system checks this in the syntax check. For external subroutines, the check cannot occur until runtime. By specifying the type, you ensure that a subroutine always works with the correct data type. Generic formal parameters allow a large degree of freedom when you call subroutines, since you can pass data of any type. This restricts accordingly the options for processing data in the subroutine, since the operations must be valid for all data types. For example, assigning one data object to another may not even be possible for all data types. If you specify the types of subroutine parameters, you can perform a much wider range of operations, since only the data appropriate to those operations can be passed in the call. If you want to process structured data objects component by component in a subroutine, you must specify the type of the parameter.
    Regards,
    Bhaskar

  • Java is pass by value or pass by refrence

    Can any one explain whetherjava is pass by value or pass by refrence.

    Everything in Java is passed "by value". Everything.
    Pass-by-value
    - When an argument is passed to a function, the invoked function gets a copy of the original value.
    - The local variable inside the method declaration is not connected to the caller's argument; any changes made to the values of the local variables inside the body of the method will have no effect on the values of the arguments in the method call.
    - If the copied value in the local variable happens to be a reference (or "pointer") to an object, the variable can be used to modify the object to which the reference points.
    Some people will say incorrectly that objects are passed "by reference." In programming language design, the term pass by reference properly means that when an argument is passed to a function, the invoked function gets a reference to the original value, not a copy of its value. If the function modifies its parameter, the value in the calling code will be changed because the argument and parameter use the same slot in memory.... The Java programming language does not pass objects by reference; it passes object references by value. Because two copies of the same reference refer to the same actual object, changes made through one reference variable are visible through the other. There is exactly one parameter passing mode -- pass by value -- and that helps keep things simple.
    -- James Gosling, et al., The Java Programming Language, 4th Edition
    [Pass-by-Value Please (Cup Size continued)|http://www.javaranch.com/campfire/StoryPassBy.jsp]

Maybe you are looking for

  • Error Message on EO's method validator does not save

    Anyone know why when I define a validation using MethodValidator rule the error message does not save. I enter a string, click ok and click apply but when I look back the error message has disappeared? Is this a bug? I am using version 9.0.3.5 (Build

  • Colour Change in WAD

    Hi, Is it possible to change the colour of a report in WAD??? If yes then do let me know the steps???

  • Automation issues... urgent! Thanks!

    I'm working with a lot of MIDI tracks in Logic Express 8. I know that the A key is the shortcut to bring up the automations for the selected track. However, when I click "A," no matter what track is selected, the automations for the viola track pop u

  • Help on perplexing PS issue (side-by-side images)

    Every once in a while I print that has two side-by-side images on one piece of paper. My usual routine is to create a new document that is larger than the two images--say, 10x8 (horizontal) with a transparent background and the same resolution as the

  • Lightroom CC does not support Intel HD 3000 on MacBook Pro - please add support !!!!

    Installed the new Lightroom but it does not support the graphics on: MacBook Pro (13-inch, Early 2011) OSX 10.10.3 (actual version) Intel HD Graphics 3000 512 MB I see that Intel 4400 is required in Adobe Photoshop Lightroom Help | Lightroom GPU FAQ,