Is it possible to avoid using anonymous functions in certain calls?

Hi All,
In my plugin code I have some calls similar to the following:
        LrTasks.startAsyncTaskWithoutErrorHandler(function ()
            -- do stuff here
        end)
Use of anonymous functions to pass parameters to the SDK is straight out of the API reference and SDK documentation.  The code executes fine, but it can break the ability of some text editors to maintain a function list for quick navigation around your code.
Does anyone know of a way to pass named functions or anonymous code blocks (rather than functions) to the calls instead?
Thanks,
Matt

You can use named functions as well:
function myNamedFunction()
   -- do stuff here
end
LrTasks.startAsyncTaskWithoutErrorHandler(myNamedFunction)

Similar Messages

  • How to avoid use of function module in case of background jobs?

    Hi ,
           I am working a file tranfer interface .Functionality is to extract file either apllication or presentation server , and process the file  through bapi , send the  result in their respective server. This program should run through batch jobs in background mode.
    I am using following function module :
      SUBST_GET_FILE_LIS : Get the file list from application server
    TMP_GUI_DIRECTORY_LIST_FILES : Get the file list from presentation server
    GUI_UPLOad : to extract file data   from presentation server
    GUI_downLOAD : to download data  to presentation server
    in case of background job these function modules will not work.... so how to resolve this issue...
    what are the methods we can apply?
    Thanks & Regards
    Sandeep

    Hi,
    This FM is used to get list of files from Application server (will work in Background). This cannot be used to list files from presentation server.  There is no way , by which you can process presentation server files in background mode.
    Regards
    Vinod

  • Oracle 9i - Is there a possiblity to avoid creating a function?

    Here is the structure of my table.
    Table users.
    USER_ID, NT_ID, F_NAME, L_NAME
    There are two ways to fetch the name of the user.
    SELECT f_name || l_name from Users
    WHERE user_id = 'ABHIJIT';
    OR
    SELECT f_name || l_name from Users
    WHERE nt_id = '800001';Due to a design flaw, the audit tables in the system contain either the user_id or the nt_id in one of the columns.
    So I wrote a function like this.
    /*This is an anonymous PL/SQL block*/
    declare
    V_USER VARCHAR2(60) := '';
    BEGIN
      SELECT F_NAME || ' ' || L_NAME
      INTO V_USER
      FROM USERS
      WHERE USER_ID = '&a';
      DBMS_OUTPUT.PUT_LINE(V_USER);
    EXCEPTION
      WHEN NO_DATA_FOUND THEN
      SELECT F_NAME || ' ' || L_NAME
      INTO V_USER
      FROM USERS
      WHERE NT_ID = '&a';
            DBMS_OUTPUT.PUT_LINE(V_USER);    
      WHEN OTHERS THEN
            DBMS_OUTPUT.PUT_LINE(V_USER);
    END;
    Is there anyway I could utilize a join instead of a function?

    HI.. one option can be..
    SELECT NAME
    INTO V_USER
    FROM (SELECT F_NAME || ' ' || L_NAME NAME
          FROM USERS
          WHERE USER_ID = '&a'
          UNION ALL
          SELECT F_NAME || ' ' || L_NAME
          FROM USERS
          WHERE NT_ID = '&a'; 
          AND  NOT EXISTS ( SELECT 1
                            FROM USERS
                            WHERE USER_ID = '&a'));Not tested

  • Anonymous Functions (Lambda expressions) in Java?

    Hello,
    I need to know if there are anonymous functions in Java. I am writing a platform independent shell, and I would like to use anonymous functions to make the shell better.
    Does Java support anonymous functions or is it unsupported?
    Thanks.

    functions without a name? no
    functions belong to classes, and every class method has a name.
    you want to use lisp.
    %

  • Best practices on using EVALUATE functions

    hi, experts,
    I wanna know what is the best practices on using EVALUATE functions on obiee (calling oracle user defined functions)
    I found that if I use evaluate functions in Answers,
    obiee will construct a sql behind and then execute.
    sometimes, obiee contructs some unexpected sqls, and returns errors.
    so, is it better to use EVALUATE functions in logical columns ?
    thanks

    EVALUATE('DB_Function(%1)' as returntype, {Comma separated Expression})
    even when used in Logical columns, its gonna fire the same sql.

  • Update sap table using a function module call by php code

    Hello,
    I m trying to update the table VBAP using a function module ZZ_SET_DISTANCE  call by a php code.
    But I have this problem:
    the saprfc seems to work well but when I look to the table VBAP the fields have not been update.
    I tried the function module in debug mode and it work good. The fields are update.
    I also handle the saprfc call function and the return SAPRFC_OK
    This are the function module ZZ_SET_DISTANCE, and the php code
    //PHP CODE
    $fce = saprfc_function_discover($sap,"ZZ_SET_DISTANCE");
                  if (! $fce ) {echo "Echec d'ouverture du module fonction "; exit;}
                   saprfc_import ($fce,"COMMANDE", '0000001998');
                   saprfc_table_init($fce,"TBLE_CMDE");
                        $val=array();
                        $val['NUM_POST']='000030';
                        $val['HN_EXP']='';
                        $val['ST_EXP']='';
                        $val['PC_EXP']='';
                        $val['CI_EXP']='';
                        $val['CO_EXP']='';
                        $val['HN_REC']='';
                        $val['ST_REC']='';
                        $val['PC_REC']='';
                        $val['CI_REC']='';
                        $val['CO_REC']='';
                        $val['DIST']='popo';
                        saprfc_table_append ($fce,"TBLE_CMDE", $val);
                 $rfc_rc = saprfc_call_and_receive ($fce);
                 echo "\n".$rfc_rc;
                 if ($rfc_rc != SAPRFC_OK) { if ($sap == SAPRFC_EXCEPTION ) echo ("Exception raised: ".saprfc_exception($fce)); else echo (saprfc_error($fce)); }else{echo '/execution de la function ;}
                 saprfc_function_free($fce);
    //FUNCTION MODULE ZZ_SET_DISTANCE
    FUNCTION ZZ_SET_DISTANCE.
    ""Local Interface:
    *"  IMPORTING
    *"     VALUE(COMMANDE) TYPE  VBELN
    *"  TABLES
    *"      TBLE_CMDE STRUCTURE  ZADD_COM_LOXAN
    DATA : NUMC TYPE VBELN.
    NUMC = COMMANDE .
    WHILE STRLEN( NUMC ) < 10 .
      CONCATENATE '0' NUMC INTO NUMC .
    ENDWHILE .
    DATA tble_addrcomm LIKE LINE OF TBLE_CMDE .
    LOOP AT  TBLE_CMDE INTO  tble_addrcomm.
      DATA : NUMP TYPE POSNR.
      NUMP = tble_addrcomm-NUM_POST.
      WHILE STRLEN( NUMP ) < 6 .
      CONCATENATE '0' NUMP INTO NUMP .
      ENDWHILE .
      UPDATE VBAP SET ARKTX = tble_addrcomm-DIST
      WHERE VBELN EQ COMMANDE
      AND POSNR EQ NUMP.
    ENDLOOP.
    ENDFUNCTION.
    Is anybody can help me?
    thank.

    Marie, create a Blog please, about more details for dummies....
    1) how to connect to sap system?
    2) you run the php code where? in a webserver or where?
    3) wich is the url for run the FM: ZZ_SET_DISTANCE
    4) you placed some dlls files on the web server?
    please is interesting this...
    Thanks

  • Elvis: Is It possible to use the Function Generator and the Oscilloscope simultaneously?

    Hi,
     We are using the NI Elvis to output a function or a sine wave at a certain frequency and using the oscilloscope on the same board/elvis to read a modified signal. Is this possible? Can we use both the Function Generator and the oscilloscope at the same time? Please help. The oscilloscope would be reading signal from an accelerometer. Thank you in advance. We have no VI as we do not know which to use and if they are possible.

    Hi,
    There is no problem using the Function Generator and Oscilloscope
    at the same time with NI ELVIS. Using the NI ELVIS soft front panels (Start
    >> Programs >> National Instruments >> NI ELVIS 3.0 >>
    NI ELVIS – see picture attached –‘NI ELVIS soft front panels.JPG’), you can choose
    to open more than one instrument at a time. We do this by opening one
    instrument, allowing it to begin, and then opening another. We can also program
    in LabVIEW using more than one instrument at a time by placing down multiple
    Express VI’s taken from the NI ELVIS pallet on the block diagram (see picture
    attached – ‘ELVIS Express VI's (LabVIEW).JPG’). One note when doing this,
    please see KB 41ODPHX1 
    for an example of how to program in parallel. If you do not wire the ‘stop’
    terminal of the express VI’s, you will get the error described.
    David L.
    Systems Engineering
    National Instruments
    Attachments:
    ELVIS Express VI's (LabVIEW).JPG ‏74 KB
    NI ELVIS soft front panels.JPG ‏56 KB

  • C++: Is it possible using callback function with ncacn_http and rpcproxy server ?

    I have a remote procedure and I can call it using http over rpc. I pass trough an rpc proxy server for arriving to my rpc server.
    But I cannot call a callback function to my client inside the server function.
    Is it possible using callback function with ncacn_http and rpcproxy server ?
    We are using IIS on windows server 2008 R2 and the server rpc and the client on the same PC with rpc rpoxy.
    If I use ncan_ip_tcp all works fine.
    Thanks
    Gianluca

    Hi,
    About the develop question please post to the MSDN forum.
    MSDN forum Developer Network
    http://social.msdn.microsoft.com/Forums/en-US/home?forum=WAVirtualMachinesVirtualNetwork&filter=alltypes&sort=lastpostdesc
    Thanks for your understanding and support.
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • Is it possible using Analytical functions?

    Hi,
       I have the following data
        Column1      Column2
        2005            500
        2006            500
        2007            500
        2008            500
    Now, if I've some variable value as 800, then the output record should be
        Column1         Column2
        2008               500
        2007               300
        2006                  0
        2005                  0i.e. the Column2 value(order by column1 desc) is split to accommodate the variable passed.
    Right now, it's being done in PL/SQL. Is it possible to do it in SQL using Analytical function?
    Thanks,
    Sundar
    P.S: It doesnt have to be using analytical, if it can be achieved in a SQL, it's good.
    Message was edited by:
    Sundar M

    Hi, a sample using analytical function SUM:
    CREATE TABLE Source_Data
               ( Year NUMBER
               , Value NUMBER
    BEGIN
       DELETE FROM Source_Data;
       FOR v_Cycle IN 1 .. 6
       LOOP
          INSERT
            INTO Source_Data
                 Year
               , Value
          VALUES
                 2000 + v_Cycle
               , 100 * v_Cycle
       END LOOP;
       COMMIT;
    END;
    VARIABLE v_Amount NUMBER
    EXECUTE :v_Amount := 1200using the SUM, the previous values are totalized:
    so
    SELECT Year
         , Value Year_Value
         , :v_Amount Original_Amount
         , SUM(Value) OVER (ORDER BY Year DESC RANGE UNBOUNDED PRECEDING) Cumulative_Sum
         , DECODE(
                   SIGN(:v_Amount - SUM(Value) OVER (ORDER BY Year DESC RANGE UNBOUNDED PRECEDING))
                   , 1, Value              -- Positive number, more value can be subtract
                   , GREATEST(Value - (SUM(Value) OVER (ORDER BY Year DESC RANGE UNBOUNDED PRECEDING) - :v_Amount), 0)
                 )         Year_Quota
      FROM Source_Data s
    ORDER BY Year DESC
    /will give
         YEAR YEAR_VALUE ORIGINAL_AMOUNT CUMULATIVE_SUM YEAR_QUOTA
         2006        600            1200            600        600
         2005        500            1200           1100        500
         2004        400            1200           1500        100
         2003        300            1200           1800          0
         2002        200            1200           2000          0
         2001        100            1200           2100          0You can add different conditions (PARTITION BY ..)
    Hope this helps
    Max

  • I use photoshop 6 (mac) if I subscribe to Premier CC do I have to subscribe to Photoshop CC also I want to use 6 as long as possible to avoid the subscriptions fees

    I use photoshop 6 (mac) if I subscribe to Premier CC do I have to subscribe to Photoshop CC also I want to use 6 as long as possible to avoid the subscriptions fees

    Completely separate products, so nothing to fear.
    Mylenium

  • Use of functions in static block

    Hello,
    I have this app containing a static {} block. The reason it's there is to 1) provide a splash screen 2) have input dialog to process input string and check if it's valid in order to load app or not.
    In pseudocode it's like this:
    1 - get input string with showInputDialog()
    2 - check for the input string validity (a valid string is with prefix A-, C- or S-)
    3 - if string is valid, load the app
    4 - if string is not valid, proceed to step 1.
    As you may already see, there is going to be a lot of code (with if-else statements) to check for A-, C- and S- prefixed because I am using indexOf() function which takes only one parameter.
    I am considering a way to somehow check recursively, but for this I think I'll need a function to call indexOf() with A-, C-, S- and assess validity for each case.
    My question is, is there a way in the static block to have a function? Or can somebody please recommend an efficient approach to checking a string validity with different possibilities inside a static block as in my case, to avoid lots of if-else statements?
    P.S. My apologies for initially posting this thread in wrong section.
    Thank you!
    Victor.

    DrClap wrote:
    What's a function? And why are you particularly concerned about doing those things in a static initializer as opposed to in some other place?Hi,
    Sorry, I'm still thinking c++. I meant method. Something like of the form:
    static
    boolean valid = false;
    while string is not valid
    stringfrominput = showInputDialog();   
    //determine if string is valid
    valid = checkvalid(stringfrominput)
    //if possible to have
    boolean checkvalid(stringfrominput)
    recursively process stringfrom input based on A-, S-, or C- prefixes
    return boolean value
    }I have a jar app. It is Windows-based and runs as a TrayIcon application. If I include this process when class is loaded, this means that the app will be loaded with all its features. But I need to make sure that the app's features will be loaded only if certain conditions are met.
    I am not sure how else to approach this requirement without using static {} block.
    Thank you,
    Victor.

  • PL/SQL Anonymous Block - Trying to Call Function within Cursor

    Hello -
    I need to create an anonymous block that contains a cursor and a function. I want to call the function from within the cursor, and the function will basically take an ID as its IN parameter, and will return a comma separated list of values.
    However, when I try to do this I get the error " function 'GET_PAYMENT_DATES' may not be used in SQL".
    Does anyone know of a workaround? I'm trying to avoid having to store this function.
    Thanks,
    Christine

    Exploring Keith's suggestion of using the function code inline in your SQL:
    test@ORA10G>
    test@ORA10G> --
    test@ORA10G> drop table t;
    Table dropped.
    test@ORA10G> drop table monetary_trans;
    Table dropped.
    test@ORA10G>
    test@ORA10G> create table monetary_trans as
      2  select 1 household_id, trunc(sysdate)-10 received_date from dual union all
      3  select 1, trunc(sysdate)-9 from dual union all
      4  select 1, trunc(sysdate)-8 from dual union all
      5  select 2, trunc(sysdate)-7 from dual union all
      6  select 2, trunc(sysdate)-6 from dual;
    Table created.
    test@ORA10G>
    test@ORA10G> create table t as
      2  select rownum x, rownum*10 y from dual connect by level <= 4;
    Table created.
    test@ORA10G>
    test@ORA10G> --
    test@ORA10G> select * from monetary_trans;
    HOUSEHOLD_ID RECEIVED_
               1 28-DEC-08
               1 29-DEC-08
               1 30-DEC-08
               2 31-DEC-08
               2 01-JAN-09
    test@ORA10G> select * from t;
             X          Y
             1         10
             2         20
             3         30
             4         40
    test@ORA10G>
    test@ORA10G> --
    test@ORA10G> -- the function code could be rewritten as follows
    test@ORA10G> --
    test@ORA10G> select household_id,
      2         ltrim(sys_connect_by_path(rd,','),',') payment_dates
      3    from
      4  (
      5  select household_id,
      6         to_char(received_date,'mm/dd/yy') as rd,
      7         row_number() over (partition by household_id order by 1) rn,
      8         count(*) over (partition by household_id) cnt
      9    from monetary_trans
    10    -- and the constraints here in the where clause
    11  )
    12  where level = cnt
    13  start with rn = 1
    14  connect by prior household_id = household_id
    15  and prior rn = rn - 1
    16  and household_id = 1 -- <== this is the input parameter value
    17  ;
    HOUSEHOLD_ID PAYMENT_DATES
               1 12/28/08,12/29/08,12/30/08
    test@ORA10G>
    test@ORA10G> --
    test@ORA10G> -- and can be used as an inline view when joined with other tables
    test@ORA10G> --
    test@ORA10G> select t.y,
      2         fn.payment_dates
      3    from t,
      4         (select household_id,
      5                 ltrim(sys_connect_by_path(rd,','),',') payment_dates
      6          from (select household_id,
      7                       to_char(received_date,'mm/dd/yy') as rd,
      8                       row_number() over (partition by household_id order by 1) rn,
      9                       count(*) over (partition by household_id) cnt
    10                  from monetary_trans)
    11          where level = cnt
    12          start with rn = 1
    13          connect by prior household_id = household_id
    14          and prior rn = rn - 1
    15         ) fn
    16   where t.x = fn.household_id
    17  ;
             Y PAYMENT_DATES
            10 12/28/08,12/29/08,12/30/08
            20 12/31/08,01/01/09
    test@ORA10G>
    test@ORA10G>HTH
    isotope

  • Sending mails to UWL using SO_NEW_DOCUMENT_ATT_SEND_API1 function module

    Hi all,
    is it possible to view mails send using SO_NEW_DOCUMENT_ATT_SEND_API1 function module to UWL?
    I am receving emails in my SAP Inbox.
    Please guide.
    thanks.

    Hi,
    You can only get the SAP mails into UWL notification tab with the Sonic connector (well of course with some custom development everything is possible).
    One trick to get the workflow for sending "mails" to UWL is to NOT use email sending step, but instead use a decision step in the workflow and send this work item to the user. The decision step can include the same message as the email, and have onl one option "Confirm" (or whatever). These you can easily display in UWL since they are normal work items.
    Regards,
    Karri

  • When using TODATE function MDX query is not correctly generated

    Essbase 9.3.1.2 and OBIEE 10.1.3.4.1.
    When using TODATE function MDX query is not correctly generated.
    This leads to unexpected values not only on cumulative columns in report (generated with TODATE), but also other columns (calculated with AGO function or directly read from cube) have incorrect values.
    The problem occurs when you filter on a column that is not in the select list. If you filter on just one level of dimension, results are fine. You can filter on multiple dimensions as long as you filter on just one level of each dimension.
    If you filter on two or more levels of one dimension, than results are not correct. In some cases results for TODATE column are all zeros, in some cases it is a random value returned by Essbase (same random value for all rows of that column), and in some cases BI Server returns an error:
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. Essbase Error: Network error [10054]: Cannot Send Data (HY000).
    Here is generated MDX code:
    With
    set [Grupe proizvoda2] as '{[Grupe proizvoda].[N4]}'
    set [Grupe proizvoda4] as 'Generate([Grupe proizvoda2], Descendants([Grupe proizvoda].currentmember, [Grupe proizvoda].Generations(4), leaves))'
    set [Segmentacija2] as '{[Segmentacija].[RETAIL]}'
    set [Segmentacija4] as 'Filter(Generate({[Segmentacija2]}, Descendants([Segmentacija].currentmember, [Segmentacija].Generations(4),SELF), ALL), ([Segmentacija].CurrentMember IS [Segmentacija].[AFFLUENT]))'
    set [Vrijeme3] as '{[Vrijeme].[MJESEC_4_2009]}'
    member [Segmentacija].[SegmentacijaCustomGroup]as 'Sum([Segmentacija4])', SOLVE_ORDER = AGGREGATION_SOLVEORDER
    member [Accounts].[MS1] as '(ParallelPeriod([Vrijeme].[Gen3,Vrijeme],2,[Vrijeme].currentmember), [Accounts].[Trosak kapitala])'
    member [Accounts].[MS2] as '(ParallelPeriod([Vrijeme].[Gen3,Vrijeme],1,[Vrijeme].currentmember), [Accounts].[Trosak kapitala])'
    member [Accounts].[MS3] as 'AGGREGATE({PeriodsToDate([Vrijeme].[Gen2,Vrijeme],[Vrijeme].currentmember)}, [Accounts].[Trosak kapitala])'
    select
    { [Accounts].[Trosak kapitala],
    [Accounts].[MS1],
    [Accounts].[MS2],
    [Accounts].[MS3]
    } on columns,
    NON EMPTY {crossjoin ({[Grupe proizvoda4]},{[Vrijeme3]})} properties ANCESTOR_NAMES, GEN_NUMBER on rows
    from [NISE.NISE]
    where ([Segmentacija].[SegmentacijaCustomGroup])
    If you remove part with TODATE function, the results are fine. If you leave TODATE function, OBIEE returns an error mentioned above. If you manually modify variable SOLVE_ORDER and set value to, for example, 100 instead of AGGREGATION_SOLVEORDER, results are OK.
    In all cases when this variable was modified in generated MDX, and query manually executed on Essabse, results were OK. This variable seems to be the possible problem.

    Hi,
    Version is
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi
    PL/SQL Release 10.2.0.5.0 - Production
    CORE    10.2.0.5.0      Production
    TNS for 64-bit Windows: Version 10.2.0.5.0 - Production
    NLSRTL Version 10.2.0.5.0 - Production
    Sorry, in my last post i forgot to mention that i already created a function based index but still it is not using because, there is a UNIQUE constraint on that column.
    Thanks

  • How to EDIT a particular Row in ALV using normal function module Reuse_alv_grid_display

    Hi experts..
    i got one requirement like i need to edit some rows particularly in alv....
    Edit in alv output....is it possible to get  that .....using normal function module with out using oops concept...
    could any one pls help me...

    Hi Pendurti ,
    If you want a particular field to be editable , simply define the fieldcatalog as
    wa_fieldcatalog-edit          = 'X'.
    wa_fieldcatalog-input         = 'X'.
    for that field.
    and
    Now when you use FM ' Reuse alv grid display '
    define USER_COMMAND
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program       = v_repid
          i_callback_pf_status_set = 'SET_PF_STATUS'
          i_callback_user_command  = 'USER_COMMAND'
          it_fieldcat              = int_fieldcatalog
          is_layout                = wa_layout
        TABLES
          t_outtab                 = t_disp.
    and now in form USER_COMMAND ; code as per following
    FORM user_command  USING r_ucomm LIKE sy-ucomm
                                rs_selfield TYPE slis_selfield.
         DATA ref1 TYPE REF TO cl_gui_alv_grid.
         CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
           IMPORTING
             e_grid = ref1.
         CALL METHOD ref1->check_changed_data.
    endform.
    Regards,
    Yogendra Bhaskar

Maybe you are looking for