Fire event from within another event ?

It seems that an event fired from within another event does not
actually execute its code until the firing event completes. The fired
event's Time value in its Event Data Node indicates the time that it
was told to execute, but using GetTickCount calls shows that its code
does not execute until the firing event is finished. This happens
whether Value Signaling is used to generate a Value Change event or if
CreateUserEvent and GenerateUserEvent is used. Is this because events
are placed in a queue ? This behavior is different from Delphi for
example where the fired event executes right away when called from the
firing event (before the firing event completes).
I have an event that executes upon a button value change. I would
like that same event's code to execute when another button is pressed,
but also have other code in the second button's event execute after
that first button's event's code completes. Is there another way to
accomplish this ?
Steve

> It seems that an event fired from within another event does not
> actually execute its code until the firing event completes. The fired
> event's Time value in its Event Data Node indicates the time that it
> was told to execute, but using GetTickCount calls shows that its code
> does not execute until the firing event is finished. This happens
> whether Value Signaling is used to generate a Value Change event or if
> CreateUserEvent and GenerateUserEvent is used. Is this because events
> are placed in a queue ? This behavior is different from Delphi for
> example where the fired event executes right away when called from the
> firing event (before the firing event completes).
I'm not that familiar with Delphi, but LV events are asynchronous.
Window
s OS has two ways of firing events, Send and Post. The LV events
are always posted. The primary reason is that the LV events are handled
by a node, not by a callback. The node you are calling is in the middle
of a diagram, and reentering it not valid.
> I have an event that executes upon a button value change. I would
> like that same event's code to execute when another button is pressed,
> but also have other code in the second button's event execute after
> that first button's event's code completes. Is there another way to
> accomplish this ?
The best way to reuse code is to use subVIs. Firing events, or rather
sending events is pretty close in other events to making a function call
dispatched to anyone interested in the event. The event just hides who
you are calling and makes you put your parameters in a funny format
stuffed inside the event. IMO it also makes the code very hard to read
since you don't know what calls what.
Instead, just put the code into a sub
VI and call it whenever you need
to, from the event structure in one or more locations, and from other
loops and diagrams.
Greg McKaskle

