Question on exception variable name

A very simple question:
In the following code
public void compile() {
ParseTree p;
try {
p = parse();
p.toByteCode();
catch (ParserException e1) { }
catch (DumbCodeException e2) { }
in the first catch clause, the variable name is e1 and e2 for the second catch clause. Can I use the same variable name e for both clauses?
Edited by: Shibaryotaro on Aug 19, 2009 3:59 PM

What happens when you try to?

Similar Messages

  • Variable names "{name}" showing up before dataset loads

    I am using an XML dataset. I have it working perfectly except
    for the fact that on the page in question, right before the data
    loads, you see the actual variable names writeen out on the page.
    Also as part of my data, i am displaying an image, so until the
    data loads there is a broken image and then it loads. Is there a
    way to handle this so the variables dont show until the data
    loads?

    Hi ehaemmerle,
    Checkout this sample:
    http://labs.adobe.com/technologies/spry/samples/data_region/HideDataReferencesSample.html
    --== Kin ==--

  • Question about Local Variables (Multiple answers welcomed!)

    A couple of questions about Local Variables
    1. Programmers always say: “Do not abuse of Local Variables”. I’d like to know, when and where Local variable are most efficiently used?
    2. If I have to create a couple of local variables, is there anyway to “clone” them without going through the repetitive “create/local variables” mouse click each time? (When I try to copy and paste, it creates a new variables instead of the one that I am trying to reproduce)
    3. Which is faster in execution: Updating a variable through a) writing to property node/value or b) through local variable
    Everyone’s input is welcomed, so if this question is already answered, please
    feel free to add additional comments/answers!

    1. Use Local Variables in user interface code and no where else. The only exception is using a local variable of a cluster output to define the datatype for a bundle by name node.
    2. You can drag copy them then right click to get to a menu of all the currently defined controls and indicators on the VI.
    3. B. The problem with A is that it forces a thread switch to the user interface thread--which can take time if you aren't already in it, and it's a very convoluted process under the hood. NI's advice never update indicator values through a property node unless you absolutely, positively can't figure out some other way of doing it.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Variable name to string

    Hi, I'm really new to TestStand, so this is probably an easy question:
    I'm using TestStand 4.5 and I'm trying to convert the name of a variable, Locals.MaxArrayIndex, which is a numeric variable, into a String, Locals.VarString.
    I know that the Str() function can be used to convert a numeric into a String, but how can I store the actual words "Locals.MaxArrayIndex" in a string?
    Thanks! 

    Hmmm...it works great for Parameters that are arrays, but for me it won't work if the Parameter is a numeric variable. Maybe I'm making a mistake somewhere else that I'm not picking up; so I attached the sequence file if you want to take a look at it.
    The issue arises in the 'Else' statement. I'm pretty sure the syntax in my function and popup are correct, but the String (ParamName) that is supposed to hold the value of the Parameter variable name (DataSelect) doesn't seem to ever be filled and outputted in the error message.
    I would really appreciate it if any of you guys could have a look at the file (I'm sure I'm making some kind of really rookie mistake)
    Thanks! 
    Attachments:
    GenerateError.seq ‏9 KB

  • Oracle 11G and SqlDataSource: 'ORA-01036: illegal variable name/number'

    [Resolved - http://forums.oracle.com/forums/thread.jspa?messageID=2366331&#2366331]
    I've created a short video to explain my problem with Oracle and SqlDataSource. If you'd rather watch than read, go see the video at http://www.kencox.ca/video/oracelandsqldatasource.html.
    I'm trying to do some extremely simple drag and drop development in Visual Web Developer 2008 with the Oracle 11g database and ODP.NET. According to Oracle, "The data provider can be used with the latest .NET Framework 3.5 version. "
    The SELECT statement works fine, but any attempt to use UPDATE via the SQLDataSource UpdateCommand nets me the infamous 'ORA-01036: illegal variable name/number' error.
    I wouldn't mind using one of my MSDN Support Incidents to have Microsoft take a look at this issue, but I'm not sure the problem is Microsoft's. It seems like Oracle is doing a poor job in its Visual Studio integration.
    Question: Has anyone successfully used an UpdateCommand statement in SQLDataSource against Oracle 11g? If so, let me know!
    Below, you see the entire code as generated in Visual Web Developer 2008. To see it in action, check the video at http://www.kencox.ca/video/oracelandsqldatasource.html.
    Ken
    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
    <title>Untitled Page</title>
    </head>
    <body>
    <form id="form1" runat="server">
    <div>
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
    DataSourceID="SqlDataSource1"
    EmptyDataText="There are no data records to display.">
    <Columns>
    <asp:CommandField ShowEditButton="True" />
    <asp:BoundField DataField="ACCOUNTID" HeaderText="ACCOUNTID"
    SortExpression="ACCOUNTID" />
    <asp:BoundField DataField="ACCOUNTNAME" HeaderText="ACCOUNTNAME"
    SortExpression="ACCOUNTNAME" />
    <asp:BoundField DataField="ACCOUNTLOCATION" HeaderText="ACCOUNTLOCATION"
    SortExpression="ACCOUNTLOCATION" />
    <asp:BoundField DataField="ACCOUNTPHONE" HeaderText="ACCOUNTPHONE"
    SortExpression="ACCOUNTPHONE" />
    <asp:BoundField DataField="ACCOUNTCONTACT" HeaderText="ACCOUNTCONTACT"
    SortExpression="ACCOUNTCONTACT" />
    <asp:BoundField DataField="ACCOUNTWEBSITE" HeaderText="ACCOUNTWEBSITE"
    SortExpression="ACCOUNTWEBSITE" />
    </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server"
    ConnectionString="<%$ ConnectionStrings:ConnectionString1 %>"
    ProviderName="<%$ ConnectionStrings:ConnectionString1.ProviderName %>"
    SelectCommand="SELECT "ACCOUNTID", "ACCOUNTNAME", "ACCOUNTLOCATION", "ACCOUNTPHONE", "ACCOUNTCONTACT", "ACCOUNTWEBSITE" FROM "ACCOUNTS""
    UpdateCommand="UPDATE ACCOUNTS SET ACCOUNTLOCATION = 'This Place' WHERE (ACCOUNTID = 4)">
    </asp:SqlDataSource>
    </div>
    </form>
    </body>
    </html>//////////using System;
    using System.Collections;
    using System.Configuration;
    using System.Data;
    using System.Linq;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Xml.Linq;
    public partial class _Default : System.Web.UI.Page
    protected void Page_Load(object sender, EventArgs e)
    Message was edited by:
    kjopc

    Ken,
    One thing to be aware of is Microsoft has produced Visual Studio database tools and data provider for Oracle. In addition, Oracle has produced its own tools. Knowing which products you are using is important because you want to know which company you should be complaining about. :-)
    In your video, you are using all Microsoft tools and data provider, not Oracle's.
    I would recommend using Oracle Developer Tools (ODT) for VS and ODP.NET since these products are much better integrated with .NET and Oracle.
    ODP.NET uses Oracle.DataAccess.Client namespace. System.Data.OracleClient belongs to the MS provider for Oracle, which Mark pointed out. If you drag and drop DB objects using ODT, it will generate ODP.NET code for you (and give you more data source wizard options as well).
    You can download the latest 11g version of ODP.NET and ODT here:
    http://www.oracle.com/technology/software/tech/windows/odpnet/index.html
    These support .NET 3.5 and VS 2008.

  • Obtain string of IN variable name in PL/SQL

    Hi,
    Odd question. Is there a way to access an IN variable's object name in a procedure?
    eg.
    procedure (var1    IN VARCHAR2(6),
                    var2    IN VARCHAR2(6),
                    var3    IN VARCHAR2(6))
    IS....You run this procedure and pass in parameters of:
    var1 => 'abcdef',
    var2 => 'defghi',
    var3 => 'ghikjl';
    In the code, I want to access the number in the string of the +variable name: var1+
    In a naive sense,
    num_of_in_var := substr(var1, 4,1) would be what i was hoping to achieve, but,
    var1 is set to 'abcdef' so,
    num_of_in_var := substr(var1, 4,1) would return 'd'.
    Any thoughts?
    Thanks
    Edited by: chris001 on Nov 20, 2012 1:16 PM

    Here's an example of how (what you want to do using a procedure or function), can be done using a ADT/UDT (Advance/User Defined Type) in Oracle.
    This approach will not work for standard procedures and functions as this type of dynamic referencing of the code unit/object to itself, is not possible.
    SQL> create or replace type TSomeObject as object(
      2          name    varchar2(10),
      3          id      integer,
      4          day     date,
      5 
      6          member function PropertyByNumber( n integer ) return varchar2
      7  );
      8  /
    Type created.
    SQL>
    SQL> create or replace type body TSomeObject as
      2 
      3          member function PropertyByNumber( n integer ) return varchar2 is
      4                  PLSQL_PROP_GET  constant varchar2(1000) :=
      5                          'declare
      6                                  obj     TSomeObject;
      7                          begin
      8                                  obj := :1;
      9                                  :2 := to_char( obj.#PROPERTY# );
    10                          end;';
    11 
    12                  type            TStrings is table of varchar2(30);
    13                  property        TStrings;
    14                  dynamicBlock    varchar2(1000);
    15                  res             varchar2(4000);
    16          begin
    17                  select
    18                          a.attr_name bulk collect into property
    19                  from    user_type_attrs a
    20                  where   a.type_name = 'TSOMEOBJECT'
    21                  order by
    22                          a.attr_no;
    23 
    24                  dynamicBlock := replace( PLSQL_PROP_GET, '#PROPERTY#', property(n) );
    25                  execute immediate dynamicBlock
    26                  using   in self,
    27                          out res;
    28 
    29                  return( res );
    30          end;
    31 
    32  end;
    33  /
    Type body created.
    SQL>
    SQL> declare
      2          obj     TSomeObject;
      3  begin
      4          obj := new TSomeObject( 'John Doe', 123, trunc(sysdate) );
      5 
      6          for i in 1..3 loop
      7                  dbms_output.put_line( 'property '||i||'='||obj.PropertyByNumber(i) );
      8          end loop;
      9  end;
    10  /
    property 1=John Doe
    property 2=123
    property 3=2012/11/23 00:00:00
    PL/SQL procedure successfully completed.
    SQL> Simplistic example (the PropertyByNumber could be a static class method defined in the abstract parent class) - and one that requires the object to essentially duplicate itself via a bind variable call to dynamic code. Not really the best of approaches, but demonstrates the flexibility (to do even interestingly weird stuff) in PL/SQL.

  • Sequence Quiz Using User Defined Variables - Can See Underlying Variable Name On Move

    I have just tested using 1 slide to capture several user defined variables and the next slide to insert those variables as options in a sequence quiz slide.
    This works but as soon as I grab an object to begin sequencing them the underlying variable name shows up alongside the variable content.
    Am wondering if I am attempting something that shouldn't be possible in Captivate and / or if there is a fix?
    Thanks

    Sure, I'm using Captivate 8. On a test project I've created:
    a slide with 2 text entry boxes, their contents are stored in variables
    another slide with a sequence question (using the native captivate question slide)
    The labels on the 2 sliders on the question slide use the variables from the previous slide.
    This works, so if the variables are as follows:
    $$data_sequence1$$ - "blah blah blah"
    $$data_sequence2$$ - "blah"
    The labels on the sliders on the sequence question will be "blah blah blah" and "blah".  as intended.
    The issue is when I click one of the sliders to drag it to sequence the variable name will flash up on screen. So if I touch the slider with the label "blah blah blah" $$data_sequence1$$ will flash up on screen.
    I have other slides on there but these are the two related to this question. I haven't fully published the project I've previewed it.

  • Creating on the fly dynamic named bind variable names.

    I have an application process which gets called by a Dynamic action and Javascript.
    Everything is working great however I'm using it to drive dynamic charts.
    I could use IF statements at the end of the application process to decide what BIND vairable to fill with the information the process has collected however I'd prefer just to create the BIND variable from the
    name of the submitted information.
    So I have an application level variable called WHICHCHART. this gets populated with text upon calling the application process...so let's say 'chart1' is what it gets filled with.
    What I"d like to have at the end of the application process is just a bind variable waiting called :chart_1.
    So no matter what the value of WHICHCHART it will create an on the fly a bind variable with the same name.

    Ok. I guess this question was more how do you do this..then OH NO there are not other ways to do this.
    So I have a page with a chart region. this chart will have 3 Y Axes which prohibits the use of the default XML.
    So..
    I have the following Javscript:
    function getdata(whichchart) {
      var get = new htmldb_Get(null,$x('pFlowId').value,'APPLICATION_PROCESS=VM_XML_GENERATION',0);
            get.add('WHICHCHART',whichchart);
            gReturn = get.get('XML');
      get = null;
    Which is called when the page loads by a dynamic action:
    getdata('production');
    When the javascript is called as you can see it fires off:
    declare
       chart_series_data VARCHAR(32767);
       type array_cols is varray(7) of varchar2(100);
       array array_cols := array_cols('VM_HOSTS_NUM','VM_NUMBER','VM_PHYS_MEM','VM_VIRT_MEM','VM_CPU_COUNT', 'VM_TOTAL_DISK','VM_PROVISIONED_DISK');
    BEGIN
    --IF :WHICHCHART IS NULL THEN
    --RAISE_APPLICATION_ERROR(-20001,'Chart variable not set');
    --END IF;
    chart_series_data := null;
    chart_series_data := '      <data>'||chr(10);
    chart_series_data := chart_series_data||  '        <series name="Hosts Number" type="Line" color="0x1D8BD1" >'||chr(10);
    for c1 in (SELECT VM_REPORT_DATE LABEL,VM_HOSTS_NUM from TABLE where VM_REPORT_DATE between add_months(SYSDATE,-24) and SYSDATE and lower(VM_DCNAME)=lower(:WHICHCHART) )
    loop
    chart_series_data := chart_series_data || '<point name="'||c1.LABEL||'" ';
    chart_series_data := chart_series_data || 'y="'||c1.VM_HOSTS_NUM||'"></point> '||chr(10);
    end loop;
    chart_series_data := chart_series_data|| '      </series>'||chr(10)||'</data>';
    :PROD_DATA := chart_series_data;
    END;
    The : production variable at the end of this I want to change the name of based on the value I'm sending of WHICHCHART from the javascript. I hope this is clearer now.
    AGAIN this is not really a need. It is a want to be able to create dynamic bind variable names going forward.
    Thanks

  • Variable Name Makes App Crash

    I have an embedded bitmap resource, one of many in my program, which is an AIR app.  There's nothing unusual about it; in fact, I can replace the file to be embedded with a blank white file of the same size, or another (working) bitmap from the same program, and get the following results.
    Whether my app works or not depends on what I name the variable corresponding to the embedded resource (the :Class variable after the embed directive).  If I name it "sprBatteries", the app hangs at startup in the iPhone; the loading screen transitions into the stage background color, and shows none of the stage contents.  If I name it "sprDryCells", or even "sprBatteriesX", it works fine and displays the expected contents.
    This works fine testing on my desktop, regardless of the variable name.  I suspect that it is encountering an exception on load, but it seems to be happening before FDB can connect, so I don't know what the problem could be. EDIT: Oh, and I believe that it works fine if I compile the app as a simple AS3/Flex app rather than as an AIR app.  I haven't done systematic testing to confirm this, though.
    Does anyone have any idea what could be going on and how I could fix it?

    leotemp, that's a very smart(***) answer - but don't name
    them
    what? I read your earlier post of today: you might benefit
    by looking at Aral Balkan's Quick Start about skinning the
    components.
    I have not seen anything in all the documentation about names
    to avoid in naming files. If there are restrictions on this, it
    would be nice to see a list of those names and the situations in
    which the restrictions apply. I would think renaming the file is
    not the first thing a programmer does when an unusual message shows
    up in the Problems window in FB.
    If anyone has something to say about this, please do so.
    Cheers,
    Carlos

  • Getting the variable name

    Hi
    May be a simple question, but I can't figure out how actually.
    When I'm doing this
    var obj:Object = new Object();
    obj.test = "My Test";
    for(var i:* in obj)
         trace(i + " : " + obj[i]);    
    The output is -> test : My Test
    My problem comes when I put an object inside the object
    var obj:Object = new Object();
    obj.test = new Object()
    obj.test.secondTest = "My Test";
    for(var i:* in obj)
         trace(i + " : " + obj[i]);    
    The output is -> test : [object Object]
    So any idea how to get the variable name instead of [object Object], just like the first output but with the second code. I have an object inside an object.
    Thanks

    The following approach will dig it's way in.  I added other variables to the main object just for demo sake...
    var obj:Object = new Object();
    obj.test1 = "test string";
    obj.test = new Object();
    obj.test.secondTest = "My Test";
    obj.test2 = new Object();
    obj.test2.secondTest2 = new Object();
    obj.test2.secondTest2.val = "deeper test";
    function traceObjectVars(obj_arg:Object):void {
          for(var i:* in obj_arg){
                if(typeof(obj_arg[i]) == "object"){
                      traceObjectVars(obj_arg[i]);
                } else {
                     trace(i + " : " + obj_arg[i]);
    traceObjectVars(obj);

  • Substitute a variable name by String ?

    Hi
    is it possible to substitute a variable name by a String ? if yes then please tell me how :-)
    thx
    pain

    You might be able to use the Reflection API to get what you want, but every other time this question's been asked the asker really needed to use a HashMap instead...
    Good Luck
    Lee

  • Can I override Pro*Fortran's limit on Fortran variable name lengths?

    The Fortran standards put a 31-character limit on the variable names in Fortran code. Some compilers allow you to exceed this as a compiler extension, and, unfortunately, our code has places where we actually do... The present software compiles and runs under with the Ingres 9.2 RDBMS, but we're starting the process of porting the code over to Oracle 11g.
    The Pro*Fortran (we have release 1.8.79.0.0) precompiler only accepts the first 31 characters of a long var name (yes I found that limitation stated in the Pro*Fortran Precompilers guide). What I am wondering is if there is any way to override that and allow a longer name to be used. The Sun studio compiler accepts it, just not the precompiler. Searched the docs and found nothing about overriding things like this.
    If necessary, yes I can shorten the variable names. I'm just trying to minimize the amount of code changes required.
    Jim

    You are correct.
    5 lines below the QUERY DATA SOURCE NAME block property line
    is the ‘where clause’ line
    It already had FAC_ID = :FACILITIES.ID
    I found that if I added my :Blk_name.Pass_cd_num
    I could see it my new bind variable in a system.last_query display.
    I found the QUERY DATA SOURCE NAME below the ‘from query clause’ truely
    is the from clause and it will not except any :Blk_name.item_name
    (Because is is just for tables)
    But the ‘where clause’ property line will except bind_variables
    :Blk_name.item_name is successful in the where clause.
    (where Capturing_devices table being the block’s base table)
    -- **FROM**
    SET_BLOCK_PROPERTY('EMISSION_POINTS',QUERY_DATA_SOURCE_NAME,
    'EMISSION_POINTS A,
    EP_MODES B,
    CAPTURING_DEVICES,
    CONTROL_DEVICES CD');
    -- **WHERE**
    SET_BLOCK_PROPERTY('EMISSION_POINTS', DEFAULT_WHERE,
    'A.ID = B.EP_ID AND
    B.ID = CAPTURING_DEVICES.PARENT_MODE_ID AND F
    CAPTURING_DEVICES.CD_ID = CD.ID AND
    CAPTURING_DEVICES.CD_ID IS NOT NULL AND
    CAPTURING_DEVICES.PARENT_MODE_ID IS NOT NULL AND
    CAPTURING_DEVICES.STACK_ID IS NULL and
    B.FAC_ID = :FACILITIES.ID and CD.NUM = :emission_points.cd_id_num');
    --**ORDER BY**
    SET_BLOCK_PROPERTY('EMISSION_POINTS',ORDER_BY,
    '(A.NUM, C.PARENT_MODE_ID, C.CD_ID)');
    EXECUTE_QUERY;
    I still get a FRM-40505: Oracle error: ‘unable to perform query’
    (I know its because of the way it is coded),
    But I did learn bind variables can work in the where clause.
    Also I tried using the hidden field like you suggested.
    If you put char character field in a where clause it will come out in quotes
    So I assigned it to a block.hidden_item (number) like you suggested
    that did strip off the quotes.
    That left me with passing the value of 31, I need to pass 0031
    I tried to do a LPAD to the value left pad it with zeroes
    But that did not work.
    I went back to my effort in using a cursor loop to populate the block
    Thanks

  • What is $var variable name usage?

    Hi all,
    Good day.
    In SAP standard program, I saw some variable declared with prefix dollar sign.
    example, $lt_var
    Any different with normal variable name?
    Thanks.
    Greatly appreciate for any comment.

    Hi,
    good question but unfortunately I do not have direct answer. But I am very interested in answer. I found this about variable naming in ABAP documentation.
    As well as these characters, certain special characters are used internal. However, these should not be used in application programs.
    and in ABAP objects you can use only
    Permitted are letters from "A" to "Z", numbers from "0" to "9" and underscores (_).
    So my guess is that it should be related to special characters. Maybe passing some hints to ABAP compiler.
    Cheers

  • Assigning different variable name to objects to be stored in a collection

    sorry this may be a very silly and easy question - but i urgently need help.
    can a collection contain objects declared with the same variable name
    ie. what i'm trying to do is:-
    Abridgment varabridgment = null;
          int nRows = 0;
          while(resultSet.next()){
            nRows++;
    //the doggey code part - but what i'm trying to do is to create a new Abridgment object with a unique name so that it can be stored in the clooection object later as a unique entry based on the nRows counter???
    // is this possible or needed?     
          varabridgment = varabridgment +nRows;
          varabridgment = new Abridgment();
          varabridgment.seta_county(county);
          varabridgment.seta_year_date(Integer.parseInt(year));
          abridgeresults.addAbridgment(varabridgment); please i need an urget answer . thanks.

    Read the following thread for the solution to your problem:
    http://forum.java.sun.com/thread.jspa?threadID=634815

  • What's user variable name using Smart View POV function (ex:HypGetActiveMember)?

    Hi,
    We want to use Smart View POV function (ex:HypGetActiveMember) to get the active member of user variables from HFM forms selected into Excel, but we don't know the user variable name in the following paragraph of Smart View developer guide:
    "To uniquely identify the user variable, provide the user variable name rather than the dimension name."
    For example, what's the user variable name of Year dimension? How to get the user variable name?
    Any information would be appreciated. Thank you!

    Hi,
    I guess user variable name is set by users/developers. I am not very clear on your question. If you have defined some variables to select any members from a dimension then it will be in HFM only. In planning we have two kinds of variables User Variables (we set it from Planning Preferences) and Substitution variable (we set it from Essbase Consol in the backend). Without looking into your application it is difficult to say the user variable name. Like for Year the user variables can be "PreviousYear", "CurrentYear", or "NextYear" etc.
    Soumya

Maybe you are looking for