Using a variable value

Hi there!
Please, first, promise not to laugh!
In the script, I wrote:
text_field.text = "yes";
var a:String = text_field.text;
At the beginning of a conditional logic statement I want to
use the value of this variable.
How should I write the condition?
I tried:
if (a == yes) {....
if (a = yes) {....
if (a == "yes") {....
if (a.length = 3) {....
Nothing works...
Maybe I'm too tired and... confused!
Please, put me back on the track.
I thank you in advance.
Best regards from Old Gerry

GerryIsHere,
> In the script, I wrote:
> text_field.text = "yes";
> var a:String = text_field.text;
I'm with you so far.
> At the beginning of a conditional logic statement I want
> to use the value of this variable.
> How should I write the condition?
The a variable is typed as a string, so its value must be a
string.
> I tried:
> if (a == yes) {....
Because "yes" does not appear in quotes, Flash will
interpret it as a
variable. Since you haven't declared a yes variable anywhere,
it's value
will be undefined or null, so your first condition compares a
with, say,
undefined, which evaluates to false.
> if (a = yes) {....
This isn't a comparison at all, actually. The single equals
sign is an
active operator that *sets* the value of one thing to
another. Here, you're
setting the value of a to, again, undefined (or perhaps
null).
> if (a == "yes") {....
This should do it. When you say nothing works, how are you
determining
that?
> if (a.length = 3) {....
Again, the single equals sign is killing it. You're trying
to set the
String.length property to a number, but the length property
is read-only.
Is it possible that text_field isn't a correct reference to
one of your
text fields? One of your text fields would have to have the
instance name
"text_field" (minus quotes) in order to be referenceable by
ActionScript.
David Stiller
Co-author, Foundation Flash CS3 for Designers
http://tinyurl.com/2k29mj
"Luck is the residue of good design."

Similar Messages

  • How to use bind variable value of one VO as initial value for other VO row?

    JDeveloper 10.1.3.3, ADF Faces, ADF BC
    Hi,
    I have two View Objects: one read only with several bound variables and another editable entity based. Correspondingly there are two ADF Faces pages: first contains search form based on the read-only VO and second create form based on the editable VO. The search form has several hidden fields for some of bound variables because they aren't edited directly by user. These fields are updated with PPR when user selects other search criteria from LOV.
    There is a command button in the first page that navigates to the second form. Is there any way to transfer values of bound variables from the first VO to the second VO as initial values of the new row?
    I tried to set custom controller for the second page and retrieve search criteria values from request parameter map but values from hidden fields are missing. I think because that these fields are updated by PPR. Of course I can add custom action method to the navigation button and in the method put these values to request parameter map but I hope there is better solution.
    Thanks,
    Marius

    To summarize, given a bind variable value for one VO, on creating a row in a second VO, for 1 of the attributes of the second VO, you want to use the first VO's bind variable value. Correct?
    A potential solution ADF BC driven:
    1) Ensure you have an AppModuleImpl for your AM
    2) Ensure you have a ViewImpl for your 1st VO (where the bind variable will exist) - lets refer to that VO as "Alpha"
    3) Ensure you have a ViewRowImpl for your 2nd VO (the one you want to default the value in) - lets refer to that VO as "Beta"
    4) For your first VO "Alpha" create the bind variable (say pValue)
    5) In your second VO "Beta" ViewRomImpl add following code:
    @Override
    protected void create(AttributeList attributeList) {
      super.create(attributeList);
      AppModuleImpl am = (AppModuleImpl)this.getApplicationModule();
      String someValue = am.getAlphaView1().getpValue();
      setSecondVOAttr(someValue); // change this code to whatever your setter is for the field you want to initialize.
    }Hope this helps. Let us know how you go.
    Regards,
    CM.

  • Using a variable value from when page was generated

    I have an application that can popup in separate windows multiple instances of the same Apex page. At the time of generation of the first instance, P1_key is 100. The user then opens a second instance of the same apex page with the current value of P1_key equal to say 200. If the user submits the first instance of the page, I want to use the previous value of P1_key, 100, to update that row in the database. The application wants to use the current value of P1_key, which is 200. So the user thinks he's updating record 100, but, in effect, is updating record 200. How do I get Apex to recognize the value of a variable at the time the page instance was generated, even though the current value of the variable may have changed due to a second (or third) instance of the page having been opened?

    Could I open the page in its own session possibly, in order to prevent Apex State management from always utilizing the "current" value?

  • Getting Error when we are using same variable value in parallel flows

    Hi All
    In one of the case we will get a Zipped folder in which we have 4 different types of files . we will have date in folder name . we want to insert that date in all the 4 types file data . so we are storing the filedate in a variable and we are planning to
    insert that variable value in all the 4 types files . when we are loading data  in parallel of those 4 files (if the folder size is less than 20MB there is no problem )  we are getting the below error . If we run them in Sequence it is working
    fine without error . Please suggest what will be the issue .
    [OLE DB Destination [132]] Error: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80004005.
    An OLE DB record is available.  Source: "Microsoft SQL Server Native Client 10.0"  Hresult: 0x80004005  Description: "Invalid character value for cast specification".
    [OLE DB Destination [132]] Error: There was an error with input column "filedate" (523) on input "OLE DB Destination Input" (145). The column status returned was: "The value could not be converted because of a potential loss of data.".
    [OLE DB Destination [132]] Error: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR.  The "input "OLE DB Destination Input" (145)" failed because error code 0xC0209077 occurred, and the error row disposition on "input "OLE
    DB Destination Input" (145)" specifies failure on error. An error occurred on the specified object of the specified component.  There may be error messages posted before this with more information about the failure.
    [SSIS.Pipeline] Error: SSIS Error Code DTS_E_PROCESSINPUTFAILED.  The ProcessInput method on component "OLE DB Destination" (132) failed with error code 0xC0209029 while processing input "OLE DB Destination Input" (145). The identified
    component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will cause the Data Flow task to stop running.  There may be error messages posted before this with more information about the
    failure.
    Surendra Thota

    Hi Surendra,
    It might be a data type casting issue caused by memory pressure. Please try to use the minimal length of data types that meet the requirements. Besides, if the package runs in 32-bit runtime mode, try to execute it in 64-bit runtime mode. In addition, if
    the issue is not happening in the production environment, I suggest that you install the latest Service Pack for your SQL Server 2008 (R2).
    Regards,
    Mike Yin
    If you have any feedback on our support, please click
    here
    Mike Yin
    TechNet Community Support

  • BEx Analyzer: Use Of Variable Values For Planning Sequence

    Hi experts,
    I want to start a planning sequence using a button item in a BEx Analyzer workbook. The planning sequence itself is defined with several variables, that are input ready. The same variables are used in BEx Queries that are bound to DataProviders in the workbook. Therefore the variables are filled by the user, if the workbook has been started. If the user wants to start the planning sequence, that is defined on the button item, the same variable values (which the user has already set in the beginning) should be used. But I didn't find a way to fill planning sequence variable from variables (like it is possible in the web interface using the DataBinding function). It seems, that it is only possible to set the variable with static values, that are defined in the button item. Am I erring in this point?
    Anyone here who can help me regarding this issue?

    Eitan Ohayon wrote:
    Why did you raise this question?,did you face any problem?
    Hi Eitan,
    The problem was, that the planning sequence worked fine in web but not in analyzer. The system told me in web, that several records had been read, created, changed and deleted. System messages in BEx Analyzer always indicated zero reads, creations, reads and deletions.
    Using your idea to set breakpoint in the INIT_EXECUTION method gave me the information, that all variables are not set or set with initial values (like '0000' for fiscal year). This seems to be the reason for my problem. Now I've reduced the planning sequence definition on the button only to that variables, that are really needed. Furthermore I defined the Command Range to get dynamic values for the variables from the excel sheet grid. So it seems to work.
    Thank you for your help!

  • How to use a variable value set from custom dll in dataset

    Hi,
    I've inherited a SSRS report that I need to add some functionality to.  I'm setting a variable, ADAuthorizations, from a custom dll 
    ADAuthorizations is a string of all AD groups a user is a member of and I need to use this as a filter in a dataset.  I've tried using this variable as shown in the query below but I'm getting an error "The expression used for the parameter 'Unit_Permissions"
    in the dataset "Unit_Permissions" includes a variable reference.  Variable values cannot be used in query parameter expressions."  Is there another way I should go about doing this?   
    = "SELECT UnitCode, UnitName " &
      "FROM dbo.VW_Unit_Permissions " &
      "WHERE UserId in (" & Variables!ADAuthorizations.Value & ")" &
      "ORDER BY UnitName "
    Thanks,
    Robert

    Please follow below steps,
    1. Create a custom code to get all the users in an array,
    Public Function getUserName() As String()
       dim Users(1) as string
       Users(0) = "user1"
       Users(1) = "user2"
    return Users
    End Function
    2. Create dataset using the below query,
    SELECT UnitCode, UnitName FROM dbo.VW_Unit_Permissions ORDER BY UnitName
    3. Add a parameter @User and set properties : (Datatype as text, Allow multiple values, Visible)
    Under "Available Values" select specify values and set the label and values as expression.
    =Code.getUserName()
    4. Similarly for "Default values" as
    =Code.getUserName()
    5. Go to tablix properties and select the filter tab and set the properties as below,
    - Select Expression "UserId" i.e =Fields!UserId.Value
    - Operator as "IN"
    - Value as =Parameters!User.Value
    6. Preview the report.
    Regards, RSingh

  • Using a variable value in CDATA for generating an XML type in Oracle

    Hello,
    I have prepared a function given below where I have some input variables & I have to generate one XML with those input variables as tag attribute value:
    create or replace function NEW_PROJECT_DETAILS
    ( p_ReferenceId in varchar2 ,
    p_Project_No in varchar2,
    p_Project_Name in varchar2,
    p_Project_Desc in varchar2 ,
    p_Project_Type in varchar2,
    p_Project_Location in varchar2,
    p_Project_Status in varchar2 )
    return xmltype
    as
    payload xmltype;
    begin
    dbms_output.put_line('Payload Started');
    payload:= xmltype('<?xml version="1.0" encoding="UTF-8"?>
    <ProjectDetails>
    <RefID>'||p_ReferenceId||'</RefID>
    <ProjectNo>'||p_Project_No||'</ProjectNo>
    <ProjectName>'||p_Project_Name||'</ProjectName>
    <ProjectDesc>'||p_Project_Desc||'</ProjectDesc>
    <ProjectType>'||p_Project_Type||'</ProjectType>
    <ProjectLocation><![CDATA[p_Project_Location]]></ProjectLocation>
    /* <ProjectLocation>'||p_Project_Location||'</ProjectLocation> */
    <ProjectStatus>'||p_Project_Status||'</ProjectStatus>
    </ProjectDetails>');
    dbms_output.put_line('Payload Comp1');
    return payload;
    end;
    This procedure works absolutely fine.
    Now the problem which I am having is that the variable p_Project_Location has value like "6747:BBO&M SBV".
    Due to the '*&*' in that value I have to use CDATA. But i dont know how to pass this variable directly in the CDATA in the XML.
    Please help me with this asap.
    Thanks & Regards,
    Divya Aggarwal
    Edited by: 784414 on Dec 2, 2010 4:15 AM
    Edited by: 784414 on Dec 2, 2010 4:16 AM

    Hi,
    If you absolutely want to use a CDATA section, then :
    payload:= xmltype('<?xml version="1.0" encoding="UTF-8"?>
    <ProjectDetails>
    <RefID>'||p_ReferenceId||'</RefID>
    <ProjectNo>'||p_Project_No||'</ProjectNo>
    <ProjectName>'||p_Project_Name||'</ProjectName>
    <ProjectDesc>'||p_Project_Desc||'</ProjectDesc>
    <ProjectType>'||p_Project_Type||'</ProjectType>
    <ProjectLocation><![CDATA['||p_Project_Location||']]></ProjectLocation>
    <ProjectStatus>'||p_Project_Status||'</ProjectStatus>
    </ProjectDetails>');Alternatively, you can escape non valid characters with DBMS_XMLGEN.CONVERT, e.g. :
    payload:= xmltype('<?xml version="1.0" encoding="UTF-8"?>
    <ProjectDetails>
    <RefID>'||p_ReferenceId||'</RefID>
    <ProjectNo>'||p_Project_No||'</ProjectNo>
    <ProjectName>'||p_Project_Name||'</ProjectName>
    <ProjectDesc>'||p_Project_Desc||'</ProjectDesc>
    <ProjectType>'||p_Project_Type||'</ProjectType>
    <ProjectLocation>'||dbms_xmlgen.convert(p_Project_Location)||'</ProjectLocation>
    <ProjectStatus>'||p_Project_Status||'</ProjectStatus>
    </ProjectDetails>');which outputs :
    <?xml version="1.0" encoding="UTF-8"?>
    <ProjectDetails>
    <RefID>1</RefID>
    <ProjectNo>1</ProjectNo>
    <ProjectName>PRJ1</ProjectName>
    <ProjectDesc>This is project 1</ProjectDesc>
    <ProjectType>P</ProjectType>
    <ProjectLocation>6747:BBO&amp;M SBV</ProjectLocation>
    <ProjectStatus>S</ProjectStatus>
    </ProjectDetails>Any basic XML parser should then convert back escaped characters when processing the document.
    You can also use SQL/XML functions, which will take care of that automatically.
    For example :
    SELECT appendChildXML(
            XMLType('<?xml version="1.0" encoding="UTF-8"?><ProjectDetails/>'),
            XMLForest(
             '1'                 as "RefID",
             '1'                 as "ProjectNo",
             'PRJ1'              as "ProjectName",
             'This is project 1' as "ProjectDesc",
             'P'                 as "ProjectType",
             '6747:BBO&M SBV'    as "ProjectLocation",
             'S'                 as "ProjectStatus"
    FROM dual;or,
    SELECT appendChildXML(
            XMLType('<?xml version="1.0" encoding="UTF-8"?><ProjectDetails/>'),
            XMLForest(
             '1'                 as "RefID",
             '1'                 as "ProjectNo",
             'PRJ1'              as "ProjectName",
             'This is project 1' as "ProjectDesc",
             'P'                 as "ProjectType",
             XMLCData('6747:BBO&M SBV') as "ProjectLocation",
             'S'                 as "ProjectStatus"
    FROM dual;

  • How to use bind variable value for table name in select statement.

    Hi everyone,
    I am having tough time to use value of bind variable for table name in select statement. I tried &p37_table_name. ,
    :p37_table_name or v('p37_table_name) but none worked.
    Following is the sql for interactive report:
    select * from v('p37_table_name') where key_loc = :P37_KEY_LOC and
    to_char(inspection_dte,'mm/dd/yyyy') = :P37_INSP_DT AND :p37_column_name is not null ;
    I am setting value of p37_table_name in previous page which is atm_state_day_insp.
    Following is error msg:
    "Query cannot be parsed, please check the syntax of your query. (ORA-00933: SQL command not properly ended) "
    Any help would be higly appreciated.
    Raj

    Interestingly enough I always had the same impression that you had to use a function to do this but found out from someone else that all you need to do is change the radio button from Use Query-Specific Column Names and Validate Query to Use Generic Column Names (parse query at runtime only). Apex will substitute your bind variable for you at run-time (something you can't normally do in pl/sql without using dynamic sql)

  • How to use the variable value "ALL"

    Hello all,
    I'm trying to use the value "all" for a selection variable in a Web Interface so that to have no restrictions for that specific variable and that all the rows are shown on the interface.
    Unfortunately it does not seem to be working because when I select the value "all" the system seems to go back to the latest rows saved under a specific value for that variable and does not show all the rows saved under any variable's value.
    Anyone knows how to make this work? One option is to remove the variable from the web interface altogether, but that's my last option.
    Thanks in advance.
    Best regards,
    Francesco

    Hi Francesco,
    why is leaving out the variable your last option? If you want to select "all" then you don´t need a variable.
    Cornelia

  • Using a variables value as the name of another variable

    Hi, i'm new to java and i've been trying to write a little program. I was wondering whether it is possible to use the value of a variable as the name of another variable.
    This is what i have so far: When i run my java program numerous Animal objects are created with names like ani01, ani02, ani03. These objects have functions like getName() etc. When i type in one of these codes into the command line it gets stored in a variable called 'input'. Everything's fine up to here.
    But i need a way to access the correct Animal from my input. instead of doing countless switch statements on the input.
    If i type "ani02" i want it to return the animals name by calling ani02.getName()...
    how do i do this? i'd appreciate any help. thanks.

    If you were doing this based on user input, then you
    wouldn't have to do a lot of typing. Mmm?I'm sorry i don't get your meaning... ? I am doing this based on user input am i not?
    All i want to do is access the correct Animal object depending on the user's input... so if they type in ani01 it would return 'Elephant' (or whatever) using ani01.getName().
    Maybe i'm going about this the wrong way or something?.. I have about 30 animals. they each have a name, continent, quantity. I have an Animal class that has functions like getName(), setName() etc. When the program starts, 30 objects are created
    Animal ani01 = new Animal("Elephant",3000,"India");
    Animal ani02 = new Animal("Panda",200,"China");etc...
    I want to be able to get information about any one of these animals by typing something at the command line...
    so i type in something (i just thought the name of the object would be the best thing to type in) and i get the info about elephants (or whatever) from the relevant object.
    how would you do this?

  • REPLACE command using passed variable values does not work

    Hi SDN Community
    Are you aware of the replace command not working when passing strings as opposed to a variable containing the string.
    For example:
    This works:
         replace '>JUL 2008</a>' with I_TEXT_VALUE into
                    I_TEXT_VALUE_REPLACE.
    This dosen't work:
         replace I_TEXT_VALUE_MATCH with I_TEXT_VALUE into
                     I_TEXT_VALUE_REPLACE.
    where I_TEXT_VALUE_MATCH = '>JUL 2008</a>'
    where I_TEXT_VALUE =  '>JUL 2008<BR>Actual</a>'
    Thank you.
    Simon

    Hi SDN Community,
    The following method was used to derive the same outcome required as per the REPLACE command.
          LEN_REPLACE = STRLEN( C_CELL_CONTENT ) - 12.
          I_TEXT_VALUE_REPLACE = C_CELL_CONTENT.
        replace I_TEXT_VALUE_MATCH with I_TEXT_VALUE into
                    I_TEXT_VALUE_REPLACE.
          I_TEXT_VALUE_REPLACE = I_TEXT_VALUE_REPLACE+0(LEN_REPLACE).
          CONCATENATE I_TEXT_VALUE_REPLACE I_TEXT_VALUE INTO
                        I_TEXT_VALUE_REPLACE.
          C_CELL_CONTENT = I_TEXT_VALUE_REPLACE.
    Thank you.
    Simon

  • Is it possible to use a variable value

    with pop up message. Like that:
    message 'Already recorded. Please type another number. The next possile number is ' PossibleNUmberVariableName type (I).
    is such a thing possible?
    Please help. I neen it.
    Thanks.
    deniz.

    yes for every message there will be 4 message variables.
    PossibleNUmberVariableName type (I).
    message i888(sabapdocu) with 'Already recorded. Please type another number. The next possile number is ' PossibleNUmberVariableName.
    where sabapdocu is a message class that was all ready availble, may be u need to use another one after creating. That message will contain 4 message variables &1 &2 &3 &4' like this.

  • Use Variable value name???

    Is there a way to use a variable value's name to load data?
    What mean is, if I have a variable called "var1" and I load
    "var1" from an XML file so the value of "var1" == "XYZ", is there a
    way to use the value "XYZ" to load data to a Dynamic textbox call
    "XYZ"?
    var1 = "XYZ"
    ( XYZ is a dynamic textbox on the stage and I need to load
    XYZ with incoming data )
    Example: XYZ = "What ever text I have"
    ( but XYZ is really the vaue of "var1")
    Thanks - Gary

    yes, you can resolve strings into objects by using array
    notation. for example, if XYZ is the instance name of a textfield
    on the _root timeline and var1="XYZ", you can use:

  • Using Variable values to populate virtual key figure

    Hi Gurus,
    I want to populate virtual key figure in my report. I am using BADI for this. To populte VKF I want to use the variable values in my calculation. For eg. variable name is ZCAL_MON based on 0CALMONTH. When the user enters some value in this variable say 03.2010 I want to populate VKF for the last 12 months (sum for a period 04.2008 to 03.2009). I have written a customer exit in CMOD for variables but for vkf I am using BADI. Can anyone tell me how do I pass the variable value in populating vkf and also how do I total for the last 12 months?
    Utpal

    Hi,
    Did you find a solution. I'm just looking for the same thing.
    best regards..

  • Need to place a variable value at the end of report heading in BI 7

    Dear All,
    We have to place a variable value at the end of the report heading and the value should get refreshed whenever we change the variable by using "Change Variable Value". I have created a macro and the value will get triggered unless and until we click on any where on a sheet. But, we want to automate this one by using a macro.
    Ex: Quarterly TA Host Country Details As Of "Variable Date" Variable is created on TA Date characteristic. User can enter date on Pop up window box at the time of changing a variable TA Date. We need changed date at the end of the Report heading Qua----
    Please suggest me on how to place variable value at the end of report heading by using a macro.

    No need to use Macro. You can use text variable.
    Goto the Query Description and click on the Text variable icon.
    Create a text variable of processing type as REPLACEMENT PATH and replace it with the characteristic for which you have a ready for input variable that will be eneter by the user.
    This will populate the text variable with the value entered by teh user.
    Use this text variabkle along with the Query Description. So your description will look something like REPORT_TITLE&TXT_VAR&
    Hope this helps.

Maybe you are looking for

  • Whats the difference between these two queries ? - for tuning purpose

    Whats the difference between these two queries ? I have huge amount of data for each table. its takeing such a long time (>5-6hrs). here whice one is fast / do we have any other option there apart from listed here.... QUERY 1:    SELECT  --<< USING I

  • How do I erase a Passport hard drive?

    I am converting a 500 GB Passport drive from my back up disk to the disk for my iTunes. How to erase the disk wasn't obvious. I moved the contents to trash, but I'm having no luck "securely emptying" that trash. The trash queues up, but then the empt

  • Cannot Sign in to Ebay ONLY problems, cache, cookies, firewall, what happened???

    Hi and thanks in advance for anyone who can help with any suggestions. I downloaded the new version of firefox a few weeks back. The next day I noticed I could not sign in to my Ebay account. I can go anywhere else on the internet and all my sign in/

  • HardDrive/Startup Disk Disapeared

    5 year old Mac Mini with little use, whilst installing new HP printer software got spinning wheel- restarted and got blinking folder & question mark Went through all recommended restart procedures no joy, did a restart from system disk ,- disk utilit

  • LMS 3.2.1 with WS-C4500X-16 (Supported Device)?

    Hi, is the device WS-C4500X-16 Supported in LMS 3.2.1? i tried to serch it in the Supported Device Table for LMS 3.2, but i didnt found the exact module (4500x). here are the link for the: Supported Device Table for LMS 3.2 thanks dawit