Use event function for multiple events

I've got several movieclip buttons on stage. For one of those buttons I've started of with:
button1.buttonMode = true;
button1.useHandCursor = true;
button1.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag);
function fl_ClickToDrag(event:MouseEvent):void
          button1.startDrag();
stage.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop);
function fl_ReleaseToDrop(event:MouseEvent):void
          button1.stopDrag();
Which works. But I would like to have that fl_ClickToDrag function excuted for all my other buttons too, so I don't have to duplicate that several times for each button. So I thought I use something like:
button1.buttonMode = true;
button1.useHandCursor = true;
button2.buttonMode = true;
button2.useHandCursor = true;
button1.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag);
button2.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag);
function fl_ClickToDrag(event:MouseEvent):void
  event.target.startDrag();
stage.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop);
function fl_ReleaseToDrop(event:MouseEvent):void
  event.target.stopDrag();
But that gives an error. What's the correct way?

Actually I got it working by using:
button1.buttonMode = true;
button1.useHandCursor = true;
button2.buttonMode = true;
button2.useHandCursor = true;
button1.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag);
button2.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag);
function fl_ClickToDrag(event:MouseEvent):void
  event.currentTarget.startDrag();
stage.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop);
function fl_ReleaseToDrop(event:MouseEvent):void
  stopDrag();

