Button that execute block code.

Hello.
I want to execute a block of code with the push of a button but I cannot find the solution.
Attached is my vi. Any help is welcomed.
Thank you.
Solved!
Go to Solution.
Attachments:
ButtonExecution.vi ‏9 KB

Hello vakost;
A few points:
- The mechanical action of your Boolean is set to "Latch when Released". This means it will reset to False after being read once.
- You have no software control timing in your loop, this is what's known as a "greedy loop" and will execute as fast as it possibly can
Due to this, your True case will execute, but only once when you release the button, and the button will be reset to False before you likely see it because the loop is probably running many thousands of times per second. If you turn on execution highlighting to slow down the VI's execution to something you can observe, you should see the Boolean indicator turn on briefly before resetting.  You should still place a wait function inside your loop to slow things down to a reasonable speed, however.
A few other tips:
- You don't need to place the Boolean indicator inside the case structure if you want to update it in either case (you're using a value property node in the other case) - just place it outside the structure and wire the value you want to set out of the case
- You've created a while loop with no stop condition, and the VI has to be aborted to stop it.  Generally you'll want to give the user a stop button to exit the VI, aborting is almost never a good idea.
Regards,
- You don't really need the case structure in this circumstance, you could just wire the Boolean OK button directly to the indicator.  My impression is that this is just a demonstrative example or experiment in how case structures work, though, so that's probably alright.
Hope that helps!
Tom L.

