VARIABLE TYPE - a way to know it

Hi,
I've been wondering for a big while if there is any way to know the type of an existing variable.
To explain it, here is an example of how I would like to use it:
var myVar:Boolean = true;
trace(SomeFunctionReturningTypeOfVar(myVar));     // "Boolean"
Of course, we can do a simple function that wil have like ten if clauses checking "if(myVar is String) ... else if(myVar is Boolean) ..." etc, but this is way too clumsy a solution...
Any ideas?
Bests!

Check out this code here:
http://forums.adobe.com/message/2017444#2017444

Similar Messages

  • Is there any way to know that status of DEFINE variable?

    Hi,
    I have a list of scripts that is executed to create my baseline database. At the beginning of the script execution, we have a SET DEFINE OFF and at the end we put SET DEFINE ON. During one of the scripts, we deliberately SET DEFINE ON and we forgot to SET DEFINE OFF at the end of the script. Consequently, the following scripts started failing without error notification because they contained '&' in the INSERT query. I have the following queries:
    1. Is there any way to know the status of the DEFINE variable at the beginning of the script?
    2. Since the oracle gives a user interrupted error, the script execution process does not terminate with error. Instead, it continues executing the next scripts. Is there a general way to capture such errors and terminate the script execution. We already have WHENEVER SQLERROR and WHENEVER OSERROR in our script execution process.
    Regards
    Kunal

    Hi, Kunai,
    Welcome to the forum!
    953495 wrote:
    Hi,
    I have a list of scripts that is executed to create my baseline database. At the beginning of the script execution, we have a SET DEFINE OFF and at the end we put SET DEFINE ON. During one of the scripts, we deliberately SET DEFINE ON and we forgot to SET DEFINE OFF at the end of the script. Consequently, the following scripts started failing without error notification because they contained '&' in the INSERT query. I have the following queries:
    1. Is there any way to know the status of the DEFINE variable at the beginning of the script?Whether it's at the beginning of a script, later in the script, or not in a script at all, the SQL*Plus command
    SHOW DEFINEtells you if DEFINE is ON or OFF.
    If DEFINE is ON, it will produce something like:
    define "&" (hex 26)If DEFINE is OFF, it will produce
    define OFF
    2. Since the oracle gives a user interrupted error, the script execution process does not terminate with error. Instead, it continues executing the next scripts. Is there a general way to capture such errors and terminate the script execution. We already have WHENEVER SQLERROR and WHENEVER OSERROR in our script execution process.Do you really need to capture those errors? Why not just prevent them? It sounds like you want to make sure DEFINE is OFF at a certain point. To do that, just say
    SET  DEFINE  OFFRegardless of whether DEFINE was ON or OFF before you issue that command, you can be sure it will be OFF after that.
    I hope this answers your question.
    If not, post a complete test script (or set of scripts) that people can run to re-create the problem and test their ideas.
    Point out where the scripts you post are not doing what you want, and describe, with specific examples, what you want it to do in those places.

  • How to know  pro-grammatically variable type(string ,numeric ....) of TestStand variable using CVI

    Hi,
    how to know  pro-grammatically  variable type(string ,numeric ....)  of TestStand  variable using Labwindows CVI.
    Thanks
    Mukesh Kumar

    Mukesh,
    You could use the TS_PropertyGetType() function in CVI to do this. Here is a reference page for the GetType function--you can see that it returns a PropertyValueType which will indicate which type the PropertyObject (variable) is. In CVI, you'll find this function in the NI TestStand API 2013 instrument methods, under PropertyObject > Static Properties. 
    Hope it helps, and let us know if you have any more questions about it!
    Daniel E.
    TestStand Product Support Engineer
    National Instruments

  • Outputting multiple variable types from single output vi

    Hello,
    I am trying to make a vi that takes some inputs (they are not too relevant to my problem) and has a single output.
    My problem is that I'd like the output variable type to be left unknown until runtime.
    For example, the vi will decide appropriately when to output an integer, string or double variable type.
    Furthermore, inside the vi, I need a way to select the appropriate variable type to send, hence I need a way to check the type of a variable (I don't really know how to do that either).
    Can someone give me some advice?
    Thanks
    David

    Data types are determined at compile time.  You cannot have a run-time decision for a data type.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Actual type of variable type in parameterized type

    Hi all,
    Is there way to find out what is actual type of the Variable type in Parameterized type, for example:
    class A<T> {
         //actual type of variable type T
         Class<T> tClass;
         public void setTClass() {
              // I don't know what should I do here
         public Class<T> getTClass() {
              return tClass;
         public static void main(String[] args) {
              assert((new A<Integer>().getTClass()).toString().equals("class java.lang.Integer"));
    Message was edited by:
    MjLaali
    Message was edited by:
    MjLaali
    Message was edited by:
    MjLaali

    yes ofcource I can't chenge the actual type of variable type T in run time, but I would like to get actual class of T in run time like this example :
    package test;
    import java.lang.reflect.ParameterizedType;
    abstract class B<T>{
         private Class<T> variableClass;
         public B() {
              this.variableClass = (Class<T>) ((ParameterizedType) getClass()
                        .getGenericSuperclass()).getActualTypeArguments()[0];
         public Class<T> getTClass(){
              return variableClass;
    class A extends B<Integer> {
         public static void main(String[] args) {
              assert(new A().getTClass() == Integer.class);
    but I don't want class A and I would like to move main method to class B.

  • How to define the "tab" ,"enter" character in a variable(type c)

    I want to use the define the "tab" key and
    "enter" key in a variable(type c),
    But I don't know how to write it :
    for example:
    data: a1 type c(1).
    data: a2 type c(1).
    a1 = ?. " the tab key
    a2 = ?. " the enter key

    Hi, i think joseph fryda gave you the one solution.
    In the server which doesn't support CL_ABAP_CHAR_UTILITIES, here is another solution.
    data:
        C_X1                  TYPE X VALUE '0D',
        C_X2                  TYPE X VALUE '0A',
        C_X3                  TYPE X VALUE '09',
        LC_ENTER(2)           TYPE C,
        LC_TAB                TYPE C.
    enter key
    CONCATENATE C_X1 C_X2 INTO LC_ENTER.
    TAB key
    LC_TAB = C_X3.

  • How to define new variable types in BPEL?

    Is there a way to define a new variable type directly in BPEL, without modifying any of the WSDL files used by Partnerlinks?
    Or to import an XSD with variable definitions?

    It depends on what you want to use the variable for. You may not need to do it yourself. Let's assume you have a main wsdl for your service that you can't change but it has the inputs and outputs already defined.
    In the middle you want to grab the input and shove it into a database table. You can create a new partner link. Rright click in the swim lanes on the BPEL page and pick the little database icon. Go through the steps to link to the db via an insert or package. You will need a db connection to do this.
    jdeveloper will create the partner link wsdl and schema for you to match the table or the ins/outs of the package/procedure automatically.
    Then drag an invoke onto the page and pull the arrow to your new partner link. Use the magic wand on the invoke screen to create the input/output variables.
    Then you can use a transformation or assign/copy to pull the data from the input message variable of the main wsdl into the input variable of your database wsdl.
    Or your situation may not be that complicated...if you click the little (X) on the edge of the box on the BPEL screen you can go through a picking process.

  • Documentation about variable types & their processing in i_step = 1, 2 etc.

    Hello experts,
    is there any documentation about variable types and their processing in i_step = 1, 2 etc.? I know there is note 492504 "Dependent customer exit-type variables", but I don't understand, whether a variable which is NOT "Ready for input" will be processed in i_step = 1 or not  (quote of SAP library: "i_step = 1: Call takes place directly before variable entry."). I experienced coincidentally, that some variables not "Ready for input" will be processed there and some not.
    Furthermore it is an error, isn't it? Why has a variable without input possibility to be processed before input? Is this really the case?
    Confused, any hints are welcomed!
    Regards M.L.

    for I_STEP = 1
    Call before the variable screen .
    for I_STEP = 2
    Call after variable entry. This step is only started up when the same variable is not input ready and could not be filled at I_STEP=1.
    for I_STEP = 3
    In this call, you can check the values of the variables. Triggering an exception (RAISE) causes the variable screen to appear once more. Afterwards, I_STEP=2 is also called again.
    for I_STEP = 0
    The enhancement is not called from the variable screen. The call can come from the authorization check or from the Monitor.
    There is a good HOW to Guide which explains the importance of I_STEP :
    http://service.sap.com/~form/sapnet?_SHORTKEY=00200797470000078090&_SCENARIO=01100035870000000112&_OBJECT=011000358700002762582003E
    Another from SDN:
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/events/bw-and-portals-05/five%20ways%20to%20enhance%20sap%20bi%20backend%20functionality%20using%20abap.pdf

  • Variable Type EXIT - Locking Transaction Data

    Dear all,
    I have to use a variable type Exit in the level to identify all cost centers for a planner and his corresponding boss (master data lookup). Now e.g.
    the planner has cost center 1 and 2 as possible single values. The boss has cost center 1, 2, 3,and 4 because he also is the boss of an other one.
    The result is now that the boss locks all cost centers 1,2,3 and four even if he only plans e.g. the cost center 4. In this way it is not possible for the planner to enter data for 1 or 2 the same time.
    Does anybody has an idea to solve this situation or how to lock only the values of the variable that is really in use?
    Thanks a lot
    Dieter

    Hi Dieter,
    Refer to Marc's comment in the below post that Planning layouts lock all data
    How to avoid SEM-BPS Lock entries
    Hence the best option would be to create a different Planning level for Cost center based on the need for planning.
    You could also explore the possibility of creating a BEx report wherein the data just needs to be viewed by the boss and not planned.
    Hope it helps
    Cheers
    Anurag
    Also take a look at this document to get some more insight into locking in BPS
    https://websmp102.sap-ag.de/~sapdownload/011000358700004574572003E/SEMBPSLocking.pdf
    Hope you have access to the service marketplace.
    Message was edited by: Anurag  Khungar

  • The best way to know if you a  data  in a table

    hello
    I have a doubt what 's the best way to know if you have a value in a table .For example I have a table called Vehicle , that have two rows id and name . Well I want to know before do somthing if the vehicle with mane '11111', exist or not .
    Nowadays i do this operation with a : select count ( id ) into num from vehicle;
    This is the best way ???
    THANKS

    Hello
    Well here's an alternative that may help in your situation. The idea is that you put all of your values that you will be testing for the existence of, in a collection. Then use INTERSECT to find out which of those are already present in the table.
    It may well turn out to be completely useless, but I'm trying to avoid working on what I am supposed to be working on, and I thought I'd try it out ;-)
    CREATE TABLE dt_test_vehicle(veh_name     VARCHAR2(20));
    INSERT INTO dt_test_vehicle values('1111');
    INSERT INTO dt_test_vehicle values('2222');
    INSERT INTO dt_test_vehicle values('4444');
    INSERT INTO dt_test_vehicle values('5555');
    INSERT INTO dt_test_vehicle values('6666');
    CREATE TYPE dt_tt_varchar2 IS TABLE OF VARCHAR2(20)
    set serveroutput on
    DECLARE
         ltt_Params     dt_tt_varchar2;
         ltt_Result     dt_tt_varchar2;
    BEGIN
         ltt_Params := dt_tt_varchar2();
         ltt_Params.EXTEND(4);
         ltt_Params(1) := '1111';
         ltt_Params(2) := '2222';
         ltt_Params(3) := '3333';
         ltt_Params(4) := '4444';
         SELECT
              veh_name
         BULK COLLECT INTO
              ltt_Result
         FROM
              (SELECT
                   veh_name
              FROM
                   dt_test_vehicle
              INTERSECT
              SELECT
                   column_value
              FROM
                   TABLE(CAST(ltt_Params AS dt_tt_varchar2))
         IF ltt_Result.COUNT > 0 THEN
              FOR li_Idx IN ltt_Result.FIRST..ltt_Result.LAST LOOP
                   dbms_output.put_line(ltt_Result(li_Idx));
              END LOOP;
         ELSE
              dbms_output.put_line('Nothing there, everything is good to go');
         END IF;
    END;Delete rows from the test table to see the changing results. The main reason I was thinking of this way of doing it was so you could handle your messages in one hit rather than having to have a separate exception for each parameter you are testing.
    HTH
    David
    Sorry, I just re-read your post, and you need to know if these parameters are NOT there, in which case you should give an error. In that case, you could change the INTERSECT for MINUS. If you have anything in the resulting collection, these are the parameters that are missing from the table.
    Message was edited by:
    david_tyler

  • Formula variable type amount

    Hi all,
    I created a formula variable type amount (so I can select my currency EUR), the user enters a value in the popup screen...
    but when I display this value, the currency is not displayed...
    I tested this also on another system, and I have the same problem.
    please advice,
    Joke
    we're on BI 7.0

    Hi Joke,
    1. Try to check by adding one amount keyfigure and execute the report and check whether the units are displaying for that keyfigure.
    2. Try to creat new formulia variable and add in formula with the below settings:
    Formulia Variable:
    processing type: user entry/replacing path.
    Variable entry is: Mandatory.
    Ready to Input: selected.
    Dimension Indicator: Amount.
    Currency: Eur.
    Default Value: 50,000.
    Add this formulia variable into the formula. Save the query and execute.
    I executed with the same setting which are mentioned above, it is displaying 50,000.00 EUR in my report.
    try this and let me know.
    Regards,
    Siva.

  • Is there any way to know that the UI has been updated due to a bind change?

    Hi
    For the given code snippet
    var c=Circle{
      centerX:10  
      centerY:10
      fill:Color.YELLOW
      onMouseClicked:function(event){
          c.fill=Color.RED;
    printNodeAsImage(filename) //to a file
    }

    Oops..Got posted before I could finish the query
    Hi
    For the given code snippet
    var c=Circle{
      centerX:10  
      centerY:10
      fill:Color.YELLOW
      onMouseClicked:function(event){
          c.fill=Color.RED;
          printNodeAsImage(c, filename) //to a file
    }Let us assume that printNodeAsImage(c,filename) saves the circle node with the current color to a file. See http://rakeshmenonp.wordpress.com/2010/04/26/javafx-1-3-save-as-image/ for a implementation of this function
    What we notice instead is that printNodeAsImage(c, filename) actually saves the node with the color YELLOW instead of RED. Is there any way to know deterministically when the UI has been updated due to a variable value change (or because of binding). (In this case the transition from Yellow to Red) So that we can perform other operations on the UI state - like saving it to a file
    Regards,
    Dhruva Ray

  • Is there any way to know that SOAP Client has closed and broken connection

    Hi,
    I am exposing a stateless session EJB using Oracle SOAP Webservices...and it is working smoothly.
    But when the SOAP client crashes or is closed, is
    there anyway that can know this happened on the server side i.e., the SOAP connection is lost.
    Thanks,
    Prashant

    Oops..Got posted before I could finish the query
    Hi
    For the given code snippet
    var c=Circle{
      centerX:10  
      centerY:10
      fill:Color.YELLOW
      onMouseClicked:function(event){
          c.fill=Color.RED;
          printNodeAsImage(c, filename) //to a file
    }Let us assume that printNodeAsImage(c,filename) saves the circle node with the current color to a file. See http://rakeshmenonp.wordpress.com/2010/04/26/javafx-1-3-save-as-image/ for a implementation of this function
    What we notice instead is that printNodeAsImage(c, filename) actually saves the node with the color YELLOW instead of RED. Is there any way to know deterministically when the UI has been updated due to a variable value change (or because of binding). (In this case the transition from Yellow to Red) So that we can perform other operations on the UI state - like saving it to a file
    Regards,
    Dhruva Ray

  • Is there any way to know the T-code from the screen?

    Hi friemds,
    it s a general question. but I found relavant for posting here.
    I saw our group friens giving some T-codes for spro functions (eg: SNRO, M/06), bbut how to know the transaction from path. i.e. If I go to condition types screen, there I could not see any transaction. is there any way to know the T-code from the screen?

    Hi,
    Listed here are the various ways you can find the list of transaction codes and their usage:
    Use transaction SE11 - ABAP Dictionary:
    Fill in the Database table name and click the Display button.
    - TSTC   table will contain all the Tcodes and
    - TSTCT table will contain all the Tcodes with Texts.
    Once you entered the screen, click in Top Menu - Utilities - Table contents - Display
    If you want to display all the transaction code (total - 57,048) you have to change the Fields: Maximum number of hits to 99999 (default 500).
    or
    Simply goto transaction SM01, although this tcode is to Lock/Unlock any transaction code, you can also view all the tcode available in the R/3 system from here.
    or
    Goto transaction SE93
    There are two ways where you can find the list of transaction codes in SE93.
    Method 1:
    You must be familiar with the starting characters strings for each of the R/3 application modules.
    Assuming you know that most Materials Management transaction codes start with MM.
    In the Fields: Transaction code, type in MM* and press the function key F4
    The list of transaction code starting with MM will be displayed.
    Method 2:
    On the Top Menu, click Utilities - Find - Execute and the first 500 transaction will be display.
    If want to display all the tcodes, make sure you remembered to change the Fields: Maximum no. of hits right at the bottom of the screen.
    I know a particular T Code and can enter and work on it.  How do I know what is the menu path for that T Code?
    Enter Search_SAP_Menu in the command box and when the pop box appears enter, the Tcode and it will give the nodes and menu path. 
    This is helpful only in case of SAP Menu not in case of SPRO - ie IMG.....
    Reward if Helpful,
    Regards,
    Archit.

  • Is there a way to know how many hours of work did a project demanded ?

    Is there a way to know how many hours of work did a project demanded (even if it was on multiple days, sessions or cross-working other projects)?
    I am using Adobe Premiere Pro CS6 on windows 7.
    Thaks,
    Mihai

    There is no feature for that in Premiere Pro.  I suggest that you keep a project log either in a spreadsheet, database, Notepad or Wordpad file, or a hand written one.
    You can file a feature request here:
    Adobe - Feature Request/Bug Report Form

Maybe you are looking for