Reference in function?

Hi,
I just was trying to do something simple I thought:
_global.setIfEmpty = function(vari,val){
if (vari==undefined) vari = val;
// variable background should set to the value if it is
undefined
setIfEmpty(background, "background.jpg");
This does not seem to work. So I thought I might use a
prototype to set
the variable but can I set a prototype to undefined type?
Or (/and) is there a way to use a variable in a function as
reference?
TIA

DazFaz wrote:
> "Bingo"
>
> var setIfEmpty:Object = new Object();
> setIfEmpty.MyFunction = function(vari,val) {
> if (vari == undefined) {
> vari = val;
> trace(vari)
> }
> };
> setIfEmpty.MyFunction(background, "background.jpg");
Ok, I think I better use the common syntax without a
function.
if (!background) background = "background.jpg";

Similar Messages

  • Reference Document Functionality - Complaints

    Hi
    I am working in CRM 4.0
    We want the reference document functionality in PCUI when creating complaints.
    When we create complaints directly it gives a warning in PCUI "You have not specified a Reference document"
    Is there any standard way to go about it.
    What we have thought is that we will add a field in header section which will have the R/3 invoice number.(we have done this part)
    Throught this R/3 invoice number we have built a function module than can retrieve the product info for this invoice number(this has also bee done)
    How do i populate the product info in item level tab in complaints (header level and item level are in different class).
    Secondly how do i add the copy button functionality where i can chosse one or more of existing products in the created invoice.
    Am i  following the correct approach or is their an easier way to go about it.
    Regards
    Asad

    Hi,
    You can do it in  IMG configuration---MM>Logistics Invoice Verification>Incoming Invoice>Number Assignment>Maintain Number Assignments for Accounting Documents>Document type>Select the document type your using for MIRO>Click on detail>Check Reference number Or   you can use t code  OBA7.
    Hope this helps.
    Thanks
    Kiran
    P.S   Pls award points if the answer is helpful.

  • How to reference JavaScript functions stored in a script object on a different page?

    Hi,
    I have a form which has 2 pages. I have a bunch of JavaScript functions under script objects on page 1. How can I access these functions from page 2?
    I tried the following but none of it work:
    form1.page2.#variables[0].testScript.doThisNow();
    form1.page2.variables[0].testScript.doThisNow();
    form1.page2.variables.testScript.doThisNow();
    Please help.

    Hi,
    Simplest way would be to drag the script object to be under the root node (form1). On both pages would would then be able to reference the function by:
    testScript.doThisNow();
    If you leave the script object under page1, then from page2, the following should work:
    page1.testScript.doThisNow();
    Hope that helps,
    Niall

  • Reference a function in a different schema over a database link?

    I have a database link, DBL, that connects with user GENE/***. I want to select columns from table BOOKS in schema JOE using function UNIFIX, which is defined in schema BRAD. Can I do it?
    I can select without the function:
    SELECT TITLE
    FROM JOE.BOOKS@DBL;
    I tried this syntax:
    SELECT BRAD.UNIFIX(TITLE)
    FROM JOE.BOOKS@DBL;
    But Oracle gives me a ORA-00904. Is there any syntax that will allow me to reference the function in the linked database? Or do I need to define a view in the remote DB that includes the function?

    SELECT brad.unfix@dbl( title )
      FROM joe.books@dblshould work. Assuming, of course, that the Gene user on the remote system has access both the the BOOKS table in the JOE schema and to the UNFIX function in the BRAD schema.
    Justin

  • Wanna send integer value by reference in function

    I wanna send integer value by reference thro' function. Here's the code going.
    class test
    basic b = new basic();
    test()
    test2.Fuction(b.value);
    class basic
    int value;
    basic(){}
    //////here i want value to be affected by Function.I don't want it affected by value, but by reference.
    class test2
    public static void Function(int value)
    value++;

    If you want to update the value in your b object, then you have to pass the reference of that object to test2.Function(..). Here is one way to do it:
    class test {
      basic b = new basic();
      test() {
        test2.Function(b);
    class test2 {
      public static void Function(basic b) {
        b.value++;
    }It's a good idea to follow the java naming convention. Classes should begin with an upper case letter. Methods and variable names with a lover case letter (but final static variables with all upper case letters).

  • Parameter passing by value or by reference in function module

    hi everybody:
    Im a beginner for abap.
    Below description is described in online help.
    In function module, the CALL FUNCTION statement can pass import, export, and changing parameters either by value or by reference. Table parameters are always transferred by reference.
    I understand parameters passing by value means values carried by parameters are transferred, but I do not understand what is "by reference".
    Please kindly give me a explanation.
    Regards.
    Andy

    hi,
    Function modules are modular units with interfaces. The interface can contain the following elements:
    Import parameters are parameters passed to the function module. In general, these are assigned
    standard ABAP Dictionary types. Import parameters can also be characterized as optional.
    Export parameters are passed from the function module to the calling program. Export parameters
    are always optional and for that reason do not need to be accepted by the calling program.
    Changing parameters are passed to the function module and can be changed by it. The result is
    returned to the calling program after the function module has executed.
    Exceptions are used to intercept errors. If an error triggers an exception in a function module, the
    function module stops. You can assign exceptions to numbers in the calling program, which sets the
    system field SY-SUBRC to that value. This return code can then be handled by the program.
    By reference Passes a pointer to the original memory location.  Very efficient
    By value Allocates a new memory location for use within the subroutine. The memory is freed when the subroutine ends.  Prevents changes to passed variable
    By value and result Similar to pass by value, but the contents of the new memory is copied back into the original memory before returning.  Allows changes and allows a rollback
    When you pass a parameter by reference, new memory is not allocated for the value. Instead, a pointer to the original memory location is passed. All references to the parameter are references to the original memory location. Changes to the variable within the subroutine update the original memory location immediately.
    1  report ztx1804.
    2  data f1 value 'A'.
    3
    4  perform s1 using f1.
    5  write / f1.
    6
    7  form s1 using p1.
    8      p1 = 'X'.
    9      endform.
    The code in Listing produces the following output:
    X
    Hope this helps, Do reward.

  • VI loaded with either Invoke Node or Call by Reference only functions properly when it is already open

    I have modified the Dynamic Loading example so that my case for the first button loads three VIs in succession, rather than one.  The first VI generates a waveform, the second uses this waveform to calibrate the measurement, and the last VI stops the waveform generation.  I discovered that the middle Calibrate.vi would only function properly if the Calibrate.vi was already open.  I attempted the VI loading of the Calibrate.vi with both the Call by Reference (identical to the example) and the Invoke Node method.  In both cases, the first and last VIs (Multitone Gen.vi and Stop Gen.vi) functioned properly, but the Calibrate.vi only worked correctly when it was already open.
    I have tried resetting the NI USB DAQ device and that hasn't helped.
    My search for answers has come up empty and I am hoping that someone in the forum might be of assistance.  I have attached a snapshot of each version of my code, both built off of the Dynamic Loading example.
    Thanks!!
    Attachments:
    Call by Reference.png ‏19 KB
    Invoked Node.png ‏21 KB

    Hello Anjelica,
    I do not receive any error messages when the middle VI is loaded and run.
    The Calibrate.vi acquires three separate corrections (Open, Short, Load), averaging results from a  number (N) of measurements, determined by the user.  When the VI is loaded and run correctly, information describing the multitone waveform generated by the first VI is first acquired.  Then the user selects each correction individually.  The corrections are made and averaged after N corrections, taking approximately 10 seconds per N.
    When the Calibrate.vi is malfunctioning, the multitone waveform information is not loaded and when a correction is selected, the indicator displaying the number of measurements performed (n of N where n = 0 to N) instantaneously displays N of N.  The correction measurements are not performed.  I have even tried using the Front Panelpen method and then running the middle VI and this results in the same malfunction unless the Calibrate.vi is already open.
    Though it is an obvious workaround, I can live with opening the Calibrate.vi via the Open VI Reference method outside of the while loop. This will be my solution for now.
    Thank you for your response.
    Attachments:
    Open Outside Loop.png ‏23 KB

  • Is possible pass class reference into function by reference ?

    Hello, here is one example.
    class MyClass
    public int i;
    public static void Change(MyClass param1, MyClass param2)
    MyClass temp;
    temp = param1;
    param1 = param2;
    param2 = temp;
    public static void main(String[] args)
    MyClass param1 = new Main();
    param1.i = 100;
    MyClass param2 = new Main();
    param2.i = 200;
    Change(param1,param2);
    System.out.println(param1.i);
         System.out.println(param2.i);
    Is clear the result will be :
    100
    200
    Well, is possible in java pass into function object reference by reference? (for example in C# exist keyword ref, which solve this problem.) Other question is if this is something what is really needed in daily programming life, but I'm curious.
    Thanks for response

    iaragorn wrote:
    Well, is possible in java pass into function object reference by reference? No. Java only passes by value.
    Other question is if this is something what is really needed in daily programming lifeNope. Java has done just fine without pass by reference for about 12 or 14 years now.

  • The mouse pointer seems to change randomly from the usual pointer to the I-beam pointer, finger pointer, column resize pointer, arrow up pointer, etc. without any reference to function.

    I actually don't care other than the fact that it isn't the way it should operate and everything else seems to behave. However, the I-beam pointer is hard to see and can disappear. It seems to happen mostly in Safari and then carry over to other applications. Anyone else see this happen?

    The program you gave me was great, so simple, yet so effective....yet I still have a problem.  The problem is that my interface has a giant TAB inside with lots controls.  So I need it to be an arrow when it is in the tab but not on the other controls.   I tried manipulating you program and used an if condition inside the event case that if the control reference of the event case is the same as the control reference of the tab then remain an arrow.  That works for other controls outside the tab and and the tab itself but it doesn't work with controls inside the tab...... I have attached your vi, just changed a little to see what i am saying.  I am pretty sure there must be a way around it so i am trying it out now, but if you know something already that might help, that'll be great
    Reza Sed
    Attachments:
    Default Cursor_modified.vi ‏38 KB

  • Reference functions inside un untitled script object

    Hello,
    Does someone knows how to reference a function inside an untitled script object?
    thank you

    xfa.resolveNode("#script").functionName()
    You should always name your scriptObjects ...it makes accessing them much easier.
    Paul

  • MultiProvider report not functioning - overwriting protected field

    Hello,
    I have a multiprovider that combines data from the Sales Overview cube (0SD_C03) with a custom plan cube (data from COPA and SIS).  In writing queries off of the (active) multiprovider, short dumps occur except when only running against one infoprovider.  In other words, if the query is restricted to only show Sales data (0SD_C03), it works fine.  If the query is restricted to only show Plan data (custom plan cube), then it works fine.  However, the intersection of the two does not work - which is the entire functionality of the multiprovider (a join). 
    I've cut the query back to the very basics:  Fiscal Year and one Key Figure (that is present in both source infocubes).   Without specifying or splitting out the InfoProviders, it should combine the data (total the two), but instead creates a short dump.  Using a structure to split Actuals from Plan also results the short dump.  The only way to get the report to actually execute and return is to restrict it to just one InfoProvider.  I tried copying the MultiProvider and starting over, but that did not improve the situation.  The failure occurs after the variable screen has been filled in.  (Also tried w/out variables.)
    Using LISTCUBE, the data is found in a single execution (no filter applied to 0INFOPROV) and splits out to the two infoproviders w/ approp. fiscal year and Key Figure totals.  So there seems to be something at the reporting layer malfunctioning.
    Here's the ST22 short dump:
    Does anyone have any ideas?
    Runtime Error          MOVE_TO_LIT_NOTALLOWED_NODATA                                         
    Date and Time          07/17/2006 09:57:23                                                   
    ShrtText                                                                               
    Assignment error: Overwriting a protected field.                                        
    What happened?                                                                               
    Error in ABAP application program.                                                                               
    The current ABAP program "SAPLRSDRC" had to be terminated because one of the            
    statements could not be executed.                                                       
    This is probably due to an error in the ABAP program.
    rror analysis                                                                               
    The program tried to assign a new value to the field "<L_SX_OLAPQUERY>" even though it is protected against changes.                                                                               
    The following objects are protected:                                                       
       - Character or numeric literals                                                            
       - Constants (CONSTANTS)                                                                    
       - Parameters of the category IMPORTING REFERENCE for functions                             
         and methods                                                                               
    - Untyped field symbols to which a field has not yet been assigned                         
         using ASSIGN                                                                               
    - TABLES parameters if the corresponding actual parameter is protected                     
         against changes                                                                          
       - USING reference parameters and CHANGING parameters for FORMs if                          
         the actual parameter for this is protected against changes                               
       - Field symbols if the field assigned using ASSIGN or ASSIGNING                            
         is protected against changes                                                             
       - External write accesses to READ-ONLY attributes                                          
       - Key components of lines in internal tables of the type HASHED or                         
         SORTED TABLE                                                                               
    SORTED TABLE.    
    Message received in web report when failure occurs:
    Error when processing your request 
    Note
    The following error text was processed in the system BW1 : Assignment error: Overwriting a protected field.
    The error occurred on the application server bw_BW1_00 and in the work process 0 .
    The termination type was: RABAX_STATE
    The ABAP call stack was:
    Function: RSDRC_CUBE_DATA_GET_DISP of program SAPLRSDRC
    Function: RSDRC_MULTI_CUBE_DATA_GET_PARA of program SAPLRSDRC
    Function: RSDRC_MULTI_CUBE_DATA_GET of program SAPLRSDRC
    Form: DATA_GET of program SAPLRSDRC
    Function: RSDRC_CUBE_DATA_GET of program SAPLRSDRC
    Function: RSDRC_CUBE_DATA_GET_OLAP of program SAPLRSDRC
    Form: FILL_SP_1 of program SAPSRRK0
    Form: FILL_SP of program GP42GWU130B57UDR97PLRZOUC5Z
    Form: DATEN_LESEN of program SAPLRRK0
    Function: RRK_LIST_NOTIFY of program SAPLRRK0
    Thanks in advance!

    Hello
    Check OSS notes as below am not sure if it helps
    957439 - Query dumps with an error
    Below is for 3.5 and below ,just to let you know that there were similar problems in earlier version.
    941862 - *** Dump MOVE_TO_LIT_NOTALLOWED_NODATA with MultiProvider
    Chetan
    @CP..

  • Cross reference or hyperlinking not working for InDesign CS5 Book to ePub

    I cannot get hyperlinks or cross reference links to work when generating an ePub from InDesign CS5. (7.0.0.355, Mac OS 10.6.2)
    Here's how to recreate a simple test demonstrating the issue.
    1. Create a new InDesign Book (File -> New -> Book)
    2. Create document one (File -> New -> Document)
    3. Create a text box and type "Table of Contents"
    4. Create document two (File -> New -> Document)
    5. Create a text box in it and type "Story One"
    6. Create a new paragraph style and assign it to the Story One text
    7. Save document 2. I just kept the name Untitled-2.xhtml
    8. Back in document 1, add a cross-reference and select document 2, the style you created, and then "Story One". "Story One" should now appear under the previously typed Table of Contents text, and when highlighed, should show it is an active cross reference in the Hyperlinks panel.
    9. Save document 1. I just kept the name Untitled-1.xhtml
    10. Add both documents to the Book and save the book.
    11. From the Book panel, select Export Book to EPUB...
    12. Save the epub file and open it in Adobe Digital Editions.
    Note that the text "Story One" appears as a hyperlink but when clicked does not switch to the document 2. It does nothing apparent when clicked.
    Looking at the XHTML source for the first document, it is immediately evident why. The filename for document 2.thml is missing.  It looks like this: <a href="#anchor-anchor">
    When it should be : <a href="Untitled-2.xhtml#anchor-anchor">
    The same thing works if you create a hyperlink instead of a cross reference.
    I note then when I use the option to go to the destinate reference in the Cross Link (hyperlink) panel, it does switch to the second InDesign docuemtn. So the cross reference is functioning (in InDesign). But the link is broken in the ePub for the above mentioned reason.
    Bug? Something I'm overlooking?
    Entire source of Untitled-1.xhtml:
    <?xml version="1.0" encoding="utf-8"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>Untitled-1.xhtml</title>
    <link href="template.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    <div id="untitled-1">
    <div class="generated-style">
    <p class="basic-paragraph" xml:lang='en-us'><span class="no-style-override">Table of Contents</span></p>
    <p class="basic-paragraph" xml:lang='en-us'><span class="no-style-override"><a href="#anchor-anchor">“story one”</a></span></p>
    </div>
    </div>
    </body>
    </html>

    As far as I can tell, it has NOT yet been fixed in CS5.5.  I'm having the same problem.  I have about 90 hyperlinks to fix.
    And the explanation that Teus Dejong gives indicates it's not going to be that helpful:  "we have found that only the links in documents split by the CS5 exporter will be fixed. For books the script does only work for references to earlier documents in the book, not for forward references. This means in practice that for most books the script will not repair the links and should be seen as a means to add the year only. At the moment I see no way to repair this, because the book epub output of InDesign does not contain sufficient information to repair links referencing forward to others documents in a book."
    It's pretty discouraging.

  • Error 1003 occured at Open VI Reference

    This error occured when I want to used the LabView Report Generation Toolkit for Microsoft Office Example.
    It's impossible for me to execute the example "Generate Report from Template(Excel)"
    I suppose I have a problem with the Open VI Reference.vi function but I don't know where is that VI.
    Could you let me know where are the VIs listed in the Application Control Pallette.
    Do you know why I have this type of problem.
    Thanks
    Lucie

    The VIs located on the application control palette are primitives and are part of LabVIEW itself. Therefore you can not look at their diagrams because they don't have one.
    However the 1003 error means that you are trying to dynamically load a VI that is not executable. I would suggest turning highlight execution on and following the code to see what path is sent into the Open VI reference function.
    Once you have the VI that is failing to open go manually open it.
    Chances are that it is broken, so see why it is broken. If I remember correctly there is a linking issue in that example, so you can open the VI that is broken and hit ctrl-shift-Run Button, and that should relink it all and fix the issue.
    If not take a look at this
    Why Do I Get Error 1003 From Application Builder When I Try to Build Excel Macro Example.VI?

  • Error 1004 occurred at Open VI Reference in Directory of Top Level VI.vi- Check Path.vi- Read PNG File.vi- ValveUI.xctl:LoadBackgroundImage.vi- ValveUI.xctl:Facade 1.vi:29- ValveUI.xctl:Facade 1.vi.ProxyCaller

    I am trying to dynamically load the background image of an XControl facade using a 'LoadBackgroundImage.vi' that I have written. This SubVI has worked with a normal VIs panel before. It utilizes the 'Read PNG File.vi' from Labview to read in a transparent PNG file to overwrite the Facade background. When the XControl is loaded during design-time it generates an Error 1004 indicating that the 'Read PNG File.vi' is not in memory. I have tried to place a static reference to this vi to force it to load but I still get this error. What is the solution?
    Attachments:
    Error Dialog.PNG ‏9 KB
    LoadBackgroundImage_VI.PNG ‏33 KB

    Darin, thanks for your reply.
    The XControl Facade is rendered on the Main FP when the Main.vi is opened in design mode. Previously I have placed a PNG image onto the Facade pane (i.e. drag-n-drop the image onto the Facade FP during design) and it is displayed on the Main.vi FP in design mode when Main is loaded. However, when I include a call to Read PNG File.vi in the Facade I get the 1004 error. You may not see this error without using a Simple Error Dialog. This failure to find Read PNG File.vi in memory is the main issue.
    I have tried to use SubPanels before - they are useless for my purposes for many reasons (they don't show the underlying SubVI pane in design mode, they require the use of SubVI references to load - preventing the use of direct wiring to the SubVI connector, etc.).
    Do you know how to dynamically load and call 'Read PNG File.vi' so that Labview is forced to load the VI and then Read PNG File can load the PNG image? I can get 'Read PNG File.vi' to dynamically load and show property values but to call it with the 'Call By Reference Node Function' I need a strict type def to be generated, etc. So what are the steps needed to create a dynamic call to 'Read PNG File.vi'? I haven't seen any good working examples that show how to create the strict typedefs that are required etc. There is no right-click > Make Type Def > ...  for Read PNG File.vi or other ways to do this that I have noticed. Showing a finished example doesn't show you how to do it (menu selections, etc.). Or, do I have to hand construct these typedefs by reverse engineering the VI?

  • I'm getting a "The procedure entrypoint ssSr192x__​ssSr192drv​ssSrReset could no be located in the dynamic link library ssSR192x.d​ll" because the ActiveX instrument driver DLL doesn't have the function names in the export table.

    Is there a way for my CVI project to reference the functions in the ActiveX without including the instrument .fp in the project?
    Thanks much.
    I'm confused on how CVI uses ActiveX components and hope someone can help.
    I'm using an ActiveX driver from an instrument manufacturer and I use the .TLB to generate a .fp, .c, and .h file. If I register the .dll and load the .fp in my project, all is well. Unfortunately in my application the functions to control this instrument are in another DLL whose .lib I include in my CVI projec
    t. Running the CVI project this way gives me "The procedure entrypoint ssSr192x__ssSr192drvssSrReset could no be located in the dynamic link library ssSR192x.dll" because the instrument function names aren't in the export table in the instrument DLL. Non-ActiveX DLLs have the export tables so everything works for them.
    Program structure with non-ActiveX DLLs:
    CVI project (.exe with common.lib in project list)
    |
    V
    Common DLL (MeasDMM() with hp1234.lib in project list)
    |
    V
    Instrument DLL (hp1234_measure())
    Since I get a .c and .h file from the .TLB, I've tried recompiling the DLL (.dll and .lib produced) and the functions seem to work, but I get "Class not registered" errors unless I play games with the registry so I'm obviously violating numerous Microsoft rules!
    Is there a way for my CVI project to reference the functions in the ActiveX without including the instrument .fp in the project? Thanks much.
    Jeff Fish
    Advisory Test Engineer
    StorageTek

    Hello Jeff,
    Where were your getting the .lib file for the ActiveX DLL? Did you use the "hp1234"
    ActiveX driver generated by the "Create ActiveX Automation Controller" CVI Tool to build a static library? If you open an include file and choose Options >> Generate DLL..., it will generate source code or a static import library to load the specified DLL and load functions specified in the include file (this only works if the functions are exported from a DLL). However, in the case of our ActiveX Automation Controllers, ActiveX calls are used to access a DLL. This means that you do not need an import library. You should be able to open the "hp1234" source file and click Options >> Create Object File. Simply #include "hp1234.h" and add "hp1234.obj" to your Common DLL project;
    the .fp file is not necessary. If this does not answer your questions or if you experience further difficulty, please post further details on what you are doing and the errors that are being encountered ("play games with the registry" and "recompiling 'the' DLL" are a bit vague in this case).
    Jeremiah
    Applications Engineer
    National Instruments
    http://www.ni.com/ask

Maybe you are looking for

  • Changing Filter Values from Macro in BW 7.0

    Hello, in my Workbook I need to change Filter Values of some queries in runtime. The first thing I found was BEx API reference for BW 3.5, but I wasn't able to make these functions work. After all I found this code:     Dim BEx As Object     Set BEx

  • My iPad is disabled and I am unable to get it to work. How can I fix this?

    My iPad is disabled and I can't figure out out to get it fixed. The original Apple ID that was set up on the iPad is no longer active and I'm not sure if I ever changed it. Can anyone help me???

  • HT5312 How can I get a rescue email sent?

    I am trying to access my answers to my security questions by trying to send a rescue email. However, the option to send one is not available. What do I do to access my answers??

  • Driver Vista for zen mi

    Excused I I am one of that he has installed and bought Seen Windows in order to improve my PC, but unfortunately instead improving are found again to me with my Micro unusable Zen that is x do not succeed to find i driver to make to work it. I would

  • Can I use the SX20 remote with an SX80?

    SX80 has front panel LED labelled IR. Does it support the hand-held IR remote control that ships with the SX20?