Similar Messages

  • Using a button of type=button to execute java code

    Hello,
    I here what I need to do.
    - A user fill a form
    - He press submit
    - the button goes and execute some java code and then refresh the page (same page)
    Now I don't want to use a input=Submit, that call a a servlet that just update the information, and output to the servlet;
         out.println("<html>");
          out.println("<body>");
          out.println("<head>");
          out.println("<meta content=\"1; url=" + "SamePage.jsp" + "\" http-equiv=refresh>");
          out.println("</head>");
          out.println("</body>");
          out.println("</html>");Instead, I would like to do: <INPUT TYPE="button" VALUE="Close Window"   onClick="window.close();"> but instead of JavaScript in the onClick it would be JavaCode that would update the object (already instantiated in the JSP) and would then refresh the page.
    Is this possible?
    thanks.

    Hi,
    it is not possible because JSP code is executed server-side, while javascript code is executed client-side (in client's browser).

  • Include Button that executes PL/SQL procedure to SQL query based region

    I would like to add two columns to a SQL query region.
    These columns would not be sourced from the query, but rather would be used to execute a PL/SQL procedure.
    For example, I would like to have a manager approve or deny adding an additional employee to the department.
    There would be one button for APPROVE. And, one button for DENY.
    The PL/SQL procedure would execute to perform the required DML based upon the selected action (either APPROVE or DENY).
    A sample output would look like this:
    <APPROVE>, <DENY>, John Doe, Accountant
    <APPROVE>, <DENY>, Jane Doe, Accountant
    Is there any way to add a button to a SQL Query based report region where that button executes a stored proc? If so, what is the basic process for doing this?
    Thanks!
    -Reid

    Is there any way to add a button to a SQL Query based report region where that button executes a stored proc? If so, what is the basic process for doing this?Conditional page item? You can associate processes with buttons on a page

  • How can i disable a submit button and execute submit_action method on click

    Good Day,
    On my page I have a submit button that execute the submit_action method of the page backing bean that submit data captured on the page into a database and activate another class that send mail at the same time on a click of the submit button,the mail process takes a while before returning back to the page.I was able to disable the submit button to prevent the user from keep click while the process is running but the issue is on clicking the submit button it only disable the submit button without executing the submit_action method of the page backing bean.How can i disable the submit button and execute submit_method of the backing bean at the same time.
    Thanks in advance.

    I tried this out on one of my pages to see if it works.
    First, I added the following JavaScript to my submit button's onClick event:
    this.disabled=true; return true;When I clicked the submit button, it was disabled but the form was not submitted.
    I deleted the JavaScript from the onClick event and added the following JavaScript to the form's onSubmit event:
    var button = document.getElementById("form1:submitButton"); button.disabled=true; return true;When I click the submit button, it was disabled and the form was submitted but the button's action method was not called.
    The next thing I tried was to change the onSubmit event code:
    var button = document.getElementById("form1:submitButton"); setTimeout("button.disabled=true", 500); return true;This seemed to work. The difference was that I added a 1/2 second delay before disabling the button.
    See if that works for you. If not then I'm fresh out of ideas.

  • When I execute my code that contains SetCtrlVal, I get the following error:

    When I execute my code that contains SetCtrlVal, I get the following error:
    “Invalid argument type found double expected int.”   The variable in question is declared double, and from reading the help info, the variable should adapt to the declared type.
    Solved!
    Go to Solution.

    A typical reason for this error is using a wrong panel handle in SetCtrlVal: check that the handle passed to the function effectively is the one returned from LoadPanel or NewPanel function.
    Another common issue it trying to address a control on a tab page using the handle of the panel that holds the tab control: you must consider that each tab page has its own panel handle as it were a separate panel; you can retrieve the handle associated with tab pages with GetPanelhandleFromTabPage () command.
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • Trying to properly code a menu with buttons that can go back and forth between external swf files

    I have a project I've been working on that, when properly coded, has a "main menu" with 4 "doors" (buttons). When the corresponding buttons to these "doors" are clicked, it should go to and play an external .swf file. If that doesn't make sense, think of a DVD menu. You click play movie, it plays the movie. When the movie is over, there's two buttons on that swf file to either play the movie over or go back the main menu, which is an external .swf file (Remember, we go to the movie from the menu, which is a seperate file). So far, the buttons work. The menu works. However, from the movie, at the conclusion, when I click the button to go back to the main menu, it displays the movie clip and the buttons, but none of the buttons work. I'm starting to think it has to do with the fact the main menu was written in AS3 and the movie was made in AS2. If anyone can assist me in being to able to keep both files and still navigate between the two, being able to bring up the menu from the movie and be able to play the movie again, and so on and so on, that'd be GREAT. I'm somewhat of a noob to Flash, but I learn quickly and I'm open to any suggestions. Here's the code for main menu, which I guess acts as the parent file, and the movie. If I get this to work, I essentially would duplicate the same actions for the other 4 doors, once I complete the environments for them. Thanks
    Main.Fla/Swf (written in AS3)
    (This is the action on the first frame, that has all the buttons. For this question, I'm just trying to properly code for 'Door4', which is the "door" to the movie.)
    import flash.display.Loader;
    stop();
    var myLoader1:Loader=new Loader ();
    Door4.addEventListener(MouseEvent.CLICK, jayzSwf);
    function jayzSwf(myevent1:MouseEvent):void
              var myURL1:URLRequest = new URLRequest("jayzspeaks.swf");
              myLoader1.load(myURL1);
              addChild(myLoader1);
              myLoader1.x = 0;
              myLoader1.y = 0;
    Movie.Fla/Swf (written in AS2)
    (This is action on the button that returns to the menu)
    on (release) {
              this.createEmptyMovieClip("container",this.getNextHighestDepth());
              container.loadMovie("main.swf");

    At least you're going in the correct (mis)direction. You have AS3 loading AS2. So that's not a huge hurdle.
    I believe all you really need to do is send your Main.swf a signal that the content it loaded (e.g. jayzspeaks.swf) is done and you want to get rid of it.
    The code I pointed you to asks you to (upon download and import then) instantiate it in both AS2 and AS3. They give a very simple easy to understand line of code.
    // as2, load this in jayzspeaks.swf
    var myBridge:SWFBridgeAS2 = new SWFBridgeAS2("connectionID", clientObj);
    // as3, load this in main.swf
    var myBridge:SWFBridgeAS3 = new SWFBridgeAS3("connectionID", clientObj);
    Make sure the connectionID matches between them. Set it to whatever you want.
    When you're done with your as2 loaded content you'd send a signal (over localconnection) back to the AS3 Main like they say:
    myBridge.send("someFunctionToUnloadContent");
    myBridge.close();
    You'd need to make the as3 function "someFunctionToUnloadContent()" (example purposes only name) and it should unload the jayzspeaks.swf that was loaded in the loader.
    Make sure you get that close in there so you don't drill up a bunch of localconnection objects just like the simple source code says.

  • Excel Macro that executes package Load Infoprovider with parameters in code

    Hi everybody,
    Is it possible to create a macro in Excel that executes the package 'Load Infoprovider', and all the parameters (Infocube, Transformation file, ... ) are written in the code of the macro?
    If it is so, do you have some example that I can use?
    Thanks in advance,
    Albert

    Hi Albert,
    There is a MNU function which is used to run a particular DM package. Please go to the below site and refer to the MNU_eDATA_SELECTPACKAGE command.
    http://help.sap.com/saphelp_bpc75_nw/helpdata/en/f7/715647fa774763827084cd28ef3aff/content.htm
    Hope this helps.

  • How to execute external scripts that returns error code

    Hi,
    What is the best approach to execute a unix shell scripts in ODI thats return a code e.g. 1- found , 2 - not found. The return code needs to assigned to a ODI variable. I have gone through some posts that explained how to refresh odi variable from file. well in that case i have to write the error code to a file and then read to a ODI variable. Is there any direct approach available ? Is there any other way I can assign values to ODI variable other than its refresh methods ( select from <source>) for e.g. Inside odi procedure ?
    Thanks you all for answering this
    -Mansa

    In order to reduce the steps we need to do that using java itself. It will be something like this .
    Step 1. ODI procedure - Technology Java Bean shell .
    <@
    JAVA OS COMMOND CODE TO TRIGGER THE PEARL SCRIPT.
    GET THE RETURN INTO JAVA VARIABLE ( SAY FOR EX result )
    @>
    Step 2. Creating the variable.
    select any oracle schema
    select '<@=result@>' from dual
    and call this variable in refresh mode in package.
    Step 3. processing with variable what ever you wish to do .
    Personally i have not tried the java os command to get the return code . I will look into this and let you know sooner or later. If you want you can explore the code or google the code and see if what you are planning to achive is possible ,else the other way can be using the file as you know.

  • Navigate to pressed button in multirecord block

    Hi,
    I'm using Forms 6i (6.0.8.27.0), Client / Server.
    I have a multi-record block with a button ("+") in the block for duplicating the record and increasing the date.
    So each row has a "+" button.
    When I press the "+" eg. on the 3rd row I want to navigate to this row and to execute the code in when-button-pressed trigger.
    So I wrote in the when-button-pressed trigger
    "GO_RECORD(:system.mouse_record);
    duplicate_record;
    Unfortunately :system.mouse_record is set to 1, also :system.cursor_record and :system.trigger_record.
    The "Mouse Navigate" property of the button is set to "yes".
    I have used the search function but didn't found a solution.
    Thanks in advance,
    Marco.

    Marco,
    My apologies, I should learn to read all of the message. I am embarrassed into having another try.
    Firstly, to clarify
    I am using Forms10g (sorry but it was the only one I could remove a developer from)
    Duplicate_Record: Copies the value of each item in the record with the next lower sequence number to the corresponding items in the current record. The current record must not correspond to a row in the database. If it does, an error occurs.
    I have setup a default block with a button on it and to test I have just executed a query against the block.
    After rows have been retrieved
    When I click on a button system.mouse_record always returns 0 (In the help it says this will be the case if you are not in an item, but I do not know if a button is classed as an item in the eyes of the help test author, I thought it might be, but maybe they mean a text item?) when I use :system.trigger_record I always get the right record number.
    For duplicate_record to work I have to be in a "NEW" record. I appear to be able to do this in two ways.
    Go to the bottom of my records + 1. The button becomes enabled and when I press it I can duplicate the record above.
    I can choose "insert record" (key-crerec I think or create_record) if I do this I can then press the button and duplicate the record above into this new record.
    If I press a button on a record which already has a record I presume of type QUERY then when I press the button I get FRM-41802 duplicate record function allowed on new records only.
    If I do not perform a query in the block; I create the first record input data I have to move to the next record to enable the button
    If I press the button it duplicates the value in the first record
    If I change the value in the second record and then go back to the first and press the button on the second row it overwrites the value with the value from the first row
    I hope this gives you some pointers in solving your problem.
    Apologies again for not reading properly and I hope that my using 10g has not made all this info useless.

  • PL/SQL WEB Toolkit: Using BUTTON to execute PL/SQL procedure

    I am trying to execute a PL/SQL procedure with a "SUBMIT" button from a WEB page. I have several URLs that execute perfectly, but I do not want endusers to have to type the URL themselves. I want to display a web page with multiple URLs in a drop_down list. User chooses a member of the list, clicks the "SUBMIT" buttom and that specific URL executes and produces the proper result. I am NOT a web developer, but this is what I've written sofar:
    CREATE OR REPLACE PROCEDURE html_list
    IS
    BEGIN
    HTP.PRINT ('<html>');
    HTP.PRINT ('<head>');
    HTP.PRINT ('<meta http-equiv="Content-Type" content="text/html">');
    HTP.PRINT ('<title>Title of the HTML File</title>');
    HTP.PRINT ('</head>');
    HTP.PRINT ('<body TEXT="#000000" BGCOLOR="#FFFFFF">');
    HTP.PRINT ('<h1>List of Valid URLs</h1>');
    HTP.PRINT ('<p>Choose your desired URL from the list below.');
    HTP.PRINT ('<FORM method="post" action="WHATEVER_COUNTS_WEB">');
    HTP.PRINT ('<FORM method="post" action="REQUEST_OBJECTS?PARAM1=MY_SCHEMA_ID">');
    HTP.PRINT ( '<SELECT name="URL">
    <option value="http://asai01.ffxlab.net:8080/me_epg_dad/WHATEVER_COUNTS_WEB">Count of Rows in Whatever Tables
    <option value="http://asai01.ffxlab.net:8080/me_epg_dad/REQUEST_OBJECTS?PARAM1=ME">Request Objects for MY_SCHEMA_ID
    <input type="submit" value="Submit"/>
    </SELECT>');
    HTP.PRINT ('</FORM>');
    HTP.PRINT ('</body>');
    HTP.PRINT ('</html>');
    END;
    Any help would be greatly appreciated. I've been writing PL/SQL code since 1989, but have never had to execute code via a WEB page until this week.
    Thanks so much

    Hi,
    Welcome to Oracle Forums!
    Please acquaint yourself with the FAQ and forum etiquette if you haven't already done so.
    Always post code snippets enclosed in a pair of &#123;code&#125; tags as explained in FAQ
    This Forum is dedicated to Oracle Forms. Unfortunately there is no Forum for WebToolKit that I know of. The closest is Oracle Application Express (APEX).
    If you objective is to have the User Navigate to the URL clicked then the easiest way is to use anchor tag with href attribute
    CREATE OR REPLACE PROCEDURE html_list
    IS
    BEGIN
    HTP.PRINT ('<html>');
    HTP.PRINT ('<head>');
    HTP.PRINT ('<meta http-equiv="Content-Type" content="text/html">');
    HTP.PRINT ('<title>Title of the HTML File</title>');
    HTP.PRINT ('</head>');
    HTP.PRINT ('<body TEXT="#000000" BGCOLOR="#FFFFFF">');
    HTP.PRINT ('<h1>List of Valid URLs</h1>');
    HTP.PRINT ('<p>Choose your desired URL from the list below.</p>');
    HTP.PRINT ('<a href="http://asai01.ffxlab.net:8080/me_epg_dad/WHATEVER_COUNTS_WEB" target="_blank">Count of Rows in Whatever Tables</a>');
    HTP.PRINT('<a "http://asai01.ffxlab.net:8080/me_epg_dad/REQUEST_OBJECTS?PARAM1=ME" target="_blank">Request Objects for MY_SCHEMA_ID</a>');
    HTP.PRINT ('<FORM method="post" action="WHATEVER_COUNTS_WEB">');
    HTP.PRINT ('<FORM method="post" action="REQUEST_OBJECTS?PARAM1=MY_SCHEMA_ID">');
    HTP.PRINT ( '<SELECT name="URL">
    <option value="http://asai01.ffxlab.net:8080/me_epg_dad/WHATEVER_COUNTS_WEB">Count of Rows in Whatever Tables
    <option value="http://asai01.ffxlab.net:8080/me_epg_dad/REQUEST_OBJECTS?PARAM1=ME">Request Objects for MY_SCHEMA_ID
    <input type="submit" value="Submit"/>
    </SELECT>');
    HTP.PRINT ('</FORM>'); */
    HTP.PRINT ('</body>');
    HTP.PRINT ('</html>');
    END;Change the target attribute to suite your needs. More here http://www.w3schools.com/tags/att_a_target.asp
    Or, maybe explore Apex !
    Cheers,

  • How can I create a button that performs the function of a keyboard shortcut, specifically print scrn

    I need my presentation users to take a screen shot of a slide within my presentation.  I know that windows 8 has a new function that allows a screen shot to be taken and saved directly to the user's computer and I need a button that can be placed on a slide and perform this function.  The shortcut is (windows key) + (print scrn).  I want to save my userss some time and just have a button perform this task.  Any idea on how I can make this possible? I am using Captivate 7.

    I think Ajit may have misunderstood your need.  The command he told you about triggers the Print command to allow you to print the currently active slide (on a laser or inkjet printer). This does not have the same result as you would get by hitting the PrintScreen button on your keyboard (to take a screencapture and have it saved to the Clipboard for pasting somewhere else).
    You can add a button to your slide and set the PrintScreen key as the shortcut, but this will NOT mean that clicking the button will cause a screencapture to be taken.
    There are JavaScript libraries that will allow you to execute JavaScript code in a Captivate project that can take a screen capture:
    https://github.com/ariya/phantomjs/wiki/Screen-Capture
    However, to implement these solutions you would need to be quite knowledgeable with setting up JavaScript.  It's not for newbies.

  • Making a button that installs demo.msi

    Using pro 8 Im trying to make a button that would run the
    installer for our software,
    fscommand ("exec", "demo.msi") , doesnt work like it did for
    the exe. does anyone know what code I need to install an msi
    file?

    Juan Valdez wrote:
    > Using pro 8 Im trying to make a button that would run
    the installer for our
    > software,
    > fscommand ("exec", "demo.msi") , doesnt work like it did
    for the exe. does
    > anyone know what code I need to install an msi file?
    you can't call MSI files. EXEC can only call executable type
    of files, exe, bat, com....
    Best Regards
    Urami
    !!!!!!! Merry Christmas !!!!!!!
    Happy New Year
    <urami>
    If you want to mail me - DO NOT LAUGH AT MY ADDRESS
    </urami>

  • Making a button that runs a demo.msi installer

    Using pro 8 Im trying to make a button that would run the
    installer for our software,
    fscommand ("exec", "demo.msi") , doesnt work like it did for
    the exe. does anyone know what code I need to install an msi
    file?

    Juan Valdez wrote:
    > Using pro 8 Im trying to make a button that would run
    the installer for our
    > software,
    > fscommand ("exec", "demo.msi") , doesnt work like it did
    for the exe. does
    > anyone know what code I need to install an msi file?
    you can't call MSI files. EXEC can only call executable type
    of files, exe, bat, com....
    Best Regards
    Urami
    !!!!!!! Merry Christmas !!!!!!!
    Happy New Year
    <urami>
    If you want to mail me - DO NOT LAUGH AT MY ADDRESS
    </urami>

  • Push Button in Multirecord block and Record Number

    Hi All,
    I have a push button in Multirecord block.
    for eg. there are 5 records in that block and cursor is on 1st record. if users pressess the push button on 3rd record (or other than 1st record) i want to get that 3rd record number. i am not able to get this. i checked :system.trigger_record, cursor_record, mouse_record values but it is not working correctly.
    what code should i write in when-button-pressed trigger to work it the way i want.
    can anybody help.
    regds

    Yes i got it
    Re: multi-record push button
    set mouse navigable property to true for push button and you get the :system.trigger_record value.

  • Convert strings to executable java code

    Hey,
    I'm not sure how easy or hard this is to accomplish, but I am looking for a way to take a string from a JTextField and use it as a control structure for an IF block.
    For example, the user inputs 'keyword=="test" || keyword=="test2"' I want to use it in an if block to control it.
    Is there a way to do this? I realize the java file is already compiled in a class, so the string would probably be incapable of doing such a thing.
    Any thoughts would be appreciated!

    Basically this is impossible, because Java is a compiled language, but there are ways around it.
    Actually the ways are all basically one way: use an interpreted language. You can embed one into Java. You can write your own, new language (it could be a small simple mini-language, for example one that only evaluates boolean expressions; this is easier than it sounds), or you can use one that already exists.
    There already is an interpreted language for Java. It's called BeanShell. Also I'm told that someone has written a javascript interpreter for Java, but I don't know the details.
    I'd suggest Googling for BeanShell. It sounds like the quickest, easiest solution.
    But be careful: letting users execute arbitrary code can be a huge security hole.

Maybe you are looking for

  • Where are the memory files located?

    I backed up all my premiere pro cs4 files when reinstalling my operating system and now can't get the program to run exactly as before.  Other than my documents, where else are the memory files stored?

  • Samsung lcd lnt4661f

    When i try and turn on my tv it clicks like it is trying to come on but then it shuts off then on then off. i had to unplug it so it wouldnt burn anything up. i tried plugging it in to different spots and it doesnt seem like the power button is stuck

  • Apple TV and My Computer

    When is Apple going to create an App to allow streaming of my MacBook over the TV? I want to be able to use my TV as the computer screen without having to run cables etc.

  • Employee payment related to expenses etc.

    Hello, Employee payment related to expenses etc. is done at company level.. Employee are treated as vendors. Expenses like: Newspaper exp. What kind of entry will be involve for this?what kind of GL will be required and how many GL? When we see emplo

  • Deposit invoices and payemnts from Order Manangment

    Hi All, We manually create Deposit invoices in AR then generate the Receipt and manually apply these receipt to Deposit invoices. Accountant generally complete this activity while booking the order. The goods are delivered to customers based on sched