Similar Messages

  • Can I use Concatenate function for multiple rows?

    I have a lead list that contains 5000 leads. The format of this list contains address data that is saved in separate columns (ie: address, address 2, city, state, zip). I need this data in 1 column. I tried to use the concatenate function to combine the data for 1 row and it worked perfectly. I tried to do this for multiple rows and the function is greyed out. Is there a work around or way that I can combine this data for all 5000 rows without doing it 1 by one?

    Look at this table;
    In B9, the formula is;
    =B2&" "&C2&" "&D2&" "&E2&" "&B3&" "&C3&" "&D3&" "&E3
    Yvan KOENIG (VALLAURIS, France) dimanche 18 octobre 2009 20:51:47

  • Lock front panel until the event case for this event completes

    A Dynamic Event is a filtered event? Is this why "Lock front panel until the event case for this event completes" is not shown on Edit Event window dialog? I use Dynamic Event so I can subvi the event structure.
    I need stop my app from locking the FP whenever the user double clicks on the numerical array value (<-- the FP freezes the mouse and renders it useless) and stops the value from ever being changed. This event is registered for Value Change (not mouse up or down) and I get a locked mouse. As yet in the UI, no value changed occurs but I get a locked mouse. A LV bug?
    Trying to KISS, I can see this fixing this by moving ONLY the value change event to the top level VI instead of a dynamic registered event in a subVI. This will give me the option to NOT "Lock front panel until the event case for this event completes" .
    Solved!
    Go to Solution.

    richjoh wrote:
    Thx, Ben that fixed the problem when I unchecked "Lock panel...".
    So it appears LV locks the panel during runtime once the Dynamic Reg Events is on BD and it doesn't matter if your case to handle the Reg Events is created or NOT... interesting. That's why my mouse persisted to "freeze up" although I deleted the case for my FP array.
    Its situation like what you described that has given me many insights into how LV actually works. In one of my bbuggy VI's I found that a class wire can run a million miles through multiple sub-VI queues etc but the data itself is only touched when it has to be touched. in my case it was a crash while trying to write bogus class dat to a TDMS file.
    I am glad you are back on course.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Passing argument to, when using one class for multiple assets

    I had a class that I was passing a simple argument to like so:
    var quiz_1_2:CaseStudyQuiz = new CaseStudyQuiz(2);
    addChild(quiz_1_2);
    I now would like to use this class for multiple MCs in my library. I thought I could let Flash create a class for each of them and specifying the CaseStudyQuiz class as the Base class. When I do that, I get the following error:
    1136: Incorrect number of arguments.  Expected 0.
    Obviously this is because the class created by flash does not except an argument. Does that mean, I would have to create a seperate class for each of the movies that use that class? And if so, what would I have to do in that class for it to except the parameter and pass it on to my base class?
    Thank you very much for any help with this!!!

    use the super() function and pass your parameter.  but you still might get a runtime error but i don't think that will cause a problem.

  • Added Jcombobox into awt.frame causing handling event function cannot receive event

    Dear Sir,
    I want to ask how an awt.Choice  can set the number of rows that it can display, like the method setMaximumRowCount in JCombobox. Since I want to set more row can be displayed, but choice no any method can set. And I have tried to add Jcombobox into awt.frame, then, the handling event function cannot receive event for the right-top cornet button(minimize, maximum, close).
    Best Regards,

    please post a Short, Self Contained, Correct Example showing your problem.
    bye
    TPD

  • Shall I use one datasource for multiple connection pool?

    Hi,
    I need to clarrify that, Shall I use one Datasource for multiple connection pool in distributed transaction?
    Thanks with regards
    Suresh

    No. If its transactions across multiple databases you should use different datasources.

  • Can I use "dvt" function for customizing the chart format in OBIEE 11g?

    Hi,
    ".pcxml" file cannot be found in OBIEE11g. However, can I use "dvt" function for customization? If yes, how?
    Reference for dvt function:
    http://docs.oracle.com/cd/E23943_01/apirefs.1111/e12418/tagdoc/dvt_pieGraph.html

    Hello,
    I know it's possible, because i already found some blogs about changing the chart colors and turning off the animated graphs.
    <Graph visualEffects="NONE" animationDuration="0">
    But we want to alter more chart options, like make a bar chart default stacked. In 10G this was possible. I think this is also
    possible in 11G through the dvt-graph-skin.xml, but what i want to know is, is there a document that explains which tags you could use in this file.
    It would be great to get some help on this.

  • Use single realm for multiple web applciation in sharepoint 2013 and adfs 2.0

    Use single realm for multiple web applciation in sharepoint 2013 and adfs 2.0
    Please help!!

    I dont think you can do this, because you have to name/url of the web application in realm. You have to add new realm for each web application.here is script to add another realm.
    Add-PSSnapin "Microsoft.SharePoint.PowerShell"
    $sts = Get-SPTrustedIdentityTokenIssuer | where {$_.Name -eq "ADFS2.0"}
    $uri = new-object System.Uri("http://url/")
    $sts.ProviderRealms.Add($uri, "urn:sharepoint:Name")
    $sts.Update();
    Please remember to mark your question as answered &Vote helpful,if this solves/helps your problem. ****************************************************************************************** Thanks -WS MCITP(SharePoint 2010, 2013) Blog: http://wscheema.com/blog

  • Help in using listagg function for more than 8000 char.

    Hi Friends,
    Need you urgent help in using listagg function for more than 8000 char.
    I did the below sample SQL and in "e_orig" and "d_orig" for upto 4000 char it is working fine but I have to use it for more than 8000 char. and it is giving error,
    I checked the listagg function is having limitation of 4000 char.
    I tried but I am unable to achive this. Can someone provide me a sample example to achive this
    select d.dname,d.loc,e.hiredate
    ,listagg(e.ename,',' ) within group (order by e.deptno) over (partition by e.deptno) as e_orig
    ,listagg(e.ename, ',') within group (order by e.sal) over (partition by e.deptno) as d_orig
    from emp e, dept d
    where e.deptno=d.deptno;[ This is my first post, I gone through the guideline for posting a post , and try to go according to that ( I have not pasted here create table and insert as I have used basic table emp, dept for example), please let me know if still I should give this, I will take care from my next post ]
    Thanks in advance

    Interesting, I didn't know you could do that, but...
    BluShadow wrote:
    You could write some PL/SQL code that does it all for you, but that would involve loops and would be slow.Well, objects are written in PL/SQL aren't they? And presumably there'll be implicit looping too? So it's not at all obvious that this method will be faster than doing the joining in PL/SQL in memory. The only way to find out is to benchmark them - so I have done that.
    I noticed that OP's ref cursor actually only ever retrieves a single record for a bound department number, so I decided the best thing would be to test using a procedure that passes an output string back. I selected all (109) employees and put spaces in to ensure above 4000 characters. I also noticed that as he is using PL/SQL he probably can use a VARCHAR2 type, but just not ListAgg in the query, so I wrote short procedures as follows:
    SimpleAggChr     - bulk collect and array processing, VARCHAR2 output
    ClobAggPrc     - the custom aggregation method, CLOB output
    SimpleAggClob     - bulk collect and array processing, CLOB output
    I then wrote a driving script that calls them in the order above and times each call (I like benchmarking so I have my own timing object to make it easy). I then print the lengths for checking, and my object writes the timings to my output table. Running a few times I got varying results, but generally it looks like there isn't a lot to choose between them for performance.
    Here's the procedure code:
    CREATE OR REPLACE TYPE char100_list_type AS TABLE OF VARCHAR2(100)
    CREATE OR REPLACE PROCEDURE SimpleAggChr (x_out OUT VARCHAR2) IS
      l_enames     char100_list_type;
    BEGIN
      SELECT first_name || '                                        ' || last_name
        BULK COLLECT INTO l_enames
        FROM employees
       ORDER BY salary;
      FOR i IN 1..l_enames.COUNT LOOP
        x_out := x_out || l_enames(i) || ',';
      END LOOP;
    END SimpleAggChr;
    CREATE OR REPLACE PROCEDURE SimpleAggClob (x_out OUT CLOB) IS
      l_enames     char100_list_type;
    BEGIN
      SELECT first_name || '                                        ' || last_name
        BULK COLLECT INTO l_enames
        FROM employees
       ORDER BY salary;
      FOR i IN 1..l_enames.COUNT LOOP
        x_out := x_out || l_enames(i) || ',';
      END LOOP;
    END SimpleAggClob;
    SHO ERR
    PROMPT ClobAggPrc
    CREATE OR REPLACE PROCEDURE ClobAggPrc (x_out OUT CLOB) IS
    BEGIN
      SELECT clobagg(first_name || '                                        ' || last_name || ',')
        INTO x_out
        FROM employees
       ORDER BY salary;
    END ClobAggPrc;
    SHO ERRand the driving script:
    SET SERVEROUTPUT ON
    SET TIMING ON
    DECLARE
      l_enames_c1     CLOB;
      l_enames_c2     CLOB;
      l_enames_v     VARCHAR2(32767);
      l_timer     timer_set_type := timer_set_type ('Aggregation');
    BEGIN
      Utils.g_id := 'Aggregation';
      SimpleAggChr (l_enames_v);
      l_timer.Increment_Time ('SimpleAggChr');
      ClobAggPrc (l_enames_c1);
      l_timer.Increment_Time ('ClobAggPrc');
      SimpleAggClob (l_enames_c2);
      l_timer.Increment_Time ('SimpleAggClob');
      DBMS_Output.Put_Line ('SimpleAggChr returned string of length ' || Length (l_enames_v));
      DBMS_Output.Put_Line ('ClobAggPrc returned string of length ' || Length (l_enames_c1));
      DBMS_Output.Put_Line ('SimpleAggClob returned string of length ' || Length (l_enames_c2));
      l_timer.Write_Times;
    END;
    SET TIMING OFF
    SET LINES 150
    SET PAGES 1000
    COLUMN id FORMAT A30
    COLUMN line_text FORMAT A120
    SELECT line_text
      FROM output_log
    WHERE id = 'Aggregation'
    ORDER BY line_ind
    /and the results:
    SimpleAggChr returned string of length 5779
    ClobAggPrc returned string of length 5779
    SimpleAggClob returned string of length 5779
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:27.05
    LINE_TEXT
    Timer Set: Aggregation, constructed at 03 Nov 2011 16:27:07, written at 16:27:35
    ================================================================================
    [Timer timed: Elapsed (per call): 0.02 (0.000016), CPU (per call): 0.01 (0.000010), calls: 1000, '***' denotes corrected
    line below]
    Timer              Elapsed          CPU          Calls        Ela/Call        CPU/Call
    SimpleAggChr          9.84         0.36              1         9.84400         0.36000
    ClobAggPrc            9.37         0.32              1         9.37400         0.32000
    SimpleAggClob         8.25         0.22              1         8.25000         0.22000
    (Other)               0.00         0.00              1         0.00000         0.00000
    Total                27.47         0.90              4         6.86700         0.22500
    13 rows selected.

  • Can i use create function for MSSql scalar and table valude function.

    Hi,
    1) Can i use create function for MSSql scalar and table valued function?
    2) How many type of user defined function are there in oracle 11g express?
    3) And can i reture any "type" form user defined function?
    yourse sincerely

    944768 wrote:
    Q1)That means even if i return predefined types like integer, varchar2 then also PGA is used ?The data type does not determine where the variable is stored. A string (called a varchar2 in Oracle) can be stored in stack space, heap space, on disk, in a memory mapped file, in a shared memory, in an atom table, etc.
    It is the who and what is defining and using that string, that determines where and how it is stored.
    The Oracle sever supports 2 languages in PL/SQL. The PL (Programming Logic) language is a procedural/declarative language. It is NOT SQL. SQL is integrated with it. The PL/SQL engine uses private process memory (PGA). So PL/SQL variables exist in the PGA (but there are exceptions such as LOBs).
    Q2) So please suggest me solution in oracle.Sounds to me you are looking at how to implement a T-SQL style function as an Oracle function, and once implemented, do joins on the function.
    Do not use PL/SQL in SQL in place of a SQL select. It is not T-SQL.
    One cannot use PL/SQL to create functions along the style of T-SQL, where the function executes a SQL using some conditional logic, and then return as if the function was a native SQL select.
    T-SQL is an extension to the SQL language - making it a hybrid and very impure language implementation. PL is based on ADA - part of the Pascal family of languages. The E-SQL (embedded SQL) approach used in languages like C/C++, Cobol and Ada, has been transparently done in PL/SQL. You can write and mix PL code and variables with SQL code. And the PL/SQL engine figures out how to make the call from the PL/SQL engine to the SQL engine.
    But PL/SQL is not "part" of the SQL language and does not "extend" the SQL language in a T-SQL fashion.
    So you need to check your SQL-Server preconcepts in at the door, as they are not only irrelevant in Oracle, they are WRONG in Oracle.
    The correct way in Oracle, in a nutshell - Use the SQL language to do data processing. Use PL/SQL to manage conditional process flow and the handling of errors.

  • Standard ABAP functions for creating events?

    Hi,
    I'm a little bit confused which ABAP functions to use for creating academic events with schedules (e.g. lecture takes places each Friday at 4 pm), rooms and instructors attached.
    Data transfer documentation SAP team recently released ("SLCM Data Transfer" archive, "Intro" document, page 18) suggests <b>HRIQ_CREATE_EVENT</b> as a solution. However, after experimenting for a while, I noticed a note attached to this function that "DO NOT USE ANYMORE, USE <b>HRIQ_EVENT_CREATE</b>".
    So which one is the correct/recommended one? Also, if possible, I would prefer an RFC-enabled one.
    Thanks
    Janek

    Hi Janek,
    We've created a custom RFC enabled function module to wrap the SAP function module HRIQ_CREATE_EVENT in.  We are on a 4.7 system.  Here is our code.  Hope it helps.
    FUNCTION zcep_event_create .
    *"*"Local interface:
    *"  IMPORTING
    *"     VALUE(VTASK) TYPE  HRRHAP-VTASK DEFAULT 'V'
    *"     VALUE(EVENTPACKAGEID) TYPE  HROBJID
    *"     VALUE(ACAD_YEAR) TYPE  PIQPERYR
    *"     VALUE(ACAD_SESSION) TYPE  PIQPERID
    *"  TABLES
    *"      MEETING_PATTERN STRUCTURE  ZCEP_MEETINGPATTERN
    *"      EVENT STRUCTURE  ZCEP_EVENT
    *"      RETURN STRUCTURE  BAPIRET2
      DATA: is_schedule TYPE bapisched,
            schedule TYPE bapisched OCCURS 0 WITH HEADER LINE,
            capacity LIKE hri1024,
            wa_capacity LIKE hri1024 OCCURS 0 WITH HEADER LINE,
            location LIKE bapilocdat-locid OCCURS 0,
            new_event_package LIKE p1000 OCCURS 0 WITH HEADER LINE,
            objid  LIKE hrrootob OCCURS 0 WITH HEADER LINE,
            parent LIKE hrhctobjc OCCURS 0 WITH HEADER LINE,
            eventid TYPE hrobjid,
            event_id_out LIKE bapievdat-eveid,
            lt_1739 TYPE TABLE OF p1739,
            ls_1739 TYPE p1739,
            ls_error_record TYPE bapiret2,
            ls_nnnn TYPE wplog,
            open_resources_exits TYPE xfeld.
      DATA:  it_1035 TYPE piq_p1035_t,
             it_pt_1035t TYPE piq_hrt1035_t,
             it_daysoff TYPE piq_pt1035_t,
             it_daysfree TYPE piq_pt1035_t,
             ls_daysfree TYPE pt1035,
             ls_1035t TYPE hrt1035.
      DATA: it_bapiresou TYPE TABLE OF bapiresou,
            is_bapiresou TYPE bapiresou,
            resources TYPE bapiresou OCCURS 0.
      DATA: it_pa0002 TYPE TABLE OF pa0002,
            is_pa0002 TYPE pa0002,
            it_hrp1000 TYPE TABLE OF hrp1000,
            is_hrp1000 TYPE hrp1000,
            lv_dayoff(1),
            bp(12),
            im_begda LIKE sy-datum,
            im_endda LIKE sy-datum,
            sobid LIKE hrp1001-sobid,
            event_counted_dates TYPE dayct,
            event_counted_hours TYPE hrsct,
            ndays TYPE p1035-ndays,
            nhours TYPE p1035-nhours.
      FIELD-SYMBOLS: <ls_1035t> LIKE LINE OF it_pt_1035t.
      CLEAR gt_error_record[].
      SORT event BY short.
      SORT meeting_pattern BY eventname.
    *************************  Get Calender Date  *************************
      SELECT SINGLE begda endda FROM hrt1750 INTO (im_begda,im_endda)
              WHERE peryr = acad_year
                AND perid = acad_session
                AND timelimit = '0100'.
    ***************************  Create Event  ****************************
      LOOP AT event.
        CLEAR resources.
        LOOP AT meeting_pattern WHERE eventname = event-short.
    *********************  Create Schedule for Event  *********************
          CALL FUNCTION 'HRIQ_EVENT_SCHEDULE_BUILD'
            EXPORTING
              plvar                = '01'
              istat                = '1'
              event_begda          = event-begda
              event_endda          = event-endda
              monday               = meeting_pattern-monday
              tuesday              = meeting_pattern-tuesday
              wednesday            = meeting_pattern-wednesday
              thursday             = meeting_pattern-thursday
              friday               = meeting_pattern-friday
              saturday             = meeting_pattern-saturday
              sunday               = meeting_pattern-sunday
              event_beguz          = meeting_pattern-start_time
              event_enduz          = meeting_pattern-end_time
              frequency            = '1'
              event_location       = meeting_pattern-location
            IMPORTING
              pt_1035              = it_1035
              pt_1035t             = it_pt_1035t
              pt_daysoff           = it_daysoff
              pt_daysfree          = it_daysfree
            EXCEPTIONS
              no_date_number       = 1
              frequency_is_initial = 2
              OTHERS               = 3.
          LOOP AT it_daysfree INTO ls_daysfree.
            CALL FUNCTION 'HRIQ_CHECK_MODULOFFER_DAYSOFF'
              EXPORTING
                iv_date             = ls_daysfree-evdat
              IMPORTING
                ev_dayoff           = lv_dayoff
              EXCEPTIONS
                otype_not_supported = 0
                OTHERS              = 0.
            IF lv_dayoff = space.
              MOVE-CORRESPONDING ls_daysfree TO ls_1035t.
              APPEND ls_1035t TO it_pt_1035t.
            ENDIF.
          ENDLOOP.
    * no double entries
          SORT it_pt_1035t.
          DELETE ADJACENT DUPLICATES FROM it_pt_1035t.
          DESCRIBE TABLE it_pt_1035t LINES event_counted_dates.
          CLEAR event_counted_hours.
          LOOP AT it_pt_1035t INTO ls_1035t.
            nhours = ( ls_1035t-enduz - ls_1035t-beguz ) / 3600.
            event_counted_hours = event_counted_hours + nhours.
            ADD 1 TO ndays.
          ENDLOOP.
          LOOP AT it_pt_1035t ASSIGNING <ls_1035t>.
            MOVE-CORRESPONDING <ls_1035t> TO schedule.
            APPEND schedule.
          ENDLOOP.
    *Room
          IF NOT meeting_pattern-room IS INITIAL.
            SELECT SINGLE short stext FROM hrp1000
                     INTO (is_hrp1000-short,is_hrp1000-stext)
                    WHERE plvar = '01'
                      AND istat = '1'
                      AND otype = 'G'
                      AND objid = meeting_pattern-room
                      AND begda LE sy-datum
                      AND endda GE sy-datum.
            SELECT SINGLE sobid FROM hrp1001 INTO sobid
                    WHERE otype = 'G'
                      AND plvar = '01'
                      AND istat = '1'
                      AND relat = '020'
                      AND rsign = 'A'
                      AND sclas = 'R'
                      AND objid = meeting_pattern-room
                      AND begda LE im_endda
                      AND endda GE im_begda.
            IF sy-subrc = 0.
              is_bapiresou-retid = sobid(8).
            ENDIF.
            LOOP AT it_pt_1035t ASSIGNING <ls_1035t>.
              is_bapiresou-resht = is_hrp1000-short.
              is_bapiresou-resxt = is_hrp1000-stext.
              is_bapiresou-resbg = <ls_1035t>-evdat.
              is_bapiresou-resed = <ls_1035t>-evdat.
              is_bapiresou-beguz = meeting_pattern-start_time.
              is_bapiresou-enduz = meeting_pattern-end_time.
              is_bapiresou-resid = meeting_pattern-room.
              is_bapiresou-restp = 'G'.
              APPEND is_bapiresou TO resources.
            ENDLOOP.
          ENDIF.
    * Instructor
          IF NOT meeting_pattern-instructor IS INITIAL.
            SELECT SINGLE nachn vorna FROM pa0002
                     INTO (is_pa0002-nachn, is_pa0002-vorna)
                    WHERE pernr = meeting_pattern-instructor
                      AND begda LE im_endda
                      AND endda GE im_begda.
    **************************  Meeting Pattern  **************************
            SELECT SINGLE objid INTO is_bapiresou-retid FROM hrp1000
                    WHERE plvar = '01'
                      AND langu = 'E'
                      AND otype = 'R'
                      AND mc_short = 'INST-CM'
                      AND begda LE im_endda
                      AND endda GE im_begda.
            LOOP AT it_pt_1035t ASSIGNING <ls_1035t>.
              is_bapiresou-resht = is_pa0002-nachn.
              CONCATENATE is_pa0002-vorna is_pa0002-nachn
                     INTO is_bapiresou-resxt
                SEPARATED BY space.
              is_bapiresou-resbg = <ls_1035t>-evdat.
              is_bapiresou-resed = <ls_1035t>-evdat.
              is_bapiresou-beguz = meeting_pattern-start_time.
              is_bapiresou-enduz = meeting_pattern-end_time.
              is_bapiresou-resid = meeting_pattern-instructor.
              is_bapiresou-restp = 'P'.
              APPEND is_bapiresou TO resources.
            ENDLOOP.
          ENDIF.
        ENDLOOP.
        wa_capacity-kapz1 = event-mincapty.
        wa_capacity-kapz2 = event-optcapty.
        wa_capacity-kapz3 = event-maxcapty.
        capacity = wa_capacity.
        CALL FUNCTION 'HRIQ_CREATE_EVENT'
          EXPORTING
            planversion     = '01'
            event_id_in     = '00000000'
            event_short     = event-short
            event_stext     = event-stext
            status          = '1'
            begin_date      = event-begda
            end_date        = event-endda
            language        = sy-langu
            eventtype       = event-betype
            capacity        = capacity
            location        = meeting_pattern-location
            check_resources = ' '       "'X'
            vtask           = 'B'
          IMPORTING
            event_id_out    = event_id_out
          TABLES
            schedule        = schedule
            resources       = resources
            return          = return.
        IF sy-subrc NE 0.
          CALL FUNCTION 'HRIQ_CLEAR_BUFFER'.
          CALL FUNCTION 'HRIQ_CLEAR_PLOG_TAB'.
          return-type = 'E'.
          return-message = 'Error during save'.
          APPEND return.
        ENDIF.
        LOOP AT return WHERE id = 'HRPIQ000'
                         AND number = '846'.
          return-type = 'E'.
          return-message = 'Resources already in use'.
          APPEND return.
          EXIT.
        ENDLOOP.
    **********************  Create Session offering  **********************
        MOVE-CORRESPONDING ls_nnnn TO ls_1739.
        ls_1739-mandt = sy-mandt.
        ls_1739-plvar = '01'.
        ls_1739-otype = 'E'.
        ls_1739-objid = event_id_out.
        ls_1739-istat = '1'.
        ls_1739-begda = event-begda.
        ls_1739-endda = event-endda.
        ls_1739-aedtm = sy-datum.
        ls_1739-uname = sy-uname.
        ls_1739-infty = '1739'.
        ls_1739-peryr = acad_year.
        ls_1739-perid = acad_session.
        APPEND ls_1739 TO lt_1739.
        PERFORM create_infotype USING lt_1739
                             CHANGING ls_error_record .
        APPEND ls_error_record TO return.
        READ TABLE return  WITH KEY type = 'E'.
        IF sy-subrc <> 0 AND vtask = 'V'.
          CALL FUNCTION 'HRIQ_UPDATE_DATABASE'
            EXPORTING
              vtask          = 'D'
              commit_flg     = 'X'
            EXCEPTIONS
              corr_exit      = 1
              internal_error = 2
              OTHERS         = 3.
          IF sy-subrc NE 0.
            CALL FUNCTION 'HRIQ_CLEAR_BUFFER'.
            CALL FUNCTION 'HRIQ_CLEAR_PLOG_TAB'.
            return-message = 'Error during save'.
            APPEND return.
          ENDIF.
        ELSE.
          CALL FUNCTION 'HRIQ_CLEAR_BUFFER'.
          CALL FUNCTION 'HRIQ_CLEAR_PLOG_TAB'.
          EXIT.
        ENDIF.
    *********************  Create Relationship(E-SE)  *********************
        parent-objid = event_id_out.
        parent-otype = 'E'.
        APPEND parent.
        PERFORM create_relation TABLES parent
                                 USING 'B512'
                                       'SE'
                                       event-begda
                                       event-endda
                                       eventpackageid
                              CHANGING ls_error_record.
      ENDLOOP.
      IF vtask = 'V' AND ls_error_record IS INITIAL.
        PERFORM update_database CHANGING ls_error_record.
      ELSE.
        APPEND ls_error_record TO return.
        CALL FUNCTION 'HRIQ_CLEAR_BUFFER'.
        CALL FUNCTION 'HRIQ_CLEAR_PLOG_TAB'.
      ENDIF.
      DELETE return WHERE type IS INITIAL.
    ENDFUNCTION.

  • Using a function in multiple scenes

    I have a .fla project being created under CS4, using
    ActionScript 3.0, that consists of multiple scenes.
    In the code attached to the first scene, I define some
    functions that are used as methods on buttons:
    function MouseDown(TheKey:Object):void
    TheKey.alpha=0.6;
    function MouseUp(TheKey:Object):void
    TheKey.alpha=1.0;
    function AlphaPoint6(event:MouseEvent):void
    MouseDown(event.currentTarget);
    function AlphaonepointO(event:MouseEvent):void
    MouseUp(event.currentTarget);
    And I use a couple of the functions as EventListener methods
    on buttons
    Key1.addEventListener(MouseEvent.MOUSE_DOWN,AlphaPoint6);
    Key1.addEventListener(MouseEvent.MOUSE_UP,AlphaonepointO);
    So far so good.
    Then, I create a second scene in which I have some other
    buttons.
    When I try using the same functions as eventlisteners on
    these buttons, in the code for the second scene:
    Key11.addEventListener(MouseEvent.MOUSE_DOWN,AlphaPoint6);
    Key11.addEventListener(MouseEvent.MOUSE_UP,AlphaonepointO);
    then, I get the error messages
    1120: Access of undefined property AlphaPoint6
    1120: Access of undefined property AlphaonepointO
    BUT, if I try declaring these functions again with the script
    of the second scene, I get the error message
    1021 Duplicate Function definition
    So, I seem to be stuck between a rock and a hard place. On
    the one hand, when the compiler parses the second scene, it
    believes those functions are defined (as it is not happy if you try
    defining them again). On the other hand, the compiler does not
    think they are defined. as it considers them to be undefined
    properties.
    Does anyone have an idea about how to resolve this conumdrum?

    One option is to not use scenes. Just take what you have as
    scenes and either place them in the one timeline, or convert them
    into movielcips. In my own design work, I have never used scenes.
    When I first encopuntered them via someone else's design, I
    immediately disliked them because it meant I had to search thru
    inobvious places to find things that needed to be revised. Other
    folks that help in these forums have their own reasons for
    promoting not using scenes... troublesome, unreliable, outdated,
    etc

  • DAQmx in Event structure / avoid multiple events

    Hi all
    I've started creating program for acquisition and analysis of data . I don't have much experience in LabVIEW, but it's important to me to start creating this application in good way. Can you give me some advice about things below?
    I prepared template with Event structure, based on some article .
    First question is how exactly place DAQmx blocks in it. Now they are all on one state of case structure "test", but I'm not sure that's correct because most of the example on NI side have initialization (like sample rate, number of saple) outside of the loop? It's important to make it possible to change parameter between measurements.
    Second. How to avoid multiple events. In example: button TEST is pressed, measurement is taken. This measurement take a long time. I've started bored, and some other buttons (maybe TEST ) accidentally were pressed. When measurement is completed  it would be good idea to destroy this events associated with accidently pressed buttons. It is possible to do it? What's the best way when there's a lot of buttons(when analysis part of program will be added)?
    Best Regards
    PS. sorry about my english
    Attachments:
    pgm.vi ‏33 KB
    Enum_Events.ctl ‏5 KB

    Dear Finch!
    Welcome to NI Forums!
    My first advice regarding your code would be to use shift registers instead of Queues as your state storage, since (as you've said) there is no reason to store multiple events that have happened. The state machine design pattern, which I strongly recommend in this scenario is built into LabVIEW, you can use it as a template if you go to the New.. menu.
    Please check out these materials for further discussion about state machines.
    You are correct in that most of the DAQmx VIs can be placed outside of the loop, only DAQmx Read (the function we actually use more then once) must be placed inside the loop, the rest can stay out. If you want to modify some parameters (like Timing) mid-execution, you only have to stop the task, set them, then start it again.
    This can be easily done in a different state, which can execute only when some parameters have changed.
    Also, if you want your user to be unable to interact with certain controls while the test is being taken, you can programmatically disable them with a Property Node. 
    Please get back to me if you have any other questions.
    Best regards:
    Andrew Valko
    NI Hungary
    Andrew Valko
    National Instruments Hungary

  • Blank Event Filter for Receive Event Activities:  OK?

    I've defined an event group that is linked to multiple Raise events.
    My event subscription is linked to this event group, and launches a workflow process when one of the event group's events is raised.
    What's bothering me is that in Oracle Workflow Builder, for the Receive event activity, since I can accept one of any several events, I have to leave the Event Filter field blank. From the Oracle Workflow Guide, chapter 4, section "To Create an Event Activity":
    "Note: You can only specify an individual event as the event filter. The event filter cannot be an event group."
    OK, so that means I have to leave my Receive event's Event Filter field blank. I'm not inviting unwanted events this way, correct? Do I have to code to prevent this workflow process from executing a "rogue" Raise event?
    This might be a silly question.
    Thanks,
    Art.

    Mike,
    any chance a future DPM version can/will leverage SQL Management studio/SQL Agent for backup job scheduling ? I am sure many DPM admins who (may) know the significantly greater scheduling flexibility of SQL server agent would love to
    see this happen.    
    The proposed workaround would require to build at least 6 additional filters (given the current filter uses the allowed max 7 days) and during 2 weeks in the year the unaware/unprepared DPM admin - may perceive the mmc crash as the beginning of the
    end.
    Please tell me someone is willing to look at the source code to get this remedied. I know this cant be a SQL problem since SQL server agent jobs run fine time change or no time change.  
    Thanks for your ongoing help already.
     Sassan
    Sassan Karai

  • Copy function for multiple account assingment (cost distribution)

    Hello,
    We are using multiple account assignment to enter different asset no for each quantity in same line item. Other fields like G/L account remains same.. Is it possinble to copy the value from one asset to all the assets in same line item. The function of copy in clip and inset from clipboard works only for different items not for multiple account assignments...
    In R/3 there is function to copy and paste in case of multiple account assignment but could not find the same in SRM.
    Any solution????
    We are in SRM 4.0...
    Amit

    Hello,
    During PO replication from SRM to R/3, customizing from OME9 is not read and "Partial invoice indicator" is always defaulted to "1" when item has a multiple account assignment.
    This behaviour can be overwritten by implementing:
    - either BBP_PO_INBOUND_BADI for method BBP_MAP_BEFORE_BAPI,
    - or BBP_ECS_PO_OUT_BADI for method BBP_B46B_PO_OUTBOUND.
    So, no need to take care of OME9 customizing.
    Regards.
    Laurent.

Maybe you are looking for