Calling a function inside a function

How does one do that? I am trying to call function 1 inside function 2. What is the corrct syntax?

If this post answers your question or helps, please mark it as such.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
  <mx:Script>
    <![CDATA[
      private function callFuncs():void{
        one();
      private function one():void{
        txt.text += "In function one()\n";
        two();
      private function two():void{
        txt.text += "In function two()\n";
        three();
      private function three():void{
        txt.text += "In function three()\n";
    ]]>
  </mx:Script>
  <mx:Button label="Call Functions" click="callFuncs();"/>
  <mx:TextArea width="500" height="500" id="txt"/>
</mx:Application>

Similar Messages

  • Calling a function inside a symbol?

    Hi there,
    I'm one of those flash-devs that are trying to get Edge Animate to do what I usually do in Flash, so I might be doing this the wrong way, but I've got a symbol with a function "inside" on my stage, and I wanna call that function from the stage.
    I've been trying to use sym.getComposition().getStage().getSymbol("symbolName").functionName(); but it doesn't work.
    I don't have any problems manipulating the symbol itself by calling .play() or .hide() so I know the path works....can anyone show me the right syntax to call a function inside a symbol?
    Thx in advance

    Hi Abnesher,
    An important principle to grasp is that symbols (and the stage is one of them) lies in parallel, despite the fact of instances of different symbols being nested one in another (and all in fine nested in the stage).
    The consequence is that from inside your nested symbol you have no direct visibility of the function defined inside the stage symbol !
    Inside the Stage symbol, in the document.compositionReady event handler :
    sym.yourGlobalFunction = function( firstParameter)
      // your stuff
    Inside another symbol, in one of its events handlers :
    sym.getComposition().getStage().yourGlobalFunction( 5);
    Gil

  • Error 1097 after calling dll function which allocates memory inside

    Hello!
    When a call one my functions in my dll from LabView, i get an error 1097. My function takes a few arguments and then allocates some memory for measurement.
    It's not returning any pointers to that memory area, it is just allocates that memory for itself. I don't know what could be the problem, probably i am missing something.
    Could you help please?
    Best regards,
    Tamas
    Solved!
    Go to Solution.

    Are you sure that the allocate function is the problem?
    Error 1097 simply means something inside the external code wrote into memory locations that it was not meant to write. That is usually because of output buffer parameters that are not allocated (large enough) in LabVIEW when passed to the external code fucntion, so the function assuming it received a buffer of a certain size happily writes into that buffer but overwriting other information it should not have.
    But that is by far not the only possibility to cause this error. A simple bug in the external code can cause the same problem when a pointer goes astray or such. The fact that you used that library elsewhere already without seeing any problem is unfortunately no guarantee that the function is not buggy. The LabVIEW exeception handling around the Call Library Node has gotten rather picky and can detect violations that do not have to cause visible problems at all. But the violations it detects are real violations so just silencing them is not a good idea, as they could cause all kinds of problems including overwriting vital data structures in your program that either cause a crash later on or simply wrong results in other parts of your program. Especially the last one is a total bummer to debug.
    Without seeing much more of your code it is basically impossible to point out where the problem could lie. The particular Allocate function doesn't look like there is much that could be done wrong, but I would assume that you call several other functions too somewhere, which could cause the problem. If you can absolutely positively say that you never ever call any library function with a to short (or unallocated) buffer parameter, then you will have to take it up with the manufacturer of your lib, as it would seem very likely that there is some problem in there.
    Also you pass a handle to the library function but your Allocate function does not have this as a parameter! Where does this handle come from? Are you sure you have allocated and prepared it properly before calling this function? A handle is quite often a pointer, although usually a so called opaque pointer meaning the user of the library does not and should not know anything about the structure this pointer points to. It is only known internal to the library.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Call a function inside a package from a stored procedure

    Hello:
    I am kind of new to the stored procedure. Does anyone know how to call a function inside a package from another stored procedure?
    I have a existing function (func_b) inside a package (pack_a) and it returns a cursor. I want to call this function from a stored procedure (proc_c) so that I use the data inside the cursor.
    can I do the following in proc_c:
    my_cursor1 SYS_REFCURSOR;
    begin
    my_cursor1 := exec pack_a.func_b
    end
    It will be very helpful if anyone can point me to any reading or example. Thank you very much for your information.

    guys:
    Thank you for your information so far. I need some more help here. I was able to run the function in my stored procedure. However, I was not able to print the result on the screen to view the cursor result, although I am using dbms_output.put_line statement inside my stored procedure.
    I use the following statement to execute my stored procedure on sql*plus. I can tell the stored procedure is executed successfully, but I did see anything printed:
    DECLARE TEMP VARCHAR2(100);
    BEGIN PROC_LAWS_CAD_NAME_SEARCH('LPD', 'TEST DEVICE ID', 'TEST LAST NAME', 'TEST FIRST NAME', 'F', '11112009', TEMP); END;
    I tried to use 'set serveroutput on' and got the following error:
    ERROR:
    ORA-06502: PL/SQL: numeric or value error: host bind array too small
    ORA-06512: at line 1
    I am kind of confused now. thank you for your help.
    Jack
    Here is my procedure:
    create or replace
    PROCEDURE PROC_SEARCH
    ( AGENCY_ID IN VARCHAR2,
    DEVICE_ID IN VARCHAR2,
    L_NAME IN VARCHAR2,
    F_NAME IN VARCHAR2,
    SEX IN VARCHAR2,
    DOB IN VARCHAR2,
    CAD_NAME_SCH_RESULT_STR OUT VARCHAR2)
    AS
    v_agy_id varchar2(10);
    v_device_id varchar2(20);
    v_l_name varchar2(25);
    v_f_name varchar2(15);
    v_sex varchar2(1);
    v_dob date;
    -- this cursor is going to be used to store a list of warrant matching
    -- name search criteria
    cad_srch_cursor sys_refcursor;
    objSrch SEARCH_RESULT_TEMP%ROWTYPE;
    BEGIN
    cad_srch_cursor := SEARCH_PKG.SEARCH('TESTING', 'TESTER', null, null,null, null, getPhonetic('TESTING'));
    LOOP
    FETCH cad_srch_cursor INTO objSrch;
    EXIT WHEN cad_srch_cursor%NOTFOUND;
    --insert into SEARCH_RESULT_TEMP (name_last) values (objSrch.name_last);
    CAD_NAME_SCH_RESULT_STR := objSrch.name_last;
    dbms_output.put_line('First:'||objSrch.name_first||':Last:'||objSrch.name_last||':Middle:'||objSrch.name_middle);
    end LOOP;
    END PROC_LAWS_SEARCH;
    -----------------------------------------

  • Call library function inside a conditiona​l disable bug

    i'm trying to call a function in a dll using the call library function inside a conditional disable structure.
    one of the parameters is a pointer to a C structure.
    here is the prototype:
    short in myfunction(short in DevNum, void *pMetrics);
    outside of the conditional disable, LabVIEW allows me to wire the pMetrics parameter to a cluster.
    if i put the function inside the conditional disable, LabVIEW doesn't allow me to wire it.
    as a workaround, i put the cluster inside the conditional disable as well.
    any ideas?

    Simply create a constant of the cluster and and put it outside the disable structure. Wire this constant to all inputs (left side terminal) of the Call Library Node. A Call Library Node (CLN) set to Adapt to Type does need a valid datatype to adapt too. This works from the outside side (right side terminal) of the CLN only if the according indicator is inside the same data structure. In older LabVIEW versions you actually had to always define the left side by wiring a constant or a dummy control to it.
    This has to do with the algorithme that evaluates datatypes along wires. Making that algorithme go backwards (against the natural dataflow) inside one subdiagram without causing circular references or similar is already a challange. Doing that across diagram boundaries (case, disable, loop, etc. structures) is basically impossible without causing the entire edit operation to get very slow.
    Message Edited by rolfk on 10-20-2009 08:28 AM
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Calling a Function inside a procedure

    Can you call a function inside a procedure?...if so....how?

    Not all built-in functions can be used directly in an assignment.
    SQL> CREATE PROCEDURE p (p_val IN VARCHAR2) AS
      2  l_v VARCHAR2(10);
      3  BEGIN
      4     l_v := DECODE(p_val,'YES','TRUE','FALSE');
      5  END;
      6  /
    Warning: Procedure created with compilation errors.
    SQL> show error
    Errors for PROCEDURE P:
    LINE/COL ERROR
    4/4      PL/SQL: Statement ignored
    4/11     PLS-00204: function or pseudo-column 'DECODE' may be used inside
             a SQL statement onlyTTFN
    John

  • Calling a function in the HTML window the course sits inside - Captivate 8

    Hi,
    I've scoured the forums for an answer to this but as yet have come up blank.
    Our LMS launches a course in a popup window and inside of this the .htm Captivate output file sits.
    Currently this pop up window has a button in it which executes a function.  The problem is this button is rather unsightly sitting above the course in the HTML window and I'd like to be able to call this function from inside the Captivate course itself.
    The function is called closeSCOContent() and it closes the course window but crucially forwards the user to a feedback page.
    So essentially is it possible to call this function using the Javascript function in Captivate 8?
    I hope I've explained that sufficiently
    Many thanks!

    Hi,
    This gave me the nudge in the right direction I needed, after a bit of basic frameset research I've got the desired functionality.
    Huge thanks!

  • Calling a Function Pool inside a Class

    Hi,
        I want to call a Function Pool inside a Class Method. I am getting an Error that 'Report or Program Statement already exists' when I call the function pool in the method. can anybody help me on how to call a Function Pool inside a class method.

    Hello Krish
    Based on your error description I assume that you have tried to "insert" the function pool program (e.g. function group ZFUNC -> SAPLZFUNC) into your class.
    You cannot do that. The explanation for the error message is a following:
    - The class contains already a program statement (CLASS-POOL). If there is somewhere in the class an additional program statement (e.g. FUNCTION-POOL) you will get the error.
    In addition, you cannot "call" a function pool. Instead you can always call the function modules of your function group.
    Regards
      Uwe

  • Call a function module inside of another function module

    Has anyone ever called a function module inside of a remote enabled function module?  Maybe this needs to be accomplished inside of an include.  Just wondering.
    Thanks!

    Hi
    No u can't do it because the RE_LAST_DAY_OF_MONTH  is not remote function module.
    If you need to call it u should insert it in a RFC, so u should create in R/3 a new RFC calling both fms: RE_LAST_DAY_OF_MONTH and the remote one.
    And so call this new rfc instead of the other one.
    Max

  • How to call a function defined inside a module loader

    I wanna know...the method of calling a function defined
    inside a module loader component?
    Th
    <mx:ViewStack id="myViewStack" >
    <mx:Canvas id="Mgmt1">
    <mx:Label text="Gopher"/>
    </mx:Canvas>
    <mx:Canvas id="Mgmt2" >
    <mx:Label id="gopherlbl" top="-2" left="0"
    height="40"/>
    <CustomComp:MgmtGrid id="ManageCom"/>
    </mx:Canvas>
    <mx:Canvas id="Admin">
    <mx:ModuleLoader id="adminModule" url="{adminModUrl}"
    width="100%" height="100%" />
    </mx:Canvas>
    where adminModUrl="admin.swf";
    Thru the MangeCom id reference,I am able to call the fucntion
    defined inisde the CustomComponent File MgmtGrid...But I am unable
    to call the funciton defined inside adminModule
    ModuleLoader...(using id reference).Anyone pls suggest a solution
    for this..

    Ensure the module is loaded before calling the method in
    particular if you are calling it at the initialization of your
    app.

  • Calling a function that's inside another function

    function test1():void
         function test2():void {..}
    How do I call test2 function (outside test1 function)? Is it possible?

    Hi,
    yes it is possible.
    Here is the code helps u
    function foo():Function
    var x:int = 40;
    function rectArea(y:int):int // function closure defined
    return x * y
    return rectArea;
    var myProduct:Function = foo();
    var s = myProduct(4);
    trace(s);
    Saransoft

  • Calling a function inside another class

    I have the following two classes and can't seem to figure to figure out how to call a function in the top one from the bottom one. The top one get instantiated on the root timeline. The bottom one gets instantiated from the top one. How do I call functions between the classes. Also, what if I had another call instantiated in top one and wanted to call a function in the bottom class from the second class?
    Thanks a lot for any help!!!
    package
         import flash.display.MovieClip;
         public class ThumbGridMain extends MovieClip
              private var grid:CreateGrid;
              public function ThumbGridMain():void
                   grid = new CreateGrid();
              public function testFunc():void
                   trace("testFunc was called");
    package
         import flash.display.MovieClip;
         public class CreateGrid extends MovieClip
              public function CreateGrid():void
                   parent.testFunc();

    kglad,
    Although I agree that utilizing events the way you attempted in your suggestion is better for at least a reason of eliminating dependency on parent, still you code doesn't not accomplish what Brian needs.
    Merely adding event listener to grid instance does nothing - there is no mechanism in the code that invokes callTGMFunction - thus event will not be dispatched. So, either callTGMFunction should be called on the instance (why use events - not direct call - in this case?), or grid instance needs to dispatch this event based on some internal logic ofCreateGrid AFTER it is instantiated - perhaps when it is either added to stage or added to display list via Event.ADDED. Without such a mechanism, how is it a superior correct way OOP?
    Also, in your code in ThumbGridMain class testFunc is missing parameter that it expects - Event.
    Am I missing something?
    I guess the code may be (it still looks more cumbersome and less elegant than direct function call):
    package
         import flash.display.MovieClip;
         import flash.events.Event;
         public class ThumbGridMain extends MovieClip
             private var grid:CreateGrid;
             public function ThumbGridMain():void
                 grid = new CreateGrid();
                 grid.addEventListener("callTGMFunction", testFunc);
                 addChild(grid);
            // to call a CreateGrid function named cgFunction()
             public function callCG(){
                 grid.cgFunction();
             public function testFunc(e:Event):void
                 trace("testFunc was called");
    package
         import flash.display.MovieClip;
         import flash.events.Event;
         import flash.events.Event;
         public class CreateGrid extends MovieClip
             public function CreateGrid():void
                 if (stage) init();
                 else addEventListener(Event.ADDED, callTGMFunction);
             // to call a TGM function
             public function callTGMFunction(e:Event = null):void
               // I forgot this one
                removeEventListener(Event.ADDED, callTGMFunction);
                this.dispatchEvent(new Event("callTGMFunction"));
            public function cgFunction(){
                 trace("cg function called");
    I think this is a case of personal preference.
    With that said, it is definitely better if instance doesn't rely on the object it is instnatiated by - so, in this case, either parent should listen to event or call a function directly.

  • Can't call a function inside another function

    Hello,
    i have the following function :
    FUNCTION test_day_week (P_DATE DATE)
    RETURN VARCHAR2 IS
    BEGIN
    RETURN TO_CHAR(P_DATE ,'DAY');
    END;
    --it returns the day name of a given date
    FUNCTION TEST_DAY_NUMBER (P_DAY_NAME VARCHAR2)
    RETURN NUMBER IS
         V_RESULT NUMBER;
         V_RETURN_DAY VARCHAR2(30);
         P_DATE DATE;
    BEGIN
    V_RETURN_DAY := test_day_week (P_DATE );
    MESSAGE('V_RETURN_DAY'|| V_RETURN_DAY);
    MESSAGE('V_RETURN_DAY'|| V_RETURN_DAY);
    IF V_RETURN_DAY = 'MONDAY' THEN V_RESULT :=1;
         END IF ;
    IF V_RETURN_DAY = 'TUSEDAY' THEN V_RESULT :=2;
         END IF ;
    IF V_RETURN_DAY = 'WENDSDAY' THEN V_RESULT :=3;
         END IF ;
    IF V_RETURN_DAY = 'THURSDAY' THEN V_RESULT :=4;
         END IF ;
    IF V_RETURN_DAY = 'FRIDAY' THEN V_RESULT :=5;
         END IF ;                
    IF V_RETURN_DAY = 'SATURDAY' THEN V_RESULT :=6;
    END IF ;
    IF V_RETURN_DAY = 'SUNDAY' THEN V_RESULT :=7;
         END IF ;
    RETURN V_RESULT;
    END;
    --The above function returnds the day name in numbers
    The proble is that when i call test_day_week function it returns no value even it is tested separatly and works fine don't know where is my problem :
    1-number of argrments in function[b] TEST_DAY_NUMBER
    ?? and so ..!
    Regards,
    Abdetu..

    You could also cut the whole thing down to a simple function... (assuming you have a need to customise your start of week rather than use built in date functionality)
    SQL> ed
    Wrote file afiedt.buf
      1  CREATE OR REPLACE FUNCTION test_day_week (P_DATE DATE) RETURN NUMBER IS
      2  BEGIN
      3    RETURN (INSTR('MONTUEWEDTHUFRISATSUN',TO_CHAR(P_DATE,'DY'))+2)/3;
      4* END;
    SQL> /
    Function created.
    SQL> select test_day_week(sysdate) from dual;
    TEST_DAY_WEEK(SYSDATE)
                         1
    SQL> select test_day_week(sysdate+1) from dual;
    TEST_DAY_WEEK(SYSDATE+1)
                           2
    SQL> select test_day_week(sysdate+2) from dual;
    TEST_DAY_WEEK(SYSDATE+2)
                           3
    SQL> select test_day_week(sysdate+3) from dual;
    TEST_DAY_WEEK(SYSDATE+3)
                           4
    SQL> select test_day_week(sysdate+4) from dual;
    TEST_DAY_WEEK(SYSDATE+4)
                           5
    SQL> select test_day_week(sysdate+5) from dual;
    TEST_DAY_WEEK(SYSDATE+5)
                           6
    SQL> select test_day_week(sysdate+6) from dual;
    TEST_DAY_WEEK(SYSDATE+6)
                           7
    SQL> select test_day_week(sysdate+7) from dual;
    TEST_DAY_WEEK(SYSDATE+7)
                           1
    SQL>

  • As3 call a function inside  swf

    I am loading an external swf like that. In the extrnal swf I
    have a function called "foo". how can I call "foo" function from
    the main swf?
    Thanks

    why not put the function in the main swf and eliminate the
    other swf if thats all there is? i have no clue about how to deal
    with multiple swf's. i'd say define it in the first frame of the
    flash and call on it later

  • Dynamically call different functions inside a function

    Hi there,
    I was wondering if it is possible to dynamically define the function that you want to call. Almost like passing the function name that i want to call as a parameter.
    I am calling a function, but do not want to hardcode the function I am calling. I have different functions that all return a boolean value, and i want to call all of them at different times through the same procedure/function.
    Is this possible???
    Thank you in advance!
    Tanja

    Or combine your functions to use function overloading, then you can use the same name...
    SQL> ed
    Wrote file afiedt.buf
      1  create or replace package mypk as
      2    FUNCTION gen_function (param1 IN NUMBER, param2 IN NUMBER) RETURN BOOLEAN;
      3    FUNCTION gen_function (param1 IN VARCHAR2, param2 IN VARCHAR2) RETURN BOOLEAN;
      4    FUNCTION gen_function (param1 IN BOOLEAN, param2 IN BOOLEAN) RETURN BOOLEAN;
      5    PROCEDURE test;
      6* end;
    SQL> /
    Package created.
    SQL> ed
    Wrote file afiedt.buf
      1  create or replace package body mypk as
      2    FUNCTION gen_function (param1 IN NUMBER, param2 IN NUMBER) RETURN BOOLEAN IS
      3    BEGIN
      4      RETURN (param1*2) = param2;
      5    END;
      6    FUNCTION gen_function (param1 IN VARCHAR2, param2 IN VARCHAR2) RETURN BOOLEAN IS
      7    BEGIN
      8      RETURN param1 = param2;
      9    END;
    10    FUNCTION gen_function (param1 IN BOOLEAN, param2 IN BOOLEAN) RETURN BOOLEAN IS
    11    BEGIN
    12      RETURN NOT(param1) = param2;
    13    END;
    14    PROCEDURE test IS
    15    BEGIN
    16      IF gen_function(1,2) THEN
    17        DBMS_OUTPUT.PUT_LINE('Test1: True');
    18      ELSE
    19        DBMS_OUTPUT.PUT_LINE('Test1: False');
    20      END IF;
    21      IF gen_function('Fred','John') THEN
    22        DBMS_OUTPUT.PUT_LINE('Test2: True');
    23      ELSE
    24        DBMS_OUTPUT.PUT_LINE('Test2: False');
    25      END IF;
    26      IF gen_function(TRUE,FALSE) THEN
    27        DBMS_OUTPUT.PUT_LINE('Test3: True');
    28      ELSE
    29        DBMS_OUTPUT.PUT_LINE('Test31: False');
    30      END IF;
    31    END;
    32* end;
    SQL> /
    Package body created.
    SQL> exec mypk.test;
    Test1: True
    Test2: False
    Test3: True
    PL/SQL procedure successfully completed.
    SQL>;)

  • Unable to debug an exit in CALL CUSTOMER FUNCTION 003

    Hi Guys,
    I have an exit EXIT_SAPMV45A_003 that is called by CALL CUSTOMER FUNCTION 003. I had placed a break point at
    CALL CUSTOMER FUNCTION 003 and the debugger stops here but i am unable to debug inside this to reach into
    the code in EXIT_SAPMV45A_003 even after setting the system debugging on & Update debugging
    ON.
    Can someone help me with this?
    thanks
    Dan

    You have to include that Enhancement of that exit in the Project and Activate that project in the CMOD.
    The Enhancement for the exit EXIT_SAPMV45A_003 is V45A0003.
    Create a project in CMOD
    And inclue V45A0003 in the project.
    Activate the Project.
    Now, it will stop at break point.
    Regards,
    Naimesh Patel

Maybe you are looking for

  • How to give color to the display of keyfigure based on condition using exception.

    Dear Friends.    I am trying to color "BAD3" in exception based on condition but my problem is in exception I can have only formula variable to compare the value, How to assign a value to formula variable in BEx Query designer. What I am trying to do

  • Different Result in 9i & 10g

    Hello, I am facing one strage issue in my reports. When i was using the old version of database as 9.2.0.1.0 all the reports were showing correct results with no problem. But when out DBA upgraded the version from 9.2.0.1.0 to 10.2.0.4.0 then the rep

  • Picture quality relative to bitrate vs resolution

    Hello. I want to better understand the tradeoffs between bitrate and resolution. We know that a 1280x720 frame is 921,600 pixels & a 1920x1080 frame is 2,073,600 pixels - a difference of 2.25x So when considering what bitrate to encode at, is it true

  • Leopard and CS2 Photoshop force quits after clean install

    I just bought a mac book pro with Leopard 10.5.6. I did a clean install of my CS2 and all apps work but Photoshop. When I launch the program, it gets to the end and force quits. Any recommendations? I know I need to upgrade to CS 4 and have no proble

  • Would you recommend Aperture 3 if Lion installed?

    I have a Canon DSLR.  I have already migrated my new Macbook Pro to Lion.  I have read several posts that describe issues with Aperture's Lion compatibility.  Would the group recommend using Aperture or waiting for an update/new version from Apple? T