Nested function

(1)
i want to add a listener that it will direct to a nested function if it triggered,
but later i found that i cant name the target event directly as "dragStart", so what should i type?
(2)
also, are there some ways that able to do the same tweening effect as the code below but without nesting them?
i made the tweenings play as one by one.
thz for any help
function changeImg() {
    mask1.removeEventListener(Event.ENTER_FRAME, mask1Drag);
    stage.addEventListener(MouseEvent.CLICK, dragStart);
     var maskTween1:Tween = new Tween(mask1,"width",Strong.easeInOut,1,750,1,true);     maskTween1.addEventListener(TweenEvent.MOTION_FINISH, playMaskTween2);
    function playMaskTween2(e) {         var maskTween2:Tween = new Tween(mask1,"width",Strong.easeInOut,750,1,1,true);         maskTween2.addEventListener(TweenEvent.MOTION_FINISH, playMaskTween3);
        function playMaskTween3(e) {             var maskTween3:Tween = new Tween(mask1,"width",Strong.easeInOut,1,750 - mouseX,1,true);             maskTween3.addEventListener(TweenEvent.MOTION_FINISH, dragStart);
           function dragStart(e) {                 maskTween1.stop();
                maskTween2.stop();
                maskTween3.stop();
                mask1.addEventListener(Event.ENTER_FRAME, mask1Drag);

variable declaration (eg, var maskTween1:Tween) doesn't define the variable.  it triggers memory allocation for that variable but nothing is assigned to that variable.  ie, that variable's value is null.  (the trace() function is single most important tool (by far) to understand actionscript.  use trace(maskTween1) to see its value after declaration and after assign a new Tween() to it.)
if(maskTween1==true) will always resolve to false.  ie, maskTween1 is never true.
for listeners that you want to remove, you usually remove them in the listener function as shown below.
  var   maskTween1:Tween
var maskTween2:Tween
var maskTween3:Tween
function changeImg() {
    mask1.removeEventListener(Event.ENTER_FRAME, mask1Drag);
    stage.addEventListener(MouseEvent.CLICK, dragStart);
      maskTween1 = new Tween(mask1,"width",Strong.easeInOut,1,750,1,true);     maskTween1.addEventListener(TweenEvent.MOTION_FINISH, playMaskTween2);
  function playMaskTween2(e) {
  maskTween1.removeEventListener(TweenEvent.MOTION_FINISH, playMaskTween2);
        maskTween2 = new Tween(mask1,"width",Strong.easeInOut,750,1,1,true);
        maskTween2.addEventListener(TweenEvent.MOTION_FINISH, playMaskTween3);    
   function playMaskTween3(e) {
    maskTween2.removeEventListener(TweenEvent.MOTION_FINISH, playMaskTween3);    
           maskTween3 = new Tween(mask1,"width",Strong.easeInOut,1,750 - mouseX,1,true);
            maskTween3.addEventListener(TweenEvent.MOTION_FINISH, dragStart);
function dragStart(e) {
   stage.removeEventListener(MouseEvent.CLICK, dragStart);
  maskTween3.removeEventListener(TweenEvent.MOTION_FINISH, dragStart);
                maskTween1.stop();
                 maskTween2.stop();
                 maskTween3.stop();
                 mask1.addEventListener(Event.ENTER_FRAME, mask1Drag);

Similar Messages

  • Syntax for nested function/procedure?

    Hi,
    What's the syntax to create a sub function/procedure in another function/procedure? Is this available in 9i?
    Thanks.

    Nested functions and procedures have been available since at least 7.3. However, any nested functions or procedures need to be the last things in your declare section.
    This works:
    SQL> CREATE OR REPLACE PROCEDURE test_proc is
      2     l_v VARCHAR2(100);
      3     FUNCTION nested_function RETURN VARCHAR2 IS
      4     BEGIN
      5        RETURN('nested function call') ;
      6     END;
      7  BEGIN
      8     l_v := nested_function;
      9     DBMS_OUTPUT.Put_Line(l_v);
    10  END;
    11  /
    Procedure created.But this does not:
    SQL> CREATE OR REPLACE PROCEDURE test_proc is
      2
      3     FUNCTION nested_function RETURN VARCHAR2 IS
      4     BEGIN
      5        RETURN('nested function call') ;
      6     END;
      7     l_v VARCHAR2(100);
      8  BEGIN
      9     l_v := nested_function;
    10     DBMS_OUTPUT.Put_Line(l_v);
    11  END;
    12  /
    Warning: Procedure created with compilation errors.
    SQL> show err
    Errors for PROCEDURE TEST_PROC:
    LINE/COL ERROR
    7/4      PLS-00103: Encountered the symbol "L_V" when expecting one of the
             following:
    12/0     PLS-00103: Encountered the symbol "end-of-file" when expecting
             one of the following:
             begin function package pragma procedure formTTFN
    John

  • Enabling Nested Functions in Terminal?

    I downloaded, and compiled FUSE, but when I try to "make" it i get this error
    Macintosh-5:fuse-2.7.4 alexcaballero$ make
    Making all in include
    make all-am
    Making all in lib
    if /bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVECONFIGH -I. -I. -I../include -I../include -DFUSERMOUNT_DIR=\"/usr/local/bin\" -DFILE_OFFSETBITS=64 -D_REENTRANT -DFUSEUSEVERSION=26 -Wall -W -Wno-sign-compare -Wstrict-prototypes -Wmissing-declarations -Wwrite-strings -g -O2 -fno-strict-aliasing -MT fuse.lo -MD -MP -MF ".deps/fuse.Tpo" -c -o fuse.lo fuse.c; \
    then mv -f ".deps/fuse.Tpo" ".deps/fuse.Plo"; else rm -f ".deps/fuse.Tpo"; exit 1; fi
    libtool: compile: gcc -DHAVECONFIGH -I. -I. -I../include -I../include -DFUSERMOUNT_DIR=\"/usr/local/bin\" -DFILE_OFFSETBITS=64 -D_REENTRANT -DFUSEUSEVERSION=26 -Wall -W -Wno-sign-compare -Wstrict-prototypes -Wmissing-declarations -Wwrite-strings -g -O2 -fno-strict-aliasing -MT fuse.lo -MD -MP -MF .deps/fuse.Tpo -c fuse.c -fno-common -DPIC -o .libs/fuse.o
    In file included from fuse.c:18:
    ../include/fuse_compat.h:69:24: error: sys/statfs.h: No such file or directory
    In file included from fuse.c:18:
    ../include/fuse_compat.h:91: warning: 'struct statfs' declared inside parameter list
    ../include/fuse_compat.h:91: warning: its scope is only this definition or declaration, which is probably not what you want
    ../include/fuse_compat.h:140: warning: 'struct statfs' declared inside parameter list
    fuse.c:689: warning: 'struct statfs' declared inside parameter list
    fuse.c: In function 'convertstatfsold':
    fuse.c:691: error: dereferencing pointer to incomplete type
    fuse.c:692: error: dereferencing pointer to incomplete type
    fuse.c:693: error: dereferencing pointer to incomplete type
    fuse.c:694: error: dereferencing pointer to incomplete type
    fuse.c:695: error: dereferencing pointer to incomplete type
    fuse.c:696: error: dereferencing pointer to incomplete type
    fuse.c:697: error: dereferencing pointer to incomplete type
    fuse.c: In function 'fusecompatstatfs':
    fuse.c:708: error: storage size of 'oldbuf' isn't known
    fuse.c:708: warning: unused variable 'oldbuf'
    fuse.c: In function 'curr_time':
    fuse.c:1183: error: nested functions are disabled, use -fnested-functions to re-enable
    fuse.c:1183: error: syntax error before 'clockid'
    fuse.c:1184: warning: implicit declaration of function 'clock_gettime'
    fuse.c:1184: error: 'clockid' undeclared (first use in this function)
    fuse.c:1184: error: (Each undeclared identifier is reported only once
    fuse.c:1184: error: for each function it appears in.)
    fuse.c:1186: error: 'CLOCK_REALTIME' undeclared (first use in this function)
    make[1]: * [fuse.lo] Error 1
    make: * [all-recursive] Error 1
    when I try -fnested-functions in the terminal to enable the functions, this error comes up
    Macintosh-5:~ alexcaballero$ -fnested-functions
    -bash: -fnested-functions: command not found
    so how do i enable them?

    Well the thing is that I did install MacFuse, yet the directions I got told me I had to download FUSE as well. I'm trying to mount my Gmail account on my desktop.
    So were these instructions Mac specific? Or where they for Unix/Linux systems running Fuse? Is there a web URL you can give?
    Oh yea, where did you download your Fuse sources from? Just in case someone whats to look at a copy.
    As to your -fnested-functions error:
    fuse.c:1183: error: nested functions are disabled, use -fnested-functions to re-enable
    This is NOT a shell option, but a compiler option. If you wish to pursue this, you would need to change the Makefile so that the compiler using the -fnested-functions option.

  • Nested functions?

    If I insert an IF function in a cell, I expect to be able to insert another function for the condition, but the functions are greyed out.
    Tutorials and the help system don't list nested functions. Anyone point me in the right direction, please?

    Martin Inchley wrote:
    Thanks for this. Seems to work so far. I suppose the reason the other functions button is greyed out is because it is intended primarily for the major summary functions it lists, which would not normally fit within a formula.
    Perhaps it would have been more apt to name this "Formulas" rather than "Function" since the bulk of the items in the pop up menu generate entire formulas (complete with equal sign and "smart" range parameter values) rather than just a function piece of a formula.

  • Enabling nested function?

    I'm trying to "make" FUSE, and i keep getting this error
    fuse.c: In function 'curr_time':
    fuse.c:1183: error: nested functions are disabled, use -fnested-functions to re-enable
    fuse.c:1183: error: syntax error before 'clockid'
    fuse.c:1184: warning: implicit declaration of function 'clock_gettime'
    fuse.c:1184: error: 'clockid' undeclared (first use in this function)
    fuse.c:1184: error: (Each undeclared identifier is reported only once
    fuse.c:1184: error: for each function it appears in.)
    fuse.c:1186: error: 'CLOCK_REALTIME' undeclared (first use in this function)
    make[1]: * [fuse.lo] Error 1
    make: * [all-recursive] Error 1
    i tried -fnested-function but i get
    Macintosh-5:~ alexcaballero$ -fnested-functions
    -bash: -fnested-functions: command not found

    Cross posted in the Mac OS X Technologies -> Unix forum
    <http://discussions.apple.com/thread.jspa?messageID=9073766&tstart=0#9073766>

  • Case and decode - nested functions

    Can i use a case statement inside a decode or nvl2 function?
    eg.
    decode(col_a,'ABC',
    case when col_b in (1,2) then 'CCC' else when col_b in (3,4,5) then 'XXX' end
    , 'NA')
    Can i use a function like this basically, can i nest a case statement within a decode or nvl2 function?
    I have used nested decodes and nvls and nested case statements but not combined both so far.... so need an opinion...
    Thanks.
    Edited by: user254668 on Apr 30, 2010 1:35 PM

    user254668 wrote:
    Can i use a case statement inside a decode or nvl2 function? Absolutely. Just get rid of that else:
    decode(col_a,'ABC',
    case when col_b in (1,2) then 'CCC' when col_b in (3,4,5) then 'XXX' end
    , 'NA') SY.

  • Question about nested functions

    This can't be done
    for example
    select min(count(*))
    from...
    I need to calculate the minimun of a cuantity I obtain from count(*)
    Any ideas?
    Thanks

    You can nest aggregate functions. Here is what it says in the [SQL Reference|http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/functions001.htm#i89203] .
    You can nest aggregate functions. For example, the following example calculates the average of the maximum salaries of all the departments in the sample schema hr:SELECT AVG(MAX(salary)) FROM employees GROUP BY department_id;
    AVG(MAX(SALARY))
    10925
    This calculation evaluates the inner aggregate (MAX(salary)) for each group defined by the GROUP BY clause (department_id), and aggregates the results again.

  • 'Un-nest' function in PP CS4?

    Hey guys,I have been working on a video and I nested some clips together, I havent been able to find an 'un-nest' command, and a quick google search didn't provide me with any help. Is there either a function to un-nest or easy work-around?
    Cheers

    I guess there's still some confusion over this workflow.  It is more efficient to watch a series of clips, then to watch one clip at a time.  I don't want to watch clips INDIVIDUALLY, I want to watch a SERIES of them, back to back to back to back.  I want to scroll through 10 clips without ever touching the mouse.  The way to do that is to put those 10 clips into a sequence, and cut from that sequence.  I swear to you guys this is normal, particularly for anybody that comes from the world of Media Composer.  Once you've edited this way, the idea of loading an individual clip one at a time seems wasteful and ludicrous.  Every time I'm worrying about what's in the browser, I'm not editing.  Every time my hand leaves the keyboard to go to the mouse to double-click a clip to load it, I'm not editing.  These are time sinks. 
    Let's say I've got three takes of the same shot, and they're all roughly similar.  If I'm editing from clips, or subclips, then this is the workflow:
    I load scene 12b take 1 into the source.  I watch it.  It's okay.  Next, I take my right hand away from JKL to reach for the mouse/trackball/track pad, mouse over to the browser, double-click on take 2, load it into the source monitor.  Hand moves back to JKL.  I watch the clip.  Okay, it's a'ight.  So now I have to watch take 3.  Again, hand leaves keyboard, clip is double-clicked, hand comes back to JKL.  Now I've watched all three.  Hmm.  Let's take a look at that first one again.  You know where I'm going.  This time I use the mouse to go to the clip select in the source monitor pulldown.  Okay, then I watch the clip again.  Hmm.  Maybe this one.  Let's look at the third one again, because something was weird with the way talent said the word "species."  Okay, up to the source monitor.  Okay, definitely take 1.  Hands off the keyboard again, back to the source monitor.  Okay.  Now I'm ready to mark my ins and outs. 
    That's one way to go.  Let's take a look at using sequences. 
    I load the scene 12b sequence into the source monitor.  I hit L and start playing.  I've now watched all three takes.  I want to return to the first take, so I hit the "previous edit" key twice.  Now I'm back to take 1.  L button and I'm watching, okay, I've seen all I need, let's hit "next edit" twice and jump to take 3.  Hit L twice to fast forward to the word "species."  Sounds kinda wack.  Let's hit that previous edit key again (I've got it mapped to "A" so my hand never leaves the homekeys) and go back to take 1.  Mark in, mark out, and now it's time to insert this shot into the sequence.
    In MC and FCP (using the insert sequence content command instead of the plain insert command), this cuts the clip into the sequence.  In PP, this cuts a nested sequence into my sequence.  For starters, now I am unable to export this sequence as an OMF to get to ProTools.  That's a deal-breaker in a professional environment.  Then, I've got this nested sequence that has no real reason to be nested.  For starters, a quick glance at the timeline reveals not which take I actually used or the name of the master clip, but rather the name of the entire sequence.  Matching back goes back to the sequence, as opposed to the master clip. 
    If you already know exactly which take you're going to use, without looking at other takes, then a subclip straight from the bin is a fine edit strategy.  But I've found that circled takes don't always cut well with each other for continuity reasons or technical reasons.  Therefore, being able to watch a series of clips, quickly, without incessant mousing around (which indisputably is slower than tapping a key once or twice) from timelines to monitors to browsers and back is of great importance.  It's a usability issue.  When doing realities or doc stuff, the same is true.  I'd way rather scrub through a whole sequence of shots of "heat energy" than have to load each clip which demonstrates heat energy individually.  That's a real life example from a series of fairly hoaky educational videos I worked on.  We had 100s of tapes worth of footage, and if we had to load individual clips, that would mean scrolling through thousands of clips.  I'd spend more time looking for the actual clip I wanted than watching shots.  As Walter Murch suggests, scanning through footage is also a more helpful process than scanning through folders or bins of clip names.  If I'm scrubbing through a sequence called "HEAT" looking for just the right shot, I'm being exposed to all of my footage, even at high speeds.  I might find something I hadn't thought of using, or see a shot that I might want to use later.  If I'm scanning through a bin looking for a subclip named "boiling water" then I might not see some of that other stuff.  That lessens the chances of happy accidents, and I'm less familiar with the actual visual content of the footage than if I had scrubbed through a sequence.    
    This isn't some crack-pot editing method I dreamed up in a vacuum.  It's a pretty common method that has been around as long as NLEs (as far as I know, or at least since I began using professional NLEs in 1999).  Avid editors aren't just salty old-timers who think all this new-fangled stuff is crap.  As any of us, we've all gotten used to FCP, but we're still annoyed by some of the inelegant, time-wasting design flaws.  And as we explore Premiere Pro, the same is true.  Something that requires five keystrokes and click wastes more time than something that requires two keystrokes.  That stuff adds up at the end of the day. 
    As for FCPX, the magnetic timeline scares the heck out of me.  Collapsible tracks sound interesting, like a way of opening up a nested sequence, but FCPX most certainly doesn't offer the functionality I'm looking for (about that OMF export... oh yeah, and it doesn't even HAVE a source window, nor can I easily keep things on the tracks I want them on -- nightmare for keeping all of one's music on these two channels, and all of one's VO on that channel... like every broadcaster or client wants their masters tracked out).  Oh, and since I'm talking about tracks... this whole stereo track/mono track thing is a little clunky.  To most editors, we think that a stereo track is just two tracks.  Channel 1 and Channel 2, and those can be panned left and right.  If I have four tracks, I should be able to put L and R in any one of those tracks, and mono clips into any one of those tracks, because there's no difference between a mono clip and a stereo clip's channel 1, except panning.  To have tracks that can only accept one or the other is just plain clunky.  So -- additional feature request.  Let me cut a stereo clip into two mono tracks.  Without having to break-out to mono and perform 3 edits, instead of one. 
    I know I've been really verbose.  But, honestly, Premiere Pro is really close to actually being Pro, and I'd love to use an affordable, and feature-full 64-bit NLE that integrates with the other software I use.  On a PC?  Great!  That saves me a grand on hardware.  Premiere Pro can be this software, IF Adobe listens to long-time professional editors and incorporate standard usability.  Not listening to editors is what made FCPX such a lemon. 

  • Nested functions in XML Publisher

    Hello Everyone,
    I am building a template in MS Word, using the Oracle XML Publisher Template Builder.
    I have data from an Accounts Receivable report that is coming out at 1234,99. I would like it to come out as 1,234.99. So I would want
    1) The comma as a thousands separator.
    2) Instead of the comma as a decimal separator, I want the period as a decimal separator.
    I can use this for the comma thousands separator:
    <?format-number:VAL;'999G999D99'?>
    And I can use this to replace the decimal separator from a comma to a period (thanks to the forums):
    <?xdofx:replace(VAL,',','.')?>
    Can I combine both of these functions together? I am not sure of the syntax.
    Thanks...colin

    <?format-number(xdoxslt:replace(VAL,’,’,’.’),'##,##0.00')?> for
    1234,99
    4444444444,55gives
    1,234.99
    4,444,444,444.55

  • Calling nested function to perform DML and wait for commit

    Hi everybody,
    I would like to do some DML -- an insert statement, to be specific -- in a function and have the function then return the numeric key of the newly added row. I call this function from another context and woud then be able to use the newly added data to do some stuff.
    More specifically, what I am going to do is this: I have a graph consisting of source, destination and distance triplets in a table. A user should now be able to
    1.) add a node 'A' to the graph,
    2.) add a node 'B' to the graph
    3.) get the shortest path from A to B through the graph.
    I have an inner function function INSERT_NEW_NODE(node_in in sdo_geometry, graph_in in integer) return integer
    is 
    pragma autonomous_transaction;
    cursor node_cur is 
      select
          source,
          source_geom
      from graph 
    cursor edge_cur is
        select
            source,
            destination,
            distance,
            edge_geom
        from
          graph
        where
          sdo_geom.relate(edge_geom, 'anyinteract', node_in, .005) = 'TRUE';
    begin
      -- check if identical with any existing node
      for node_rec in node_cur loop 
        if sdo_geom.relate(node_rec.source_geom, 'EQUAL', node_in, .005) = 'EQUAL' then
          return node_rec.source;
        end if;
      end loop;   
      -- get edges
      for edge_rec in edge_cur loop
         -- new_node-->edge.destination and vice versa
        insert into
          graph
            ID,
            GRAPH,
            SOURCE,
            DESTINATION,
            DISTANCE,
            SOURCE_GEOM,
            DESTINATION_GEOM,
            EDGE_GEOM
        values
          graph_id_seq.nextval, --id
          graph_in, --graph
          morton(node_in.sdo_point.x, node_in.sdo_point.y),  -- source morton key
          edge_rec.source, -- destination morton key
          sdo_geom.sdo_distance(edge_rec.source_geom_marl2000, node_in, .005, 'unit=M'), -- distance
          node_in, -- source geom
          edge_rec.source_geom,  -- dest geom
          split_line(edge_rec.edge_geom_marl2000, node_in).segment1 -- edge geom
        commit;
        --new_node-->edge.source and vice versa
        insert into
          gl_graph
            ID,
            GRAPH,
            SOURCE,
            DESTINATION,
            DISTANCE,
            SOURCE_GEOM,
            DESTINATION_GEOM,
            EDGE_GEOM
        values
          graph_id_seq.nextval, --id
          graph_in, --graph
          edge_rec.source, -- source morton key
          morton(node_in.sdo_point.x, node_in.sdo_point.y), -- destination morton key
          sdo_geom.sdo_distance(edge_rec.source_geom, node_in, .005, 'unit=M'), -- distance
          edge_rec.source_geom,  -- source geom
          node_in, -- dest geom
          split_line(edge_rec.edge_geom, node_in).segment2 -- edge geom
        commit;
      end loop
      return(morton(node_in.sdo_point.x, node_in.sdo_point.y));
    end insert_new_node;, which adds the new nodes to the graph, connects, calculates distances etc. and returns a handle to the newly added node. I call this function twice from another, outer function function get_path (line_in in sdo_geometry, graph_in in integer) return sdo_geometry
    is 
    source number;
    destination number;
    source_geom mdsys.sdo_geometry;
    destination_geom mdsys.sdo_geometry;
    begin
      source := insert_new_node(get_firstvertex(line_in), graph_in);
      destination := insert_new_node(get_lastvertex(line_in), graph_in);
      -- source := insert_new_node(get_firstvertex(line_in), graph_in);
      -- destination := insert_new_node(get_lastvertex(line_in), graph_in);
      return(get_path_geom(source, destination)); --returns a geometry which is the shortest path between source and destination
    end get_path;; and I think, I have to use automous transaction in the inner function, so that the outer function can see any change performed by the inner one. However, this only works, when I call the inner function twice (i.e. remove the comment signs in front of the last two lines of code right before the return statement in the outer function.
    So here's my questions: 1.) Why do I have to call the function twice to see the transaction complete? and 2.) How can I avoid that? Is there a way to wait with the execution of the return statement in the inner function until the insert is committed and can be seen by the outer function?
    Cheers!

    Tanks, everybody, for your replies! Let me go through them one by one
    smon asked: if you remove the pragma statement, does it work then?No, it does not, at least not, if I call the function from the outer function. In this case the insert statements in the inner function are not committed.
    If I call the inner function like thisDECLARE
      NODE_IN SDO_GEOMETRY;
      GRAPH_IN NUMBER;
      v_Return NUMBER;
    BEGIN
      NODE_IN := MDSYS.SDO_GEOMETRY(2001,<srid>,MDSYS.SDO_POINT_TYPE(<x>,<y>,<z>),NULL,NULL);
      GRAPH_IN := 3;
      v_Return := INSERT_NEW_NODE(
        NODE_IN => NODE_IN,
        GRAPH_IN => GRAPH_IN
    DBMS_OUTPUT.PUT_LINE('v_Return = ' || v_Return);
      :v_Return := v_Return;
    END;, it works without autonomous transaction, but then again like this I do not use the handle to access the newly inserted data immediately to perform some other task with it.
    sb92075 said:COMMIT inside LOOP is sub-optimal implementation (increases elapsed time) & can result in ORA-01555 error.Thanks, that was very helpful; I changed my code to commit outside of the loop, just before the return statement and it performs a lot faster now.
    user1983440, regarding my statement I think, I have to use automous transaction in the inner function, so that the outer function can see any change performed by the inner one. asked: Are you certain that this is true? No, anything but certain. I should have said "It +seems+, I have to use autonomous transaction". I wish it would work without autonomous transaction, I think it actually should and I wonder why it does not. However, if I do not use autonomous transaction, the outer function seems to try to access the data that I have inserted in the inner function before it is committed, throws a no-data-found-exception, hence a rollback is performed.
    davidp 2 said:The outer function will see whatever the inner function has done, without commit or autonomous transaction [...] In PL/SQL, the default commit is COMMIT WRITE NOWAIT, which I think does mean the transaction might not be instantly visible to the outside transaction, because the call returns before the commit really finishes. Yes, that is my notion, too. However, without autonomous transaction the inner function completes without error, then the outer uses the handles returned by the inner function to call the function <font face="courier">get_path_geom()</font> which cannot find the handles in the graph-table which raises an exception and causes a rollback.
    Let me summarize: The inner function completes fine, without and with autonomous transaction and returns the handle. The inner function commits, if called directly, without and (of course) with autonomous transaction. The outer function does not see the data inserted by the inner function immediately, whether without or with autonomous transaction. If I let the outer function call the inner function twice (4 times, to be specific, but twice for each newly inserted row) from the outer function and do not use autonomous transaction, I get a no-data-found exception. If I let the outer function call the inner function twice and do use autonomous transaction, it works.
    I agree with everything that was said about not using autonomous transaction in this case and I still want to solve this the right way. Any ideas are welcome!

  • Nested functions in javascript!!!

    Hi!
    I'm facing a prob with javascript .
    Can I calla javascript function from another javascript function .
    My code is as follows:
    <html>
    <head>
    <script language="JavaScript">
    function check()
         var a=1;
         alert("In check()");
         check1(a);
         return true;
    function check1(var a)
         alert("in check1 "+a);
         return true;
    </script>
    <title>
    Validation
    </title>
    </head>
    <body>
    <form name="myform" method="post" onSubmit="return false;">
    IP Address :<input type="text" name="ip" maxlength=15 ></input>
    <input type="submit" name="submit" value="Submit" onClick="return check();"></input>
    </form>
    </body>
    </html>
    Any help will be appreciated.
    Thanks

    Sure you can: you just don't declare their types :-)
    ie you don't need "var" in the parameter list for the function.
    You can call the function with more parameters than you specify (access them via the "arguments" keyword in a function)
    You can call the function with less parameters than you specify (surplus parameters will be null).
    function check1(a)
    alert("in check1 "+a);
    return true;
    }

  • Nested functions not waiting

    var confirmed = confirm ("You picked [ " + selected_rbutton (totalgroups) +" ]"+ "\nYou picked [ " + questionResize (rsizechoice) + " ] to resize" + "\n" +"\nContinue?");
            confirm.noAsDflt == false;
            if (confirmed == true)
                copy();
                openTemp ();
                paste();
                centerArt ();
                resizeart ();
                savefile ()
                putname ();
             } /*end if */ else
             alert ("You chose not to continue, script stopped")
             }//end else
    }//end if OK
    I've coded everything inside separate functions this way I can save space letting the user make a choice and each choice will use different groups of functions.  My only problem is that the some of the functions are still doing their thing when the next starts but it may depend on the one above it to finish.  Function savefile () lets the user type in a new name and it saves to a couple different folder then Function putname () puts that users name and file name at the top of the artboard in the corner.  What is happening is that the user is chooseing to rename the file but the Function putname () has already filled its variables with the old name not the new one.  How can I make it wait till function savefile () is done?

    From your other thread and in relationship to this thread, below is how I would suggest approaching what you stated of running functions in sequence:
    Re: Script errors and a question
    Zantcor wrote:
    All I need it to do is the following in the correct order;
    copy();
    openTemp ();
    paste();
    centerArt ();
    resizeart ();
    savefile ()
    putname ();
    Two Possible Approaches Shown Below: [shown in basic simple form, for these examples]
    1. ] Passing Functions through Functions:
    The first approach is make each function modular, allowing it to pass and call other functions if and when needed. You can do this by passing in a parameter to the function of a function. Then evaluate the parameter and respond accordingly. Below is a basic example of how this can be done.
    Example of calling successive functions by passing a new function through each function
    function sampleInit() {
      // Example of calling successive functions using this approach
        alert("Invoked from:\nsampleInit()");
        sampleFunction1(sampleFunction2);
        sampleFunction3(sampleFunction4);
        sampleFunction5();
    sampleInit();
    function sampleFunction1(fName) {
        // All the code that is evoked with this function
        var sampleArray = [];
        for (var i = 0, l = 100; i < l; i++) {
            sampleArray.push("1");
        alert("Invoked from:\nsampleFunction1()\n\n"+sampleArray);
        // End of all the code for this function
        // Then at the end call another function if passed or if null, do nothing.
        if (fName && (typeof fName == "function")) {
            fName();
    function sampleFunction2(fName) {
        var sampleArray = [];
        for (var i = 0, l = 200; i < l; i++) {
            sampleArray.push("2");
        alert("Invoked from:\nsampleFunction2()\n\n"+sampleArray);
        if (fName && (typeof fName == "function")) {
            fName();
    function sampleFunction3(fName) {
        var sampleArray = [];
        for (var i = 0, l = 300; i < l; i++) {
            sampleArray.push("3");
        alert("Invoked from:\nsampleFunction3()\n\n"+sampleArray);
        if (fName && (typeof fName == "function")) {
            fName();
    function sampleFunction4(fName) {
        var sampleArray = [];
        for (var i = 0, l = 400; i < l; i++) {
            sampleArray.push("4");
        alert("Invoked from:\nsampleFunction4()\n\n"+sampleArray);
        if (fName && (typeof fName == "function")) {
            fName();
    function sampleFunction5(fName) {
        var sampleArray = [];
        for (var i = 0, l = 500; i < l; i++) {
            sampleArray.push("5");
        alert("Invoked from:\nsampleFunction5()\n\n"+sampleArray);
        if (fName && (typeof fName == "function")) {
            fName();
    2. ] Array of Functions:
    The next example uses an array to call the functions without passing the function into and through each other (it's basically the same setup as above, just stripped of that feature).
    Example of calling successive functions using an array
    function sampleInit() {
        alert("Invoked from:\nsampleInit()");
        var functionArray = [sampleFunction1, sampleFunction2, sampleFunction3, sampleFunction4, sampleFunction5];
        for (var i = 0, l = functionArray.length; i < l; i++) {
            functionArray[i]();
    sampleInit();
    function sampleFunction1() {
        var sampleArray = [];
        for (var i = 0, l = 100; i < l; i++) {
            sampleArray.push("1");
        alert("Invoked from:\nsampleFunction1()\n\n"+sampleArray);
    function sampleFunction2() {
        var sampleArray = [];
        for (var i = 0, l = 200; i < l; i++) {
            sampleArray.push("2");
        alert("Invoked from:\nsampleFunction2()\n\n"+sampleArray);
    function sampleFunction3() {
        var sampleArray = [];
        for (var i = 0, l = 300; i < l; i++) {
            sampleArray.push("3");
        alert("Invoked from:\nsampleFunction3()\n\n"+sampleArray);
    function sampleFunction4() {
        var sampleArray = [];
        for (var i = 0, l = 400; i < l; i++) {
            sampleArray.push("4");
        alert("Invoked from:\nsampleFunction4()\n\n"+sampleArray);
    function sampleFunction5() {
        var sampleArray = [];
        for (var i = 0, l = 500; i < l; i++) {
            sampleArray.push("5");
        alert("Invoked from:\nsampleFunction5()\n\n"+sampleArray);
    Sorry for the delay, after talking to you in your other thread, I started to post here then got busy with something else. Anyway, hopefully one of these approaches help you organize and execute your functions as desired.
    What you think Carlos, can you share some correct answer points?

  • Duplicating Effort in SQL functions

    Hi, If I have a piece of SQL such:
    SELECT
          SUBSTR(really complex nested functions [no PLSQL function / context switching however]) AS COL1,
          LENGTH(SUBSTR(really complex functions [no PLSQL function / context switching however])
    AS COL2
    FROM mytableThe second column is obviously just the length of COL1
    Does SQL engine when processing the function for COL2, execute the "really complex function" again - before getting the LENGTH? Or does it just reuse what it already calculated in COL1?
    If not, is there anyway of allowing the "Really complex function" result resued by other COLs?
    I do not wish to use a PLSQL function.
    Thanks for any help

    Well the CBO is pretty clever, it won't do two passes if it realises it's not necessary. Here's a bit of simple obfuscation SQL with and without inline view explained:
    EXPLAIN PLAN
    SET STATEMENT_ID='ORIG'
    FOR
    SELECT last_name, '555' || Translate (Substr (phone_number, 4),
                        '0123456789',
                        '5678901234') tel,
              Length ('555' || Translate (Substr (phone_number, 4),
                        '0123456789',
                        '5678901234')) len
    FROM employees;
    EXPLAIN PLAN
    SET STATEMENT_ID='ILV'
    FOR
    SELECT last_name, tel, Length (tel) len
    FROM (
    SELECT last_name, '555' || Translate (Substr (phone_number, 4),
                        '0123456789',
                        '5678901234') tel
    FROM employees);
    SQL> START XPLAIN
    Explained.
    Explained.
    Original
    Query Plan
    SELECT STATEMENT Cost = 3
    TABLE ACCESS FULL EMPLOYEES
    Inline View
    Query Plan
    SELECT STATEMENT Cost = 3
    TABLE ACCESS FULL EMPLOYEES
    Rollback complete.
    SQL>
    You might also look at the 11g virtual column feature where you define columns of a table as functions of other columns.

  • Query of queries disallows SQL right() function

    We're attempting to do a query of queries using the SQL
    right() function like this:
    select *
    from getresults
    where right([key],charindex('\',reverse([key]),1)-1) not in
    (#quotedvaluelist(getexcluded.file_name)#)
    We've even replaced that where clause with a much more simple
    where right([key])='m'
    just to make sure that it wasn't the nesting functions that
    were causing the problem.
    In either case, we get the error:
    Query of Queries syntax error.
    Encountered "right" at line 0, column 0. Incorrect
    conditional expression,
    Expected one of [like|null|between|in|comparison] condition,
    What SQL functions are disallowed from query of queries?
    Thanks,
    Kris

    Nasty stuff huh. Just happened to discover myself today that
    Left doesn't work. I'd suspect that Aggregate functions are the
    ONLY ones that will work. It would have been nice if they'd at
    least allowed CF vs DB functions in their own "database" language.
    BTW, also discovered that Count() returns Null rather than 0
    when there aren't any per your WHERE clause.

  • Where can i find more information about using or nesting formulas

    where can i find more information about using or nesting formulas

    I am not aware there is a resource specific to nesting functions.  this comes from understanding each function (or at least the description in the function help).
    a great resource is the function reference which you can see by typing the "=" sign in any cell:
    the important thing to note is:
    1) what are the inputs to the function and
    2) what does the function return (the output)
    the if() function (listed above) takes three inputs and returns one output.  These forums are a great resource!

Maybe you are looking for

  • Error While saving the Production Order

    Dear Experts Pls let me know why am getting the below error while saving the production order after release.. PSFC_STD_LAYOUT does not exist Message no. SSFCOMPOSER004

  • How to find the material received in warehouse for work order through table

    Dear All , I am creating alerting system We have  requrirement that if the notification or work order is pending for 10 days then alert to be sent to planner and 20 days to his senior and 30n days to his senior We have created FM for this  every day

  • Explain plan/autotrace for stored procedure

    Hello, I have an stored procedure executing a select statement. I would like to use autotrace or explain plan or something to check how my select statement is executed. So far I've only accomplished to use autotrace on statements i write in sql*plus.

  • Is a controller required for roaming?

    We've been using single stand-alone Aironet AP's at our small branch offices with great reliability and success over the last 3 years.  However, we recently acquired an office with only a few clients (10), but it is an old warehouse so it has a lot o

  • X-Fi Xtreme Gamer with VI

    Hopefully somebody mite be able to offer me some help. I had an Audigy 4 and after finding that there was not a lot of chance getting surround working in BF2 I decided to treat myself to an Xtreme Gamer. The first problem I ran into was the BSOD when