Getting NaN for Variable

I put the following actionscript into the first frame labeled “actions”:
_global.iCount:Number = 0;
I then attached this script to a button, in the second frame:
on (release) {
                iCount = iCount + 1;
                gotoAndStop(_currentframe+1);
The debugger gives no value for “iCount” on the frame script, and yields a “NaN” value for iCount after the button is released.  At first it worked, now it doesn’t.  Thanks, in advance, for your help, Taylor

Generally with _global variables you must use _global when assigning them and can omit it when accessing them. But in practice it is just better to always use the _global so that you know it is global and not a local variable. So I think
_global.iCount++
would probably be the best bet.
I would also recommend that you stop using on(event) handlers. Unless you are target Flash 5 publish it is outdated and makes it harder for folks to help you. Also if you ever want to move to AS3 you won't be able to use them because they have been removed. Here is a great article about the issue:
http://www.quip.net/blog/2006/flash/museum-pieces-on-and-onclipevent

Similar Messages

  • Customer Exit Variable in formula to get values for multiple keyfigures

    Hi to all,
    I have query as defined in following scenario:
    CHAR_X     C_KF1 (based on KF1)     C_KF2 (based on KF2)     u2026     C_KFn (based on KFn)
    Value1                    
    Value2                    
    u2026                    
    Valuem                    
    C_KF = calculated key figure
    I need to create a customer exit variable that will search through selection e.g. CHAR_X/KF1 and give some result. I need this variable for every keyfigure (KF1-KFn). Using customer exit variable is the only solution.
    My question is: do I have to create formula variable (customer exit) representing every keyfigure separately (VAR1 u2013 VARn, like in below example)?
    CHAR_X     C_KF1 (using VAR1)     C_KF2 (using VAR2)     u2026     C_KFn (using VARn)
    Value1                    
    Value2                    
    u2026                    
    Valuem                    
    Or is it possible to create one general formula variable since the way to retrieve the value in variable is always the same (like in below example)? In this case, how do I pass the value of the respective keyfigure to this variable?
    CHAR_X     C_KF1 (using VAR_X)     C_KF2 (using VAR_X)     u2026     C_KFn (using VAR_X)
    Value1                    
    Value2                    
    u2026                    
    Valuem                    
    Thanks for your replies, points will be awarded!
    Cheers

    That is my concern, the value of variable is not the same.
    What variable should do is:
    take KF1 id, go through values for CHAR_X, get back one value
    This value would always be different, and also "KF" part in code of variable should be different, based on the column where the variable is being used (so, in column C_KF1 ,variable should "pick up" id of KF1, etc.).
    I hope it makes it more clear. For now, I do not have the code for variable yet, I am just interested in concept whether it is possible to pass the ID of keyfigure dynamically so I can make decision how to model this request.
    Thanks

  • Getting error for bind variables

    Hello Experts ;
    SQL> DECLARE
      2  l_eid  number;
      3  l_name  varchar2(30);
      4  BEGIN
      5  l_eid:=1000;
      6  select name into l_name from tab1 where no = l_eid;
      7  l_eid:=9999;
      8  select name into l_name from tab1 where no = l_eid;
      9  l_eid:=299999;
    10  select name into l_name from tab1 where no = l_eid;
    11* END;
    PL/SQL procedure successfully completed.
    when  creating bind variables  i am getting error :
    SQL> variable b1 number;
    SQL> exec :b1 :='select name from tab1 where no = :b1';
    BEGIN :b1 :='select name from tab1 where no = :b1'; END;
    * ERROR at line 1:
    ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    ORA-06512: at line 1

    @ SY
    SolomonYakobson wrote:
    You need to explain "method not workable for me". I have no idea what method you are talking about and what are you trying to achieve.
    SY.
    SQL>DECLARE
        v_value  number;
        v_dispaly varchar2(30);
        BEGIN
       v_value :=100000;
        select name into v_display from tab1 where no = :v_value;
        DBMS_OUTPUT.PUT_LINE(v_display);
        v_value :=20000;
        select name into v_display from tab1 where no = :v_value;
        DBMS_OUTPUT.PUT_LINE(v_display);
         v_value :=250000;
        select name into v_display from tab1 where no = :v_value;
        DBMS_OUTPUT.PUT_LINE(v_display);
      * END;
    RS>/
    PL/SQL procedure successfully completed.
    >>  This is not workable for me ,  Here getting error  >>
    SQL> DECLARE
      2  variable  b1  number;
      3  exec  :b1;
      4  BEGIN
      5  select  name  from  tab1  where no =: b1;
      6* END;
    RS>/
    variable b1 number;
    ERROR at line 2:
    ORA-06550: line 2, column 13:
    PLS-00103: Encountered the symbol "NUMBER" when expecting one of the following:
    := . ( @ % ; not null range default character
    Thanks !

  • SSIS Jobs:-getting issue The expression for variable failed evaluation.

    Hi ,
    I have one package where I am having single DFT.in source i am taking query from variable., and destination I am taking destination table from variable.
    i have created a package configuration, i have created a job.when I am running I am getting below error
    Code: 0xC0019004     Source: LoadArchive Using BIML  Description: The expression for variable "V_Archivequery" failed evaluation. There was an error in the expression. 
    this error is coming for all the variable which need to be changed at run time.
    below is the query which will chnage the value of the variable on run time.
    SELECT Archivequery,ArchiveTableName,BBxKeyDerExpr FROM Fabrication.dbo.FileMaster WITH (NOLOCK)
    WHERE SourceFileName = ?
    suggest me some good solution.
    Regards,
    Vipin jha
    Thankx & regards, Vipin jha MCP

    Hi Vipin jha,
    According to your description, you created one SSIS package with data flow task, you used variable with the expression SELECT Archivequery,ArchiveTableName,BBxKeyDerExpr FROM Fabrication.dbo.FileMaster WITH (NOLOCK) WHERE SourceFileName = ?, when you the
    package with sql agent job, you got the error message.
    I tried to reproduce the issue on my local machine, but it works fine for me. To troubleshoot the problem, please refer to the following steps:
    Make sure the variable can be found in the Variables collection.
    Objects in SSIS are case sensitive, please validate that the name of the variable is correct.
    If the problem remain unresolved, i would appreciate it if you could give us detailed information of error message, I would be appreciated it if you could provide sample data and screenshot of the package. It will help us move more quickly toward a solution.
    Thanks,
    Wendy Fu
    Wendy Fu
    TechNet Community Support

  • Getting input for atleast one variable present in the report

    Hi All,
    I want to create a report with the below requirement.
    If user didn't enter the value for any of the customer exit varaibles(ZCALDAY, ZCALMNTH and ZCALYEAR), then it should not allow user to generate the report. It should give a message or popup and return to the selection screen for getting the value for the input variable. Basically, it should get input for atleast one variable.
    Please help me in this issue.
    Regards,
    Yokesh Kumar.

    Hi All,
    I have written the below code for my requirement.
    when 'zcalday' or 'zcalmnth' or 'zcalyear'.
          DATA: LOC_VAR_RANGE LIKE RRRANGEEXIT,
                      count type i.
          IF I_STEP = 3.
            count = 0.
            LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE WHERE VNAM = 'zcalday' or VNAM = 'zcalmnth' or VNAM = 'zcalyear'.
              IF LOC_VAR_RANGE-LOW is initial.
                count = count + 1.
              ENDIF.
            ENDLOOP.
            if count EQ 3.
              CALL FUNCTION 'RRMS_MESSAGE_HANDLING'
                EXPORTING
                I_CLASS = 'RSBBS'
                I_TYPE = 'I'
                I_NUMBER = '000'
                I_MSGV1 = 'Please give inout for atleast one varialbe''.
                RAISE no_replacement.
             endif.
          ENDIF.
    Is there any fault in the below code? Please let me know if there is anything to correct...
    Regards,
    Yokesh Kumar.

  • Error while running a query-Input for variable 'Posting Period is invalid

    Hi All,
    NOTE: This error is only cropping up when I input 12 in the posting period variable selection. If I put in any other value from 1-11 I am not getting any errors. Any ideas why this might be happening?
    I am getting the following error when I try and run a query - "Input for variable 'Posting Period (Single entry, mandatory)' is invalid" - On further clicking on this error the message displayed is as follows -
    Diagnosis
    Variable Posting Period (Single Value Entry, Mandatory) is used as a lower limit (X) and an upper limit () in an interval selection. This limit has the value #.
    System Response
    Procedure
    Enter a different value for variable Posting Period (Single Value Entry, Mandatory). If the value of the other limit is determined by another variable, you can change its value also.
    Procedure for System Administration

    OK.
    Well, if the variable is not used in any interval selection, then I would say "something happened to it".
    I would make a copy of the query and run it to check if I get the same problem with period 12.
       -> If not, something is wrong in the original query (you can proceed as below, if changes to original are permitted).
    If so, then try removing the variable completely from the query and hardcode restriction to 12.
       -> If problem still persists, I would have to do some thinking.
    If problem is gone, then add the variable again. Check.
       -> If problem is back, then the variable "is sick". Only quick thing to do, is to build an identical variable and use that one.
    If problem also happens with the new variable, then it's time to share this experience with someone else and consider raising an OSS.
    Good luck!
    Jacob
    P.S: what fisc year variant are you using?
    Edited by: Jacob Jansen on Jan 25, 2010 8:36 PM

  • Error that "specify a value for variable posting period (single value entry

    hi
    My query is running testing fine in RSECADMIN under some username..but when i try and open it using analyzer (under same username) it gives me error that "specify a value for variable posting period (single value entry, mandatry)" it does'nt even asks to enter variable values and gives this error message.
    However the same query appears to be working fine under different username.
    plz advise.

    Hi Abhinav,
    Just do one thing compare the Roles of two different users for which Query is getting executed and not.
    Check the Object S_RFC.
    Compare the Objects detail for Both the Users.
    Please Assign points if useful.
    Regards,
    Rajdeep.

  • Error-Specify a value for variable

    Dear All,
    We upgraded our BW system to BI 7 SP 15. We are getting following error when executing queries in Bex.
    Specify a value for variable Company Code
        Message no. BRAIN629
    Diagnosis
        The variable cannot be empty. You must make an entry in the variable
        maintenance for variable Company Code.
    System Response
    Procedure
        Enter a value. Use the search help (F4) if necessary.
    Procedure for System Administration
    Interesting thing is that this error is faced by only 2 users in all upgarded systems.
    We created test user with same roles and we are getting error for these test users as well. All other users can run these queries without any problem. When we gave them sap_allprofile, it worked but I dont think this an authorization issue as these user can execute reports in web without any error.
    Second interesting thing is that, I applied note 1085822. This solved the problem. But on next day while closing this issue formally we found it is not working again and giving the same error.
    I checked other notes but these are not suitable for SP15.
    Any pointer/help will be well appreciated.
    Regards,
    Niraj

    Hi All,
    Resolved this issue by giving authorization obj S_BDS_D value display.
    Regards,
    Niraj

  • Could not determine value for variable 0P_FVAEX (or 0P_CTPCA)

    I get the below error while accessing a query on the planning Info Cube. I used the SAP Exit variable Most Current Data (Transactional InfoCube) (0S_RQTRA) in the query for the Characteristic - Request ID (0REQUID) to extract the data from the yellow request too.
    I do not use the below variables as in the below eror in my query at all. Please assist.
    Diagnosis
    This error diagnosis is specific only to the variables 0P_FVAEX or 0P_CTPCA !
    Termination message BRAIN 632 appears:
    Could not determine value for variable 0P_FVAEX (or 0P_CTPCA).
    System Response
    1.     Operation method of SAP-Exit-Variables 0P_FVAEX or 0P_CTPCA
    With queries from the CO application, both SAP-Exit-Variables look for an entry for 'controlling area'. With this controlling area from the selection screen, the SAP-Exit-Variables program reads the attributes for InfoObject 0CO_AREA (controlling area).
    With queries from the FI application, the SAP Exit Variable 0P_FVAEX looks for an entry for 'company code'. With this company code from the selection screen, the SAP Exit Variables program reads the attributes for InfoObject 0COMP_CODE (Company Code).
    0P_FVAEX determines the fiscal year variant (attribute 0FISCVARNT) from the attributes for 0CO_AREA (CO queries) or 0COMP_CODE (FI queries). 0P_CTPCA determines the currency type of the profit center local currency (attribute 0CURTP_PCA) from the attributes for 0CO_AREA.

    Hello,
    you need to take a closer look at your query. Somewhere you used one of the 0P_* exit variables, which work only for controlling related InfoCubes. Use your own variables.
    Regards,
    Marc
    SAP NetWeaver RIG

  • Missing substitution value for variable [dispatcher.host]

    Hello,
    I'm getting the error message "com.sap.engine.deploy.manager.MissingSubstitutionException: Missing substitution value for variable [dispatcher.host]." if I'm trying to deploy an SCA file via SDM (remotegui.bat).
    It seems that the problem is a missing variable setting. But I couldn't find any hints at the available SAP web sources which values needs to be set.
    It would be really great if somebody could give me a hint which steps I need to do to solve this issue.
    Many thanks in advance,
    Steffen Zimmermann
    Here is the whole GUI log :
    ==========================================================================
    08/11/26 21:31:15 -  ***********************************************************
    08/11/26 21:31:35 -  Start updating EAR file...
    08/11/26 21:31:35 -  start-up mode is lazy
    08/11/26 21:32:45 -  com.sap.engine.deploy.manager.MissingSubstitutionException: Missing substitution value for variable [dispatcher.host].
                              at com.sap.engine.deploy.manager.DeployManagerImpl.makeTempEar(DeployManagerImpl.java:3747)
                              at com.sap.engine.deploy.manager.DeployManagerImpl.makeNewEar1(DeployManagerImpl.java:3715)
                              at com.sap.engine.deploy.manager.DeployManagerImpl.deployUpdateAction(DeployManagerImpl.java:529)
                              at com.sap.engine.deploy.manager.DeployManagerImpl.deploy(DeployManagerImpl.java:513)
                              at com.sap.sdm.serverext.servertype.inqmy.extern.EngineApplOnlineDeployerImpl.performDeployment(EngineApplOnlineDeployerImpl.java:186)
                              at com.sap.sdm.serverext.servertype.inqmy.extern.EngineDeployerImpl.deploy(EngineDeployerImpl.java:96)
                              at com.sap.sdm.serverext.servertype.inqmy.EngineProcessor.executeAction(EngineProcessor.java:224)
                              at com.sap.sdm.app.proc.deployment.impl.PhysicalDeploymentActionExecutor.execute(PhysicalDeploymentActionExecutor.java:60)
                              at com.sap.sdm.app.proc.deployment.impl.DeploymentActionImpl.execute(DeploymentActionImpl.java:186)
                              at com.sap.sdm.app.proc.deployment.controllers.internal.impl.DeploymentExecutorImpl.execute(DeploymentExecutorImpl.java:48)
                              at com.sap.sdm.app.proc.deployment.states.eventhandler.ExecuteDeploymentHandler.executeAction(ExecuteDeploymentHandler.java:83)
                              at com.sap.sdm.app.proc.deployment.states.eventhandler.ExecuteDeploymentHandler.handleEvent(ExecuteDeploymentHandler.java:60)
                              at com.sap.sdm.app.proc.deployment.states.StateBeforeNextDeployment.processEvent(StateBeforeNextDeployment.java:127)
                              at com.sap.sdm.app.proc.deployment.states.InstContext.processEventServerSide(InstContext.java:73)
                              at com.sap.sdm.app.proc.deployment.states.InstContext.processEvent(InstContext.java:59)
                              at com.sap.sdm.app.view.controllers.DeployEventProcessor.processEvent(DeployEventProcessor.java:11)
                              at com.sap.sdm.client_server.deployserver.DeployCmdProcessor.processEvent(DeployCmdProcessor.java:264)
                              at com.sap.sdm.client_server.deployserver.DeployCmdProcessor.process(DeployCmdProcessor.java:108)
                              at com.sap.sdm.gui.server.GuiAdminRoleCmdProcessor.process(GuiAdminRoleCmdProcessor.java:72)
                              at com.sap.sdm.is.cs.session.server.SessionCmdProcessor.process(SessionCmdProcessor.java:67)
                              at com.sap.sdm.is.cs.cmd.server.CmdServer.execCommand(CmdServer.java:76)
                              at com.sap.sdm.client_server.launch.ServerLauncher$ConnectionHandlerImpl.handle(ServerLauncher.java:286)
                              at com.sap.sdm.is.cs.ncserver.NetCommServer.serve(NetCommServer.java:43)
                              at com.sap.sdm.is.cs.ncwrapper.impl.ServiceWrapper.serve(ServiceWrapper.java:39)
                              at com.sap.bc.cts.tp.net.Worker.run(Worker.java:50)
                              at java.lang.Thread.run(Thread.java:534)
    08/11/26 21:32:45 -  ***********************************************************
    Nov 26, 2008 9:32:45 PM  Info: End of log messages of the target system.
    Nov 26, 2008 9:32:45 PM  Info: ***** End of SAP J2EE Engine Deployment (J2EE Application) *****
    Nov 26, 2008 9:32:45 PM  Error: Aborted: development component 'Cognos8BI'/'cognos.com'/'Cog8BIFactory'/'1'/'1', grouped by software component 'Cognos8BI'/'cognos.com'/'Cog8BIFactory'/'1000.8.4.1.0.20081125093532''/'0':
    Caught exception during application deployment from SAP J2EE Engine's deploy API:
    com.sap.engine.deploy.manager.MissingSubstitutionException: Missing substitution value for variable [dispatcher.host].
    (message ID: com.sap.sdm.serverext.servertype.inqmy.extern.EngineApplOnlineDeployerImpl.performAction(DeploymentActionTypes).DMEXC)
    Nov 26, 2008 9:32:45 PM  Info: Starting to save the repository
    Nov 26, 2008 9:32:49 PM  Info: Finished saving the repository
    Nov 26, 2008 9:32:51 PM  Info: Starting: Initial deployment: Selected software component 'Cognos8BI'/'cognos.com'/'Cog8BIFactory'/'1000.8.4.1.0.20081125093532''/'0' will be deployed.
    Nov 26, 2008 9:32:51 PM  Error: Aborted: software component 'Cognos8BI'/'cognos.com'/'Cog8BIFactory'/'1000.8.4.1.0.20081125093532''/'0':
    Failed deployment of SDAs:
    development component 'Cognos8BI'/'cognos.com'/'Cog8BIFactory'/'1'/'1' : aborted
    Please, look at error logs above for more information!
    Nov 26, 2008 9:32:51 PM  Info: Starting to save the repository
    Nov 26, 2008 9:32:52 PM  Info: Finished saving the repository
    Nov 26, 2008 9:32:53 PM  Info: J2EE Engine is in same state (online/offline) as it has been before this deployment process.

    Thank you.
    Yes, it was a really not a default variable.
    Replacement of the variables directly at the archive with the correct value did solve the issue.

  • Default value for variable are not within permitted value range (precalc)

    Hello BW community
    Issue:
    I have created a variable (Characteristic Value/ Manual input-default value) and use the precalculated value set (details-basic settings). In the further variable definition I could select the  precalculated value set in 'Default values', which I have defined beforehand in the broadcaster..
    The precalculated value set in the broadcaster settings is just based on a master data query on 0CUSTOMER.
    Error:
    The variable gets the error E991/R9E Errors: Default values for variable 'XXX' are not within permitted value range.
    The detail description of the error is: You defined default values for variable 'Sold-to party precalc value set for manuel input' that are not appropriate for the variable type; for example, a range is defined as a default value for a variable that only permits a single value.
    So please has someone had the same issue and found out how to solve it? It would be excelent to get good solution for this issue.
    Best regards and thanks
    Christian
    PS-1: System BW 701 / SAPKW70105
    PS-2 : there has been a SDN entry with the same topic but not resolved too.
    link: /thread/980839 [original link is broken]

    Hello,
    Thanks for your response.
    I should have mentioned that in my post. I tried this very first time. I thought that this is the place where you provide default value. But I got following exception at that time, so I thought, may be this is used for something else.
    <LifecycleImpl> <_handleException> ADF_FACES-60098:Faces lifecycle receives unhandled exceptions in phase RENDER_RESPONSE 6
    javax.faces.FacesException: javax.servlet.ServletException: OracleJSP error:
    oracle.jbo.NameClashException: JBO-25001: Object viewAllInd of type Control Binding Definition already exists.
         at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:415)Do I need handle something else when you put the default value?
    Thanks,
    Jai

  • No getter method for property user of bean Problem

    Hi everyone,
    I am new to this struts. I have a samll application to check login. When I run my application I get this message in my server console
    No getter method for property user of bean org.apache.struts.taglib.html.BEAN
    I saw the previous forum for the same topic. I have checked my property names start with appropriate cases. Here is my code
    %@ page language="java" %>
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
    <html>
    <head><title>Login</title></head>
    <body>
    <html:form action="submit.do">
    <table width="100%" border="0" height=75%>
    <tr>
    <td align="right" >UserName: </td>
    <td><html:text property="user"/></td>
    <tr>
    <tr>
    <td align="right" >Password: </td>
    <td><html:text property="password"/></td>
    </tr>
    <tr>
    <td colspan=2 align="center"><html:submit/></td>
    </tr>
    <tr>
    <td colspan=2 align="center"><html:errors/></td>
    </tr>
    </table>
    </html:form>
    </body>
    </html>
    import javax.servlet.http.HttpServletRequest;
    import org.apache.struts.action.*;
    import java.util.*;
    * @author skannan
    * To change this generated comment edit the template variable "typecomment":
    * Window>Preferences>Java>Templates.
    * To enable and disable the creation of type comments go to
    * Window>Preferences>Java>Code Generation.
    public class LoginForm extends ActionForm
    private String user = null;
    private String password = null;
    /* user */
    public String getUser()
    return (this.user);
    public void setUser(String user)
    this.user = user;
    /* password */
    public String getPassword()
    return (this.password);
    public void setPassword(String password)
    this.password = password;
    public ActionErrors validate(ActionMapping mapping,
    HttpServletRequest request) {
    // Log the forms data
    servlet.log("Lastname:" + user);
    servlet.log("Address:" + password);
    // Check for mandatory data
    ActionErrors errors = new ActionErrors();
    if (user == null || user.equals("")) {
    errors.add("User", new ActionError("error.user"));
    if (password == null || password.equals("")) {
    errors.add("Password", new ActionError("error.password"));
    return errors;
    I am missing anything in my config files. Please I need help.
    Thanks!

    I did check my struts-config file
    Here is the part of my file
    <!-- ========== Form Bean Definitions ================= -->
    <form-beans>
    <form-bean name="loginForm"
    type="kannan.struts.trailer.checkin.LoginForm"/>
    <form-bean name="checkInForm"
    type="kannan.struts.trailer.checkin.CheckInForm"/>
    </form-beans>
    <!-- ========== Action Mapping Definitions ============ -->
    <action-mappings>
    <action path="/submit"
    type="kannan.struts.trailer.checkin.LoginAction"
    name="loginForm"
    input="/login.jsp"
    scope="request">
    <forward name="success" path="/checkIn.jsp"/>
    <forward name="failure" path="/login.jsp"/>
    </action>
    Still I am getting the error

  • How can I use evaluate to get the instance variable in customized tag

    1.
    At first , I create a class called bean,and declared several params in it and do not define any getter function for the param.
    class bean{
    String param = "test";
    SomeClass scObj = new SomeClass();
    2.
    The second ,I use
    request.setAttribute("beanObj",new bean());
    3.
    And then I wanna use the customized tag to show a text box , then initialize it's value.
    <salt:text name="param" value="beanObj.param">
    <salt:text name="obj" value="beanObj.scObj.func()">
    4.
    I tried the evaluator provided by JexlContext ,Struts, JSTL and it seems that if I do not define the getter for the variable ,I can not get the bean's instance variable's value.
    Expression e = ExpressionFactory.createExpression( value );
    JexlContext jc = JexlHelper.createContext();
    jc.getVars().put(strInitBeanName, request.getAttribute("beanObj"));
    Object obj = e.evaluate(jc);
    the result of the obj is null....
    Can anybody recommand some other evaluator can get the value of a instance variable from an object?

    do you have any other suggestion ? Nops, somebody else may have though. AFAIK, all lookups of the type
    beanName.propertyNameuse reflection on the getXXX() methods to access the property.
    Having said that, I guess you could write one though in a custom tag, using the same - reflection (you will ahve to rely on the java.lang.reflect.Field class quite heavily) - but that would be reinventing the wheel for most other functionality that you would have to include (like looking up the bean in scope etc)
    cheers,
    ram.

  • How to get name of variable passed to method

    How can I get the name of the variable that's passed into a method, in the method?
    for instance: the following code prints an array to a text file, and includes the name of the array in the name of hte text file. So, to call it, I have to do this:
    printarray(myArray, "myArray")
    so that the text "myArray" gets passed in & used in teh fileNM output.
    This is inelegant, and I'd like to just call it like this:
    printarray(myArray)
    and have the method extract that name.
    void printarray(String printstuff[], String arrayname) throws Exception
        String fileNM = "arrayprint_" + arrayname +".txt";
        FileWriter printme = new FileWriter(fileNM);
        String newline = System.getProperty("line.separator");
            String tab = "\t";
        for (int i = 0; i<printstuff.length; i++)
            printme.write(i + tab + printstuff[i]  + newline);
        printme.close();
        } // end printarray

    Let me try to put this in different words and see if I convince you...
    I think you are getting confused between variable names that you use refer a variable within your class and "names" that you associate with a variable based on the data it holds.... In your example
    String[] myArray;here 'myArray' is the name of the reference to the variable printstuff[]. When you call the method
    printarray(myArray) a copy of this reference is passed to that method.
    But you also want to pass another variable that represents the description of the array (which you are referring to as the name). In this case one of the ways of doing this what you had pointed out which is
    printarray(myArray, "myArray");If you don't like this and think its inefficient you should do a bit of reading on the basics of what a variable is, what a reference to a variable etc. Alternativel you can define your own class that convinces you like
    public class MyArray
          private String[] myArray;
          private String myArrayName;
          public MyArray(String myArrayName, String[] myArray)
                      this.myArrayName=  myArrayName;
                      this.myArray = myArray;
          public String[] getArray()
                    return myArray;
          public String getName()
                      return myArrayName;
    }Edited by: deepak_1your.com on 17-Apr-2008 14:12

  • How to get the Text variables in the Columns Headings

    Hi,
         My requirement is I need to get data for weekly wise and for the last 10 weeks also. For this purpose I used the restricted KF based on the variables (customer exit) and offset. Also used the text variable for displaying from and to days in the column headings. I am getting the right text for the first column only. But the text offset is not considering.
    Ex 07/04/2007 to 07/10/2007      06/27/2007 to 07/03/2007 like that.
    I used the two text variables one for from data and other for to date using the customer exit. I am getting the same text as of the first column for the subsequent columns also. Please help me for getting the right text in the columns.
    Thanks,
    visu

    Hello ,
               The quite simple way is to create a text variable with replacement path , as it replaces the value of customer exit used in the report.
    create two text variables
    First variable:
    1 Replace variable with -
    external characteristic key value
    For interval use ---from value
    2.Secod text variable
    Replace variable with -
    external characteristic key value
    For interval use ---To value
    offset start -0000 offset length0000
    use these variables in the column headings.
    hope it is clear,
    assign points if useful

Maybe you are looking for

  • Internal table occurs 0 --------- why obsolate?

    Hi, Can anybody tell why the declaration of internal table occurs 0 and internal table with header line is obsolate now? Explain the adavantages of newer one. is there any performance related issue? Thanks in advance Debjani Lahiri

  • Better readable EntityStore dump files ?

    Hi, I tried using DBDump to dump the contents of my BDB env into files using the information given in http://www.oracle.com/technology/products/berkeley-db/faq/je_faq.html#49. I found that though the data contained in the dump files are correct, its

  • Please help me in inserting data into table from XML message.

    Hi Experts, Please provide a procedure to implement my below requirement. Since I am new to queue concept. [code]- <MESSAGES> - <MESSAGE ID="3026900">   <MSG_ID>3026900</MSG_ID>   <DT_POSTED>6/20/2013 08:15:48</DT_POSTED>   <POSTED_BY>GPD_MSG_EXTRACT

  • Nfs client ls /data/rw10 nfs client on mount: Permission denied

    We are running an 800 cpu amd solaris 10 x64 cluster for HPC and an 512 cpu ultrasparc cluster solaris 10 for high throughput. Until now the nfs servers played ball and I did not experience real difficulties. I am running two Solaris 10 x64 servers s

  • How can i get my files to be on my windows screen

    I cant use internet or access my files on bootcamp. Can someone tell me what to do?