Similar Messages

  • PL/SQL: Executing a procedure from within another procedure

    Hello, I'm a newbie and I need help on how to execute procedures from within another procedure. The procedure that I call from within the procedure have return values that I want to check.
    I tried: EXECUTE(user_get_forum_info(p_forumid, var_forum_exists, var_forum_access, var_forumname));
    but I get the error message:
    PLS-00103: Encountered the symbol "USER_GET_FORUM_INFO" when expecting one of the following::= . ( @ % ; immediate
    The symbol ":=" was substituted for "USER_GET_FORUM_INFO" to continue.
    And when I tried: EXECUTE(user_get_forum_info(p_forumid, var_forum_exists, var_forum_access, var_forumname));
    I get the error message:
    PLS-00222: no function with name 'USER_GET_FORUM_INFO' exists in this scope
    PL/SQL: Statement ignored
    The procedure USER_GET_FORUM_INFO exists. (don't understand why it says "no FUNCTION with name", it's a procedure I'm executing)
    I'm stuck so thanks for any help...
    Below is all the code. I'm using Oracle 9i on RedHat Linux 7.3.
    ================================================================================
    CREATE OR REPLACE PROCEDURE user_forum_requestsaccess (
    p_forumid IN NUMBER,
    p_requestmessage IN VARCHAR2
    AS
    var_forumid NUMBER;
    var_forum_exists NUMBER;
    var_forum_access NUMBER;
    request_exists NUMBER;
    var_forumname VARCHAR2(30);
    FORUM_DOESNT_EXIST EXCEPTION;
    FORUM_USER_HAS_ACCESS EXCEPTION;
    FORUM_REQUEST_EXIST EXCEPTION;
    BEGIN
    SELECT SIGN(NVL((SELECT request_id FROM forum.vw_all_forum_requests WHERE forum_id = p_forumid AND db_user = user),0)) INTO request_exists FROM DUAL;
    EXECUTE(user_get_forum_info(p_forumid, var_forum_exists, var_forum_access, var_forumname));
    IF var_forum_exists = 0 THEN
    RAISE FORUM_DOESNT_EXIST;
    ELSIF var_forum_access = 1 THEN
    RAISE FORUM_USER_HAS_ACCESS;
    ELSIF request_exists = 1 THEN
    RAISE FORUM_REQUEST_EXIST;
    ELSE
    INSERT INTO tbl_forum_requests VALUES (SEQ_TBL_FORUM_REQ_REQ_ID.NEXTVAL, SYSDATE, p_requestmessage, p_forumid, user);
    INSERT INTO tbl_forum_eventlog VALUES (SEQ_TBL_FORUM_EVNTLOG_EVNT_ID.NEXTVAL,SYSDATE,1,'User ' || user || ' requested access to forum ' || var_forumname || '.', p_forumid,user);
    COMMIT;
    END IF;
    EXCEPTION
    WHEN
    FORUM_DOESNT_EXIST
    THEN RAISE_APPLICATION_ERROR(-20003,'Forum doesnt exist.');
    WHEN
    FORUM_USER_HAS_ACCESS
    THEN RAISE_APPLICATION_ERROR(-20004,'User already have access to this forum.');
    WHEN
    FORUM_REQUEST_EXIST
    THEN RAISE_APPLICATION_ERROR(-20005,'A request to this forum already exist.');
    END;
    GRANT EXECUTE ON user_forum_requestsaccess TO forum_user;
    ================================================================================
    Regards Goran

    you don't have to use execute when you want to execute a procedure (only on sql*plus, you would use it)
    just give the name of the funtion
    create or replace procedure test
    as
    begin
        dbms_output.put_line('this is the procedure test');
    end test;
    create or replace procedure call_test
    as
    begin
        dbms_output.put_line('this is the procedure call_test going to execute the procedure test');
        test;
    end call_test;
    begin
        dbms_output.put_line('this is an anonymous block calling the procedure call_test');
        call_test;
    end;
    /

  • Need help to call a simple function from within another function?

    I created a movieclip which has a function in its one and only frame.
    function testx() {
    x = x+2};
    This movieclip is in the main timeline (in its own layer).
    In another layer on the timeline I have created a single keyframe with a button instance called myBtn
    myBtn.onRelease = function() {
    var x
    x =2
    testx(2);
    trace (x);
    What I want to do is call the function in the movieclip frame from the button press function. However, I can't seem to reference it properly.
    Can anyone help me to basically call a simple function from within another function?

    Yes am using CS4.  Have saved it as CS3 now.  Ok the file is somewhat complicated and what I am testing is not what I ultimately want to do but if I can pass that variable I can figure it out.  In terms of describing the file I think the only parts of importance are what I put in my previous post (please let me know if there is something I should be telling you that I have missed).  I am 99.9% sure that I am using the correct instance name.
    Scene1 Layer3 Frame1 has the function call for the button.
    myBtn.onRelease = function() {
    var x
    x = 2
    testx(2);
    trace (x);
    Slideshow layer //Actions Frame1 has the function
    function testx(x) {
    x = x+2};
    thank you so much for helping me.

  • How can I call a LabVIEW executable from within another LabVIEW executable?

    I have a customer requirement for two LabVIEW executables. Based on their current setup, they need to run executable "A" or "B", both of which are under independent revision control. I have created a third "selection" executable that allows the operator to choose between one of the two, but I am receiving errors when I attempt to call a LabVIEW executable from within a LabVIEW executable using either the "System exec" VI or the "Run Application" VI. If I call a non-LabVIEW executable (such as Windows Explorer) everything works fine.

    > I have a customer requirement for two LabVIEW executables. Based on
    > their current setup, they need to run executable "A" or "B", both of
    > which are under independent revision control. I have created a third
    > "selection" executable that allows the operator to choose between one
    > of the two, but I am receiving errors when I attempt to call a LabVIEW
    > executable from within a LabVIEW executable using either the "System
    > exec" VI or the "Run Application" VI. If I call a non-LabVIEW
    > executable (such as Windows Explorer) everything works fine.
    As with the other poster, I suspect a path problem. You might try the
    path out in a shell window, and if it works, copy the complete absolute
    path to LV to see if that works. LV is basically passing the comma
    nd to
    the OS and doesn't even know what is in it, so you should be able to get
    it to work.
    The other poster commented on subpanels, which is a good suggestion, but
    without going to LV7, an EXE can have open more than one VI. You can
    use the VI Server and the Run method to fire up another top-level VI.
    The decision is whether you want both to be in unique processes.
    Greg McKaskle

  • Calling a java application from within another class

    I have written a working java application that accepts command line parameters through public static void main(String[] args) {} method.
    I'm using webMethods and I need to call myapplication from within a java class created in webMethods.
    I know I have to extend my application class within the webMethods class but I do not understand how to pass the parameters.
    What would the syntax look like?
    Thanks in advance!

    why do you want to call the second class by its main method ??
    Why not have another static method with a meaningfull name and well defined parameters ?
    main is used by the jvm as an entry point in your app. it is not really meant for two java applications to communicate with each other but main and the code is not really readable.
    Have a look at his sample
    double myBalance = Account.getBalance(myAccountId);
    here Account is a class with a static method getBalance which return the balance of the account id you passed.
    and now see this one, here Account has a main method which is implemented to call getBalance.
    String[] args = new String[1];
    args[0] = myAccountId;
    Account.main(args);
    the problem with the code above is
    main doesn't return anything so calling it does do much good. two the code is highly unreadable because no one know what does the main do... unlike the sample before this one where the function name getBalance clearly told what is the function doing without any additional comments.
    hope this helps.... let me know if you need any additional help.
    regards,
    Abhishek.

  • Lag when calling BLS Transaction from within another

    Using MII 12.0.
    In MII class, they told us a "best practice" was to check the "Reload Transaction after Execution" box in the configuration of a Transaction call within a BLS.  The reasoning behind it was that should this not be checked, a previous result of that called BLS transaction would still be cached in memory and used instead of the newly assigned values from within your calling BLS.
    Checking the "Reload transaction after Execution" box forces MII to reload that transaction when it is called.
    In time analysis, what has been noticed is that there's a significant - up to 9 seconds - lag time when one BLS calls another BLS.  On a time-sensitive operation, that is an eternity.  That amount of overhead defeats any hope of using common code libraries.
    Questions -
    1.  Is this a true "best practice", or is it one that adds unnecessary overhead to a BLS? 
    2.  If the calling BLS executes 1 time - but is subject to be executed multiple times over a certain interval - is checking the Reload box of the BLS it is calling unnecessary? 
    3.  Even if you pass new data each time you call that BLS, is it still going to use/return whatever data it has cached until the cache expires?
    4.  Is there another way to ensure that the called BLS uses the data you pass it (and returns the corresponding result set) without incurring the amount of overhead that we have noted? 
    Thanks

    The version we're on is 12.0.6 Build 13, and moving to  12.1 (something I am not directly involved in).  In this version, I'm not seeing the menu options you describe, so it's apparently in 12.1 or later. 
    The issue we are having if the "Reload transaction after execution" box is not selected is indeed caching of values. 
    For example -
    BLS1 runs every 5 minutes
    BLS2 is called from BLS1, and in this case, retrieves error log info from a table - a common module used by several BLS's.
    BLS3 is also called from BLS1, and in this case, writes to an error log using information retrieved from BLS2 from within the execution of BLS1.  BLS2 & BLS3's calls are in 2 separate sequences, one after the other. 
    If BLS2 & BLS3 DO NOT have the "Reload Transaction after execution" checked, each will run with whatever the cached data in memory is for them, even though inside BLS1 I am assigning values to the input of BLS1 to send to BLS2, and passing the returned data from BLS2 into BLS3.  Unless it's checked, BLS2 & BLS3 would continue to be called, however, it would be with whatever data has been cached for them. 
    If that "Reload" switch is checked, it will reload each transaction & call it with whatever data is being passed.
    This was mentioned in the MII class I was in also.  This is a generalization, but the way they described it was being similar to how you might save a web page to your local PC, and that unless that page is refreshed & changed, that from that point on, every time you brought up your saved web page, it would always display the same values in it.  They didn't go into great deal to explain the mechanics of it, but MII would only load it the first time it executed, and that unless you forced it (by checking the Reload switch), it would always execute using the same cached values no matter what you were passing.

  • Unable to display the Content of a data file from within another data file in Oracle webcenter portal.

    We have a Content Presenter taskflow. This task flow is added to a jspx page. The taskflow fetches the content from the contributor data file. The contributor data file is having a WYSIWYG editor. The content of the WYSIWYG editor is being displayed correctly through the task flow.
    We have some links in the WYSIWYG editor. These links again point to some data files. When we click on these links from within the portal, then we are getting a blank page(the url of this blank page is: http://localhost:7101/eWSIBPortal/faces/oracle/webcenter/sitestructure/render.jspx?datasource=UCM%23dDocName%3AWSIB_ARTICLE) and not displaying the content of the data file that we are pointing to from the WYSIWYG editor.
    We want to display the content of these data files(which we have pointed from WYSIWYG editor) in-line within the portal.
    Please help us to resolve this issue and let us know if any information is required from our end.

    Thanks for reply. However, can I use XSQL to dump the formated text to a file? or just can display to client through web browsers?

  • Installing Oracle ODBC driver from within another installation

    My application requires ODBC driver. Is it possible/recommended
    to install the driver from within my installation program (other
    than invokig the ODBC's setup program)? If so, what are the
    files that need to be installed, the registry entries that need
    to be updated and other activities perfromed?
    Thanks
    Michael

    In order for the ODBC driver to function properly, the Oracle
    client must have been installed on the user's machine. If the
    Oracle client has been successfully installed, users will have
    the Oracle ODBC driver.
    Since the Oracle client install is very large as installers
    go, you probably don't want to package this with your app. In
    addition, the Oracle client installation is pretty significant
    in terms of what it does, so you definitely don't want to try to
    replicate that work in your installer.
    Justin

  • How to call a procedure from within another procedure?

    What's the syntax to call a procedure from within a procedure.
    I have a procedure z(user_id IN number, ....)
    then
    procedure a (user_id IN number, ....)
    procedure b (user_id IN number, ....)
    procedure c (user_id IN number, ....)
    I want to call procedure a, b, c from inside procedure z.
    How would I do that?

    Same way :
    SCOTT@db102 SQL> create or replace procedure a (p1 in varchar2) is
      2  begin
      3     dbms_output.put_line (p1);
      4* end;
    SCOTT@db102 SQL> /
    Procedure created.
    SCOTT@db102 SQL> create or replace procedure z (par1 in number) is
      2  begin
      3     if par1 != 0 then
      4             a ('This is proc a');
      5     end if;
      6* end;
    SCOTT@db102 SQL> /
    Procedure created.
    SCOTT@db102 SQL> set serveroutput on
    SCOTT@db102 SQL> exec z (1);
    This is proc a
    PL/SQL procedure successfully completed.
    SCOTT@db102 SQL>                                                    

  • How to fire TreeEvent from within Automation Framework(ActionScript)?

    Hi,
    I am using the Adobe Automation Framework to write a testing environment.
    Here, I am getting the automation object (IAutomationObject) and want to dispatch a TreeEvent using it (possibly with IAutomationObject.replayAutomatableEvent(). I am not getting the correct way to accomplish this.
    Can anybody help me?

    I'm not very familiar with the Automation framework, but I think you're getting your path's crossed.  You're TreeEvent should really only be tied to the tree you're working with and should be the handler for all items in the Tree.
    If you're simply trying to automate the tree opening for you...I would think that the Automation framework had some funtions to take an object and an event that should it do probably based on a timer value, but I'm not too familiar with Automation in Flex.  From here I can't really help you as I have never messed with the Automation Framework...
    I came across this in a quick google, so hopefully this helps:
    http://livedocs.adobe.com/flex/3/html/help.html?content=functest_components2_10.html

  • Sensitive Data Breach; FF displays content from a previously loaded plugin when displaying new content from within another pugin

    Sensitive Data Breach.
    When loading content from a plugin, such a pdf or flash, any content from previously viewed content from a plugin is flash before the new content is displayed.
    In our app we show sensitive information and this represents a data breach.
    This issue present across or between the same or different plugins. Silverlight - > PDF, PDF -> PDF, etc.

    In reviewing the steps to re-create the problem, I'm not sure I understand what's happening.
    <br>1. Load some flash content
    2. Leave the Tab open or Close the tab
    3. Load a pdf within the browser in another tab.
    <br>Note: Ensure Options -> Tabs -> "When I open a link in a new tab, switch to it immediately" is selected.
    <br>Note: Ensure you clear your cache so plugin content is downloaded.
    <br>The longer it takes to download the pdf the longer the sensitive data will be displayed. When the plugin fails content may be displayed indefinitely.
    (I view PDFs outside the browser, so I haven't attempted to re-create the above scenario.)
    Are you saying that Flash content appears where the PDF is supposed to load, or a previous PDF appears?
    I assume this previously viewed data doesn't survive a shut-down and restart of Firefox. Is that correct?

  • Why do I have to allow a new window every time to open from within another window, Ie, from an email?

    When I try to go to a web site from another web site or from an email from a link, I am required to click on the "ALLOW" button every time. It seems like if I have already clicked on it that I have allowed it. It is very frustrating. If it can't be fixed, I will either go back to an older version of firefox or choose another browser

    hello, you can disable these warnings, when you go to ''firefox > preferences > advanced > general > warn me when websites try to redirect or reload the page''.

  • Call a bounded task flow from within another bounded task flow

    Hello
    I am using Jdev 11g Release 1 and need help with the following issue...
    Here's an outline of my application..:
    1. There is a main .jspx page with icons to choose different paths.
    2. Each icon denotes a bounded task flow with TRAIN.
    3. Upon clicking on any icon, you get into a series of TRAIN STOPS.
    4. On one of the TRAIN STOP there is a button to ADD NEW which shows a popup that is tied to another bounded task flow with TRAIN STOPS.
    5. This taskflow 2 calls a method as its default activity.
    The issue is when I click on ADD NEW, the popup displays empty. I even put break points on the method and it doesn't even go to the method. The input parameters on the method have been checked so I know that is not an issue. Any clues as to why it won't open the popup..?
    Any help will be greatly appreciated.

    vinod_t_krishnan wrote:
    i guess there is something corrupted in the definition file that is created for the method action in your taskflow.. can u cross check that..What do you mean? How do I cross check this...? Please help
    and also check if the DataBindings.cpx has the correct reference of the method definiiton file..Did this..all references point correctly
    or otherwise can u drag and drop the method again on to the taskflow and try.. if this time it had created all entries correctly.?Tried it ...doesn't work =(

  • Open external swf from within another external swf?

    Hello, I'm relatively new to AS3 and have a problem that I'd like to see if anyone can provide a response.
    I have an external swf that is opened through a web page, but the swf does not diplay in a web page, we use javascript to remove the browser, control the window size to 1024X710, no scrollbars, etc. Within that external swf I want to use a button that the user can click to open a separate external swf that is located in the same folder; however, I want it to display as the original swf (without it being displayed in an Internet browser, no scroll bars, a certain size 1024X710), etc. I've been able to find script where you can open an external web page with a certain size window; however, I find nothing regarding how to open an external swf with conditions.
    Any help you can provide would be greatly appreciated!
    We use this script on a web page to open the external swf:
    <script language="Javascript">
      function openSWF1(cbtFile)
        window.open(cbtFile,"NewWindow","toolbar=no,directories=no,menubar=no,scrollbars=yes,widt h=1024,height=710");
    </script>
    We use the following html code to call the JS and open the applicable swf file:
    <a href="javascript:openSWF1('CBT/AppTrng/EIP-New-Siebel.swf')">Enterprise Image Processing (EIP)</a>

    Hi,
    I found this function and it works correctly; however, it seems to automatically move the movie to the next frame instead of staying on the same frame in which the function is displayed.
    The first function is to move to the next frame when the user presses the Tab key on their keyboard.
    stage.addEventListener(KeyboardEvent.KEY_DOWN, cool);
    function cool(e:KeyboardEvent):void {
          if(e.keyCode == Keyboard.TAB){
               gotoAndPlay("7");
    This function is to open an external swf in a sizeable window with no Internet window - it works great! However, it automatically navigates the parent movie clip to frame #7. What am I doing wrong?
    query_btn.addEventListener(MouseEvent.CLICK, MYBUTTON_link8);
    function MYBUTTON_link8(e:MouseEvent):void
        //navigateToURL(new URLRequest("icb.swf"), "_blank", "scrollbars=no,titlebar=no,toolbar=no,menubar=no,resizable=yes,width=1024,height=710");
    var gameURL:String = "http://opstraining.bcbsfl.com/NonPMI/RBMS/icb.swf";
    var jscommand:String = "window.open('"+gameURL+"','win','width=1024,height=710,toolbar=no,scrollbars=no,location =no,status=no,menubar=no');";
    var url:URLRequest = new URLRequest("javascript:" + jscommand + " void(0);");
    navigateToURL(url, "_self");

  • Accessing a method from within another method

    I am having trouble accessing a method from inside a method in the same class.
    here is my code:
    public String getAns(int ans){
    answer = ans;
    ranswer = number1 * number2;
    if(answer != ranswer){
    return "No. Please try again";
    }else{
    return "Very good!";
    genQues();
    when i run this i get an Unreachable code error pertaining to genQues();
    is this allowed in Java and is there a more practical way to go about this?
    Thank you in advance

    next time use the correct code tags to post your code.
    Think of your problem like this though.
    You write
    if( something )
    then return some value;
    else
    then return some other value.
    The returns end the method here, returning the value.
    So, if the method ended at one of these 2 statements, how do you think it'll reach genQues(); ?
    Hope this helps.

Maybe you are looking for