Executing a boolean condition stored in component variable

Hi there everyone (posted this earlier on my browser but
didn't seem to come
thru, so apologies if this appears twice)
I have created a component variable called booleanCondition
which contains
an expression like (a || b)
I would then like to perform a conditional statement like:
a=0;
b=1;
if (booleanCondition == true){
//execute code
but i don't seem to be able to get Flash to execute the
contents of the
variable...it is just saying booleanCondition is holding (a
|| b)
Can anyone save me from my nightmare!!!
Cheers
Adam :)

booleanCondition would have to be a function which returned
the result of a
|| b
function booleanCondition(){
return Boolean(a || b);
if (booleanCondition() == true){
//execute code
"Adam West" <[email protected]> wrote in message
news:f2h8kt$eok$[email protected]..
> Hi there everyone (posted this earlier on my browser but
didn't seem to
> come thru, so apologies if this appears twice)
>
> I have created a component variable called
booleanCondition which contains
> an expression like (a || b)
>
> I would then like to perform a conditional statement
like:
>
> a=0;
> b=1;
> if (booleanCondition == true){
> //execute code
> }
>
> but i don't seem to be able to get Flash to execute the
contents of the
> variable...it is just saying booleanCondition is holding
(a || b)
>
> Can anyone save me from my nightmare!!!
>
> Cheers
>
> Adam :)
>

Similar Messages

  • Is there a way to 'latch' a boolean condition when using local variables? Help!

    Hello all
    I've made LOTS of progress on my vi over the weekend and even today.  I've been battling with a project with this scope:
    1.  Read temperatures from 24 locations (6 banks of four thermocouples).
    2.  Set individual channel temperature upper limits
    3.  Output temperatures, elapsed time and time stamp to file in 5 minute increments AND write data when an overtemperature condition occurs.
    4.  Use NI-switch to shut off a motor related to each of the 6 banks of thermocouples independently
    5.  Be able to start/stop elapsed timers on each of the 6 banks based on user input (start/pause) OR conditions (pause at overtemperature)
    6.  Be able to reset those elapsed timers with user input as well.
    I've gotten 1-4 working nicely (although my example included has the DAQ assistant replaced with random number generation) and the NI-switch cases replaced with a simple boolean indicator.
    My problems lie in two areas now.  First, I need the switch condition AND the 'pause time' to be 'latched' when an overtemperature is reached and NOT continue operation until user input.  Basically, when the motor relay is triggered to shut the motor off, I need the timer to stop with it and not restart when the input condition changes (in this case, when the thermocouple drops below the control temperature) until an operator tells it to resume.  I also need the switch condition to stay true so that my 1160 isn't switching back and forth every iteration until the temperature drops.
    You'll notice there's 5 'elapsed time' express VI's in conditional loops on there--and one time structure in a parallel while loop.  The outside structure is the way I'm heading as it retains the value in the elapsed timer when paused.  This is critical to the test!  All 5 of those elapsed time express VI's will be leaving in favor of more of those outside loop structures.  My issue with the outside timing loop structure is that I can't figure out how to 'reset to zero' with a user input like you can with the express VI's, and that it outputs only ms data rather than a HH:MMS format (not a complete deal breaker but would be nice).
    Please, anyone in the know, I need to button this up so I can get it implemented soon.  My old VI which is currently running the tests is far too user-unfriendly for most of the users to handle and the output to file is a wreck...  THANKS so much in advance.
    Ralph
    Still confused after 8 years.
    Attachments:
    temperatures.vi ‏730 KB

    I've looked up the enum constant and am completely baffled as to how to use this to do what I'm trying.  Can you shed a bit more light on the subject?
    Still confused after 8 years.

  • How to execute a ruby command stored in a variable in powershell

    I am executing a command of the form rake
    drive:unit_tests:load_data parameters here'. I get the erroris not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.`
    I used the code in my ps1 file
    $dat1 = one ruby command | Out-String
    # $dat1 will contain the value - rake drive:unit_tests:load_data
    $dat2 = " parameters here"
    $dat3 = $dat1 + $dat2
    & $dat3

    Hiho,
    try running this from the directory you installed Ruby into (or set the location to that directory before that step).
    Cheers,
    Fred
    There's no place like 127.0.0.1
    Thanks. I'll try that link now. But, I 'd like to know why the command works when I copy paste / type it, but not when I store it in a variable and then execute it.
    When you copy/paste or type it into the console command line, the parser is interpreting it in
    Command Parsing Mode.  
    When you read it back from a variable, the parser is interpreting it in
    Expression Parsing Mode.
    This article by Keith Hill explains more about the differences:
    http://rkeithhill.wordpress.com/2007/11/24/effective-powershell-item-10-understanding-powershell-parsing-modes/
    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "

  • ABAP-Logic/Command: Execute An Expression Stored In A Variable

    Consider the following code - <b>Is it possible to execute the statement/expression stored in variables expression1, expression2 and expression3?</b> The result should be:
    sum = 5 , subname = 'First' & i_output should be sorted by lifnr and ebeln.
    *---DATA DECLARATIONS
    DATA: sum         TYPE i,
          op1         TYPE i,
          op2         TYPE i,
          name        TYPE string,
          subname     TYPE string,
          offset      TYPE i,
          expression1 TYPE string,
          expression2 TYPE string,
          expression3 TYPE string.
    DATA: BEGIN OF i_output OCCURS 0,
          lifnr TYPE lfa1-lifnr,
          ebeln TYPE ekko-ebeln,
          ebelp TYPE ekpo-ebelp,
          END OF i_output.
    *---BUILD EXPRESSION 1
    op1 = 2.
    op2 = 3.
    expression1 = 'sum = op1 + op2'.
    *---BUILD EXPRESSION 2
    name   = ' First Name'.
    offset = 5.
    expression2 = 'subname = name+1(offset)'.
    *---POPULATE ITAB I_OUTPUT
    MOVE: '111111' TO i_output-lifnr,
          'PO1'    TO i_output-ebeln,
          '010'    TO i_output-ebelp.
    APPEND i_output.
    MOVE: '111511' TO i_output-lifnr,
          'PO1'    TO i_output-ebeln,
          '020'    TO i_output-ebelp.
    APPEND i_output.
    MOVE: '111111' TO i_output-lifnr,
          'PO3'    TO i_output-ebeln,
          '010'    TO i_output-ebelp.
    APPEND i_output.
    MOVE: '114111' TO i_output-lifnr,
          'PO2'    TO i_output-ebeln,
          '010'    TO i_output-ebelp.
    APPEND i_output.
    MOVE: '111121' TO i_output-lifnr,
          'PO2'    TO i_output-ebeln,
          '020'    TO i_output-ebelp.
    APPEND i_output.
    CLEAR i_output.
    *---BUILD EXPRESSION 3
    expression3 = 'sort i_output by lifnr ebeln'.
    Thanks in advance!

    > You can achieve this by generating a subroutine pool
    > dynamically, passing the code lines (expressions) as
    > an internal table. Here is the syntax:
    >
    > GENERATE SUBROUTINE POOL itab NAME name.
    >
    > Hope this helps,
    > Bhanu
    Hey Banu, thanks!
    Message was edited by: Sam

  • Executing a Arithmatic formula stored in Variable

    Hi all,
      I need solution to execute a arithmatic operation which is stored in a variable.
    For Example:
    data : var type string.
    var = ABS('-3').
    Now by means of the variable var i need to get the absolute value of -3
    ie my output should be 3 if i print the variable "var".
    Please help.
    Regards,
    Vijayakumar

    Hello,
    Do like this.
    REPORT ZV_SDN_3 .
    DATA: STR TYPE STRING.
    DATA: STR1 LIKE STR,
          INT TYPE I,
          LEN TYPE I.
    STR = ABS('-3')..
    LEN = STRLEN( STR ).
    DO LEN TIMES.
      IF NOT STR+INT(1) IS INITIAL.
        IF STR+INT(1) CA '0123456789'.
          CONCATENATE STR1 STR+INT(1) INTO STR1.
        ENDIF.
      ENDIF.
      ADD 1 TO INT.
    ENDDO.
    WRITE: STR1.
    Hope this will solve ur issue.
    Cheers,
    Vasanth

  • Problem in calling of stored procedure with variable parameters

    Hello!
    When we try to call our stored procudure with variable parameter (year and month) we receive various errors.
    Here's the dynamic package script code:
    DEBUG(ON)
    PROMPT(SELECTINPUT,,,"Please select time for restatement",%TIME_DIM%)
    TASK(Execute formulas,USER,%USER%)
    TASK(Execute formulas,APPSET,%APPSET%)
    TASK(Execute formulas,APP,%APP%)
    TASK(Execute formulas,SELECTION,%SELECTIONFILE%)
    TASK(Execute formulas,LOGICFILE,%APPPATH%\..\AdminApp\%APP%\zbpc_to_fm.lgx)
    TASK(Execute formulas,RUNMODE,1)
    TASK(Execute formulas,LOGICMODE,1)
    TASK(Execute formulas,SIMULATION,1)
    TASK(Execute formulas,CHECKLCK,0)
    Our logic script file (zbpc_to_fm.lgx) code is:
    *RUN_STORED_PROCEDURE=ztest('%TIME_SET%')
    *commit
    The problem occures while transferring the variable parameter %TIME_SET% value.
    How can we correctly transfer the selected value of TIME_SET into the procedure?

    Everything in the debug log looks correct -- the most important lines are the ones indicating the values passed from the user's response to the PROMPT(SELECTINPUT...)
    INFO(%CATEGORY_SET%, BUDGET)
    INFO(%ENTITY_SET%, 1733)
    INFO(%FUND_SET%, )
    INFO(%PROJECT_SET%, )
    INFO(%TIME_SET%, 2008.NOV)
    Are you certain that the stored proc is processing the input parameter for time correctly, when you run it directly in MS Mgmt Studio?
    What error messages do you see running it from BPC?
    By "customized user authorities" do you mean that the time dimension is secured, and this user has access only to 2008.total and its descendants? If that's the case, the user should be able to see only those members in the action pane / current view, but the SELECTINPUT prompt should only show the base members (and not the year total and quarters). I'm still confused as to why all 12 + 4 + 1 members are passed through to the stored proc.

  • What is the best way to execute immediate particular sql stored in a table

    I have a string variable containing row_ids eg "12,24,35,23"
    and a table
    row_id, sql
    1 , "insert into some_table values(23,'Happy');"
    6 , "insert into some_other_table values(24,'Sad');"
    12 , "insert into some_table values(23,'Crazzzy');"
    15 , "insert into some_other_table values(23,'Old');"
    23 , "insert into another_table values(23,'Left');"
    24 , "insert into stuff_table values(23,'Gold');"
    30 , "insert into old_table values(23,'Even');"
    35 , "insert into archive_table values(23,"True");"
    And I need to write a plsql function that takes the list of row_ids as an argument and executes the sql statements stored in the table that matches.
    I am trying a combination of cursor and execute immediate statements to do it at the moment but suspect I am being very inefficient. So any suggestions or examples of similar code anyone knows about would be hugely appreciated.
    Cheers
    Reuben

    Not sure why anyone would be doing such a thing as storing their SQL in a table and wanting to dynamically execute it (generally this is bad practice), but if you must...
    SQL> select * from testdata;
        SQL_ID SQL_TEXT
             1 insert into some_table values(23,'Happy');
             6 insert into some_other_table values(24,'Sad');
            12 insert into some_table values(23,'Crazzzy');
            15 insert into some_other_table values(23,'Old');
            23 insert into another_table values(23,'Left');
            24 insert into stuff_table values(23,'Gold');
            30 insert into old_table values(23,'Even');
            35 insert into archive_table values(23,'True');
    8 rows selected.
    SQL> set serverout on
    SQL> ed
    Wrote file afiedt.buf
      1  DECLARE
      2    v_ids VARCHAR2(4000) := '12,24,35,23';
      3    CURSOR cur_fetch IS
      4      SELECT sql_text
      5      FROM   testdata
      6      WHERE  sql_id IN (SELECT TO_NUMBER(REGEXP_SUBSTR (v_ids, '[^,]+', 1, rownum))
      7                        FROM   DUAL
      8                        CONNECT BY ROWNUM <= length(regexp_replace(v_ids,'[^,]*'))+1);
      9  BEGIN
    10    FOR s IN cur_fetch
    11    LOOP
    12      DBMS_OUTPUT.PUT_LINE(s.sql_text); -- For demo purposes show the sql text
    13      -- EXECUTE IMMEDIATE s.sql_text; -- In reality, uncomment this to execute the sql text
    14    END LOOP;
    15* END;
    16  /
    insert into some_table values(23,'Crazzzy');
    insert into another_table values(23,'Left');
    insert into stuff_table values(23,'Gold');
    insert into archive_table values(23,'True');
    PL/SQL procedure successfully completed.
    SQL>

  • Boolean Condition Expressions

    Unlike Condition Formats, Paragraphs, etc., Boolean Condition Expressions are apparently not stored in a linked list. In ExtendScript, you can get a list of the Expression names with this:
    var doc = app.ActiveDoc;
    var exprCat = doc.GetBuildExprCatalog();
    This gives you an array of strings containing the Expression names. I am not sure what the FrameScript or FDK equivalents are, but I assume there is a way to do this.
    Once you have the list, you can get each definition by doing this:
    for (var i = 0; i < exprCat.length; i += 1) {
        var expr = doc.GetBuildExpr (exprCat[i]);
        Console ("Name: " + exprCat[i] + " Definition: " + expr);
    I hope this will helpful to someone in the future. Please let me know if you have any questions or comments. Thank you very much.
    Rick

    Hello,
    You can better use the condition Exists (SQL Query returns at least one row)
    In expression 1 you would put : select GROUP from pl_department where userid = :APP_USER;
    The problem you are facing is that your code is going into exception. If you really want to keep your code you can adapt it like:
    DECLARE
    t1 varchar2(20);
    BEGIN
    select GROUP into t1 from pl_department where userid = :APP_USER;
    if ((t1 = '-') OR (t1 is null) OR (t1 = '') or (t1 = '%' || 'null%')) then
    return false;
    else
    return true;
    end if;
    EXCEPTION WHEN NO_DATA_FOUND THEN return false;
    END;
    But I would recommend my first suggestion.
    Regards,
    Dimitri
    http://dgielis.blogspot.com/
    http://www.apex-evangelists.com/
    http://www.apexblogs.info/
    REWARDS: Please remember to mark helpful or correct posts on the forum

  • Storing of cursor variables

    hi all,
    how to store the looped fetched statement values into the variable.
    for ex:
    open c1
    loop
    fetch a,b into x,y;
    my requirement is like i want to store x and y values into the variable which returns more than one row.
    after storing into the variable, i have to check for some condition if it satisfies then only i should write into the text file.
    please help me. how to store that fetched values into the variable.
    Thanks..

    Is your requirement to only write records to a file that meet certain requirements? If so, I'm with Andreas on this one; I don't see any reason why you couldn't write your SQL Query is such a way that it excludes these records rather than select all records and then filter out the desirable ones. As a wise old Oracle Developer once said;
    >
    Always do as much as you can in SQL so you only have to do a little in PL/SQL.
    >
    If you follow this philosophy, your PL/SQL programs will be faster, more efficient and easier to maintain. ;)
    Hope this helps,
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.

  • Error when executing statement for table/stored proc

    Hi All,
          I am getting this error when executing IDOC to JDBC (Stored Procedure) Scenario.
         In my stored procedure I have three insert statements to insert rows in to 3 tables.
        This stored procedure is working fine for two insert statements i.e, 
             For this I have created data type for stored procedure with 10 elements and executed the scenario and was successfully running.
        when I added 3rd insert statement to stored procedure ie., when i added 5 more elements to the datatype (totally 15 elements) it starts giving the bellow error in Message Monitoring.
    <i><b>Exception caught by adapter framework: Error processing request in sax parser: Error when executing statement for table/stored proc. 'COGRP_TMP_PROC_1' (structure 'Statements'): java.sql.SQLException: General error</b></i>
    <i><b>Delivery of the message to the application using connection JDBC_http://sap.com/xi/XI/System failed, due to: com.sap.aii.af.ra.ms.api.RecoverableException: Error processing request in sax parser: Error when executing statement for table/stored proc. 'COGRP_TMP_PROC_1' (structure 'Statements'): java.sql.SQLException: General error</b></i>
       Note:- I have run the stored procedure  with three insert statements in Sql Server, and also by calling an external program also, and was working fine.
    <i><b> Note : Is there any structure needs to be follow when working with IDOC to Stored procedure.</b></i>
    I am struck up with the error, can any body resolve this issue.
    Thanks in Advance,
    Murthy

    Hi narasimha,
                      This seems to be any error due to incorrect query formation.In your receiver jdbc channel set the parameter logSQLstatement = true.you can find this parameter in the advanced mode. Using this parameter you will be able to see the sql query which is generated at runtime in the audit log in RWB.
    Regards,
    Pragati

  • How to execute .sql file in Stored Procedure?

    Hi,
    I have an urgent requirement, where i have to execute .sql file form Stored Procedure.
    This .sql file will have set of update statement. I need to pass value to this update statement.
    Kindly please help me.
    Regards,
    Irfan

    This is required as part of Data Migration where  i have to do 100 of table's update. Each time update table will defer, so its better to have in separate script file (.sql). Can u paste some sample/syntax to exceute .sql file from stored procedure. I am new to this PL/SQL.
    How have you determined that it's "better" to have seperate scripts?  I assume you mean the table name will "differ" (and not "defer" - I assume that's just because English isn't your first language? no problem - I think I understand what you're asking).
    So what I think you're asking is that you have dynamic table names but each table needs to be updated in the same way?
    Question: Why do you have tables with different names that all need the same process doing to them?
    Assuming it's a valid requirement (and 99% of the time doing dynamic coding implies it's not).... you could use dynamic code, rather than 'scripts'...
    e.g.
    create procedure update_table(tbl_name varchar2) is
    begin
      execute immediate 'update '||tbl_name||' set lastupdate = null';
    end;
    As you haven't bothered to provide a database version, any example code/data or explanation of what you're actually doing, you're not going to get any detailed answer.  Please do take the time to read the FAQ and post appropriate details so people can help you.

  • File to JDBC :Error when executing statement for table/stored proc.

    Hi,
    I am getting following error when i am trying to insert data into z-table using JDBC recr adapter.
    Error while parsing or executing XML-SQL document: Error processing request in sax parser: Error when executing statement for table/stored proc. 'ZTEST' (structure 'STATEMENT'): java.sql.SQLException: <u>[Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Invalid object name '<b>ZTEST</b>'.</u>
    But the database table name 'ZTEST' exists in the system.
    XML structure:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_RECR xmlns:ns0="http://urn:srini/FileToJDBC">
       <STATEMENT>
          <TEST action="INSERT">
             <table>ZTEST</table>
             <access>
                <ROLLNO>123</ROLLNO>
                <FIRSTNAME>ABC</FIRSTNAME>
                <LASTNAME>XYZ</LASTNAME>
             </access>
          </TEST>
       </STATEMENT>
    </ns0:MT_RECR>
    Regards,
    Srinivas

    Hi,
    I have changed my MT str but still getting the same error.Is it possible to insert/ update a z-table using JDBC adapter.
    XML str:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_RECR xmlns:ns0="http://urn:srini/FileToJDBC">
       <STATEMENT>
          <ZTEST action="INSERT">
             <access>
                <ROLLNO>123</ROLLNO>
                <FIRSTNAME>abc</FIRSTNAME>
                <LASTNAME>XYZ</LASTNAME>
             </access>
          </ZTEST>
       </STATEMENT>
    </ns0:MT_RECR>
    Regards,
    Srinivas

  • Problem in displaying images stored in Blob variable

    Hi all,
    I have a requirement where i need to retrieve the image stored in Blob variable in DB and display the image in JSP page.
    I have written the below code to achieve this, it works fine
    In JSP, I am calling a action in the <img tag
    <img src='downloadPhoto.page?method=getPhotoInBytes&accessoryModelPictures.id.accessoryNumber=${photo.id.accessoryNumber}/> In my controller class
    InputStream inputStream=accessoryPicturesLOB.getPicture().getBinaryStream();
    byte[] theBytes = new byte[inputStream.available()];
    inputStream.read(theBytes);
    response.setContentType("image/jpg");
    response.getOutputStream().write(theBytes);But the problem is, *if i right click on the image and select save picture as option i get a error saying "The system cannot find the specified file "*
    Can you please tell me what is wrong in my approach/code
    Is there any better approach to display image that is store in Blob variable ?
    Please help on this.
    Thanks in advance.

    You need at least to set the filename in the content disposition header.

  • Problem with execute SSIS package from stored procedure

    Hi,
    I would like to execute SSIS package from stored procedure. Therefore, I implemented sp which exec SSISDB.CATALOG.CREATE_EXECUTION method. When I try to test it from SSMS on remote server, I got error that
    I was able to solve by adding “WITH EXECUTE AS …”. Then I got another error: The server principal "Domain\user" is not able to access the database "SSISDB" under the current security context. On Internet, I found a couple post that describe
    how to access SSIS catalog (one of them by Ke Yang -
    http://blogs.msdn.com/b/mattm/archive/2012/03/20/ssis-catalog-access-control-tips.aspx). It didn’t help. I’m still getting the error message.
    How to debug this issue?
    Any suggestion?
    Thanks
    SQL Server 2014 BI

    SSMS does not propagate user credentials thus the error
    Arthur
    MyBlog
    Twitter

  • How to get BOOLEAN from STORED FUNCTION

    We are calling legacy PLSQL stored procedures and functions via named queries. This has worked fine so far, but there are some functions which return the type 'BOOLEAN'. e.g.
    FUNCTION some_function( some_argument IN NUMBER) RETURN BOOLEAN;
    Where the return type is BOOLEAN calling the named query fails with
    Local Exception Stack:
    Exception [TOPLINK-4002] (Oracle TopLink - 10g Release 3 (10.1.3.0.0) (Build 060118)): oracle.toplink.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: ORA-06550: line 1, column 13:
    PLS-00382: expression is of wrong type
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    Error Code: 6550
    A couple of threads have hinted that what we are trying to do is not possible:
    How to get BOOLEAN from STORED PROCEDURES
    Re: Creating Named Query: from OracleCallableStatement
    This would possibly be due to 'restriction in the OCI layer'. Can anyone help? Is there really now way to call a valid PLSQL stored function via a named query when the return type is BOOLEAN?
    thanks

    I can't comment on possible issues you might have with the driver, but if it can be done in JDBC, it should be possible in TopLink.
    TopLink has the StoredFunctionCall which extends the StoredProcedureCall but adds an unnamed ouput parameter in the first spot of its parameter list. You will need to get the databasefield and set its type to BOOLEAN ie:
      DatabaseField returnField = (DatabaseField)yourStoredFunctionCall.getParameters().firstElement();
            returnField.setName(name);
            returnField.setSqlType(Type.BOOLEAN);Be sure not to use the setType() method, as I believe TopLink will try to use the Type.BIT when a boolean class is used as the classtype.
    Best Regards,
    Chris

Maybe you are looking for