Wait for user input in middle of method

I have a method in the middle of which I want to give the user a chance to click one of several Buttons. Here is the basic design of the method:
Private Sub MyMethod()
'Code before I need extra input
'This is where I want to wait for the user to click a Button
'This is where I will be using the results from the clicked Button
'The waiting for input and using the results will happen multiple times inside a loop
End Sub
The code is in a loop, so exiting the method and putting the rest of the code in the Button handler would not be appropriate. How can I ask the user for input and then return that input to the method where I left? I seem to be tempted to use some kind of async
method, but since the input will be coming from the user (not another method), that doesn't seem like it would be right (but I don't have a huge amount of experience with async, so I could be wrong about that). Can anybody help me? Thanks.
Nathan Sokalski [email protected] http://www.nathansokalski.com/

Hi Nathan,
You're on the right track: you'll need to await an Async function to put a delay in the middle of your method. The button click will notify the async function to finish.
You could write a custom function which returns a Task and waits for the notification from the button:
Task WaitForButtonClickAsync()
// wait for button click
and then await that in your main function:
async void BigNastyFunction()
await WaitForButtonClickAsync();
The next question is how to let the button click notify WaitForButtonClickAsync to return.
We could spin up a worker thread and have it block waiting on a notification, but there is no need to complicate things like that: WaitForButtonClickAsync can just return
Task.Delay(timeout, cancellation token) and then when the button click handler fires it can cancel the delay.
See
Asynchronous Programming with Async and Await and
Async Cancellation: Bridging between the .NET Framework and the Windows Runtime for more information on cancelling a task.

Similar Messages

  • How to make Flash to wait for user input

    Hi,
    I found this PHP script, then I made some changes to make it
    FEED the Flash user interface with online user input.
    The main concept of this script is WAITING for user input, so
    it shows the messages and then go to next line and so on.
    The user input go to directly to TEXT file which writes in
    lines, each line has a unique id = (mag_id).
    There "get_msge.php" which works as the middleware between
    FLASH and messages text file.
    The problem, its doesn’t show any data while there are
    data in the text file.
    Help here please, best regards.
    This is the link of
    problem illustartion
    AS is:
    // create an object to store the variables
    varReceiver = new LoadVars();
    // load the variables from the text file
    varReceiver.load("get_msg.php?file_id=1&msg_id=1",
    "POST");
    // trigger something - when the variables finish loading
    varReceiver.onLoad = function(){
    //the variables have finished loading
    if (this.msg_id == 1) {
    _root.xmsg1_swf.text = this.msg;
    _root.xmsg1_ch.text = this.msg;
    gotoAndPlay("line2");
    } else {WAIT }
    PHP is:
    <?php
    //get these values from the FLASH
    $file_id_swf = $_POST ['file_id'];
    $file_name = "messages/messages".$file_id_swf.".txt";
    $msg_id_swf = $_POST ['msg_id'];
    // [0] ."||".[1] ."||".[2] ."||". [3] ."||".[4]."||". [5].
    //$msg_id."||".date."||".time."||".$from."||".$to."||".$msg.
    $fp = fopen ($file_name, 'rb');
    while (!feof ($fp))
    $msg_txt = fgets ($fp, 1024);
    $line = explode ("||", $msg_txt);
    $msg_id = $line[0];
    $from = $line[3];
    $to = $line[4];
    $msg = utf8_encode ($line[5]);
    if ($msg_id == $msg_id_swf)
    echo
    "msg_id=".$msg_id."&from=".$from."&to=".$to."&msg=".$msg;
    }//while
    fclose ($fp);
    ?>

    Well, given the things that you've written, I don't think it
    could. There technically isn't any code in flash that lets it
    "wait." In order to "wait," you must run the script over again
    until some condition is met.
    However, your code does look accurate. Why do you need to
    wait? The onLoad function will be invoked WHEN something is loaded.
    So, I don't see the reason for the "waiting."
    In addition to that, I would like to say that using text
    files isn't that great with flash. I have done this before and
    noticed several problems with using text files. The biggest problem
    is that the text files are cached after being loaded. Every time
    you re-load it again, you will get what you got the first time
    until you reset your cache (ie. close your browser). I suggest
    using MySQL. (Just my thought.)

  • How do you keep a VI running while waiting for user input?

    I have a VI that:
    1.  The user enters set points.
    2.  The user starts the VI and the VI sends the set points to an external process via a serial interface.
    3.  The VI  stops running.
    4   The user waits for the external process to complete.
    5.  Repeat sequence. Go to Step 1.
    This works well except for one small problem.  Starting the VI in step 2 causes an external micro controller to reset.  During the reset it will ignore set point commands.  To get around this problem a delay has been added between when the VI opens the serial port and when the VI sends the set points to the external process   Is it possible to keep a VI running continuously in this type of application, thereby eliminating the start up and shut down of the serial interface?
    If yes, how do you keep a VI running while waiting for user input?
    Howard

    The ones for the event structure specifically. I'm posting from my phone. Look at the basic ones for user input. even a simple while loop with a boolean and a case statement would work.

  • Need Help waiting for user input.

    I've got a simple card game, which I've pretty much made all with swing. I have a JTextField and a JButton. I want the user to input a number into the textfield and the click the button which fires the action listener. This then takes the text and reads it and set a boolean hasBid to true. I don't want to program to continue until this has happened so I made an empty while(!hasBid) loop. The first time through, the program starts and stop until the user inputs something and click the button. The second time through, however, the whole window freezes. For somereason object aren't even being displayed which are displayed before this while loop. Without the while loop, everything runs fine, but the program won't stop to wait for input.
    So, my question pretty much is how can I get the program to stop for user input in a function which will be called multiple times. I don't want to use a JOptionPane or anyother pop-up box. If my way won't work, I'd really like to know of another way. Thanks for any help!

    you simply need to separate the functionality of your input object and the card game into two threads. as sanbingo said, running in a while loop prevents your GUI from even drawing its components.
    Remember: AWT/Swing is an event driven interface! so only events can/should cause some action to happen.
    i'd properly implement an event listener which is fired when the input is received. the listener is your game class which upon receipt of the event starts playing. when its done, its done, ie doesn't do anything until it receives an new event from your input object.
    thomas

  • Wait for user input in for loop

    I'm pretty new to labview and I'm having a hard time figuring out how to do this. Basically, I need the user to press a GO button and data aquisition will take place saving it in an array, then the program will wait for the user to press the GO button again and the data aqusition will add more values to the array, and the whole process will repeat 5 times and finally it will average the values.
    To try and figure out how to do this, I tried making a program that loops 5 times and adds a random number to an array with each loop (using shift registers) but I CANNOT figure out how to make each loop iteration wait on the user to press a button. Any advice?

    Hi Roger,
    you can use a dialog in your for loop, or better you use an event structure to react on user inputs. If you use the event structure you can count the button press events and store them in a shift register. With a compare function you can check if your limit is reached and react on it.
    Mike

  • WORKFLOW PROCESS IS NOT WAITING FOR USER INPUT LIKE RE-ASSIGN FUNCTION

    I am using Stand alone Workflow 2.6, In my workflow process
    which is an Issue tracking system which is working fine. On Enhancement I would like to create my own RE-ASSIGN function which will, Change the ownership of an issue totally to other user.
    For this I Created a package(CHANGE_OWNER.CREATE)which will show list of Users and Comment field(Just like Re-Assign).
    Here user can pick other user, and add comment,
    once submit for that Item key I am updating the workflow notification table so that paritcular issue ownership will be changed.
    In my workflow process I created a lookup code called "Change Owner". On click of Change Owner it will call the Function
    in workflow process which will call CHANGE_OWNER.CREATE, here
    the workflow process supposed to wait and get the User to be
    changed. BUT THE PROCESS IS NOT WAITING, IT JUST DISPLAYED THE
    SCREEN AND CONTINUED THE WORKFLOW PROCESS. I WANT THE MY
    WORKFLOW PROCESS TO BE ACT AS RE-ASSINGN BUTTON WHICH WILL WAIT
    FOR THE USER INPUT.
    HOW TO DO IT.
    Thanks
    Bala.

    Hi Bala
    What enhancements were you adding to the Workflow Reassign/Delegate feature, which included being able to add comments? A good idea is to look for any differences between how workflow implements the reassign feature, and your customization.
    Also, make sure you only use the Public documented PL/SQL APIs and do not update the tables directly to ensure no Support or Upgrade Issues.
    Cheers
    Mark
    I am using Stand alone Workflow 2.6, In my workflow process
    which is an Issue tracking system which is working fine. On Enhancement I would like to create my own RE-ASSIGN function which will, Change the ownership of an issue totally to other user.
    For this I Created a package(CHANGE_OWNER.CREATE)which will show list of Users and Comment field(Just like Re-Assign).
    Here user can pick other user, and add comment,
    once submit for that Item key I am updating the workflow notification table so that paritcular issue ownership will be changed.
    In my workflow process I created a lookup code called "Change Owner". On click of Change Owner it will call the Function
    in workflow process which will call CHANGE_OWNER.CREATE, here
    the workflow process supposed to wait and get the User to be
    changed. BUT THE PROCESS IS NOT WAITING, IT JUST DISPLAYED THE
    SCREEN AND CONTINUED THE WORKFLOW PROCESS. I WANT THE MY
    WORKFLOW PROCESS TO BE ACT AS RE-ASSINGN BUTTON WHICH WILL WAIT
    FOR THE USER INPUT.
    HOW TO DO IT.
    Thanks
    Bala.

  • How do i make program wait for user input in some dialog box?

    basicly function public UserData getUserData()
    displays window and returns a value when somebody has pressed OK in JFrame. How?

    Extend from JDialog instead of JFrame and it'll give you the waiting that you need.
    To use a JFrame is a little more involved.
    I had to the other day also. I wanted to have a dialog that would be both a dialog and a JFrame. Reason: when the app started up, I wanted to get some data from it (and have it appear in the task bar for normal application selection), and also wanted the app to call the same window when running but as a dialog (ie: no extra task bar icon). However only the JDialog stopped the calling thread for the dialog.
    To get the JFrame to do the same, I invoked a thread and piled all of the logic into that, and when the user did all that I wanted them to, closed the Frame and released the thread with all of the statefull stuff that I wanted.
    Worked a treat.

  • Program does not wait for user input

    Hi everyone,
    i am working on a program and there are 2 problems that i can't figure out. Since they are 2 different topics, I will do 2 posts.
    Just to give you some background on the program, it is a program that reads 3 txt files into 4 different arrays. The files contain student names, student ID numbers, number of credits and gpas. the user enters the names of the 3 txt files and then is given a list of options to choose from. I am having problems with option 7.
    The code lists the student information, but it does not stop to request the name of the student from the user. Instead, it prints the system out line requesting the name and then prints all the information for every student in the file. I can't figure out why this is happening. Here is the code for the option:
                    else if (choice == 7)
                            System.out.print("Please enter the student's name: ");
                            student_name= sc.nextLine();
                            for (q= 0; q <= num_students-1; q++)
                                    if (student_name.equalsIgnoreCase(studentname[q]))
                                            System.out.println();
                                            System.out.println("Student's name: " + studentname[q]);
                                            System.out.println(studentname[q] + "'s ID#: " + studentid[q]);
                                            System.out.println(studentname[q] + "'s number of credits: " + credits[q]);
                                            System.out.println(String.format(studentname[q] + "'s gpa: " + "%.2f",gpa[q]));
                                            if (gpa[q] < 2.00)  
                                                    System.out.println(studentname[q] + "'s status: can't graduate");
                                            else if (gpa[q] >= 3.45 && gpa[q] < 3.65)
                                            else if (gpa[q] >= 3.45 && gpa[q] < 3.65)
                                                    System.out.println(studentname[q] + "'s status: cum laude");
                                            else if (gpa[q] >= 3.65 && gpa[q] < 3.85)
                                                    System.out.println(studentname[q] + "'s status: magna");
                                            else if (gpa[q] >= 3.85)
                                                    System.out.println(studentname[q] + "'s status: summa");
                                            else if (gpa[q] >= 2.00 && gpa[q] < 3.45)
                                                    System.out.println(studentname[q] + "'s status: ");
                    System.out.println();
                    System.out.println("1.  List student names");
                    System.out.println("2.  List credits");
                    System.out.println("3.  Show total credits");
                    System.out.println("4.  List gpas");
                    System.out.println("5.  List gpas in ascending order");
                    System.out.println("6.  Show weighted average of gpas");
                    System.out.println("7.  Show information about a given student");
                    System.out.println("8.  Add a new student");
                    System.out.println("9.  Quit");
                    System.out.println();
                    System.out.println();
                    System.out.print("Enter your choice: ");
                    choice= sc.nextInt();
                    System.out.println();
                    // Option 9 quits program
    }          Any help you can give me would be greatly appreciated.

    Ok, I tinkered with the code a bit. Now it will show the info for only one student, however, it is not giving any results. Here is the output I am getting:
    Enter your choice: 7
    Please enter the student's name: mary
    Student's name: null
    null's ID#: null
    null's number of credits: 0
    null's gpa: 0.00
    null's status: can't graduate
    1. List student names
    2. List credits
    3. Show total credits
    4. List gpas
    5. List gpas in ascending order
    6. Show weighted average of gpas
    7. Show information about a given student
    8. Add a new student
    9. Quit
    Here is the updated code:
                    else if (choice == 7)
                            System.out.print("Please enter the student's name: ");
                            student_name= sc.next();
                            for (q= 0; q < num_students; q++)
                                    if (student_name.equalsIgnoreCase(studentname[q]))
                                            System.out.println();
                                            System.out.println("Student's name: " + studentname[q]);
                                            System.out.println(studentname[q] + "'s ID#: " + studentid[q]);
                                            System.out.println(studentname[q] + "'s number of credits: " + credits[q]);
                                            System.out.println(String.format(studentname[q] + "'s gpa: " + "%.2f",gpa[q]));
                                            if (gpa[q] < 2.00)
                                                    System.out.println(studentname[q] + "'s status: can't graduate");
                                            else if (gpa[q] >= 3.45 && gpa[q] < 3.65)
                                                    System.out.println(studentname[q] + "'s status: cum laude");
                                           else if (gpa[q] >= 3.65 && gpa[q] < 3.85)
                                                    System.out.println(studentname[q] + "'s status: magna");
                                            else if (gpa[q] >= 3.85)
                                                    System.out.println(studentname[q] + "'s status: summa");
                                            else if (gpa[q] >= 2.00 && gpa[q] < 3.45)
                                                    System.out.println(studentname[q] + "'s status: ");
                                    else
                                            System.out.println("Student name not on file.");
                    System.out.println();
                    System.out.println("1.  List student names");
                    System.out.println("2.  List credits");
                    System.out.println("3.  Show total credits");
                    System.out.println("4.  List gpas");
                    System.out.println("5.  List gpas in ascending order");
                    System.out.println("6.  Show weighted average of gpas");
                    System.out.println("7.  Show information about a given student");
                    System.out.println("8.  Add a new student");
                    System.out.println("9.  Quit");
                    System.out.println();
                    System.out.println();
                    System.out.print("Enter your choice: ");
                    choice= sc.nextInt();
                    System.out.println();  
                    // Option 9 quits program
    }

  • Asking for user input in the middle of a function

    Here's my issue.
    I need to launch and input window in the middle of a function for user input.  Before I can continue through the function I need a response back from the user first.  Psuedo code below:
    function
         function begins
         pop up window is launched to ask for user input
         function continues after users submits input
         user input from pop up window is used in function return value
    Let me know if you need more clarification but this is essentially what I'm attempting to do.

    The way actionScript works it isn’t really designed to work that way
    Is there any reason why you have to only use one function as you have written
    I think you really do need to split up your code into sections that a, set up the pop-up with  event listeners waiting for the input to be completed, trigger the pop up with user input, then have a handler function that then interprets the results of the user action.
    Trying to force the system into a closed loop while waiting will be a bad idea.
    By using a pop-up or an alert window that is set to be modal, you are effectively stopping your application doing anything else until the user input has been completed, but still not locking the app into a closed loop. Imagine what would happen if you did put the system into a closed loop, the mouse movement wouldn’t be updated, the screen wouldn’t refresh and the system wouldn’t be able to handle your user input. the reason for using async model is you are able to let the system still do all its background task (move the mouse, give inputs focus, keep the screen drawn etc) but still tell a part of your app to ‘wait for input’ before carrying on it execution of your logic
    Do you come from another programming language? Maybe one that uses less of an OOP approach? I only ask, as the method you are describing is much more like how I had to program when  I worked on computers years ago as an assembly programmer.
    In actionscript and most other modern languages and Oss you don’t have total control of the system and cant lock it into an action as you describe.
    You need to have an asynchronous approach to situations like you describe and let the system run in the back ground while you are waiting for input (or date from a server for that matter)
    Please excuse me if I am telling you things you already know.
    What exactly is your use case for this? Maybe if we knew exactly what you are working on I might be able to offer a solution that would make sense for your particular situation.
    Hope all is going well and please feel free to contact me if you are stuck

  • Create a screen for user input in BI

    Hi Experts,
    I want to know can i creat a screen for user input in BI with module pool programing
    and i want to store the data in ztable in SAP-BI.
    Moderator message: please search for available documentation, these forums are no substitute for ABAP training.
    Edited by: Thomas Zloch on Dec 10, 2010 8:37 PM

    I'm afraid that I cannot get it. I had a look at the docs you suggested before posting, and still, no luck (...)
    JOptionPane.showMessageDialog(dialog, "Please input info");Can you please tell me what I'm doing wrong and I cannot add the JDialog to the JOptionPane?Re-read the API and tutorial. JOptionPane is meant specifically to spare you from instantiating manually a JDialog. The showXxxDialog(...) methods do create a JDialog of their own, based on the contents supplied as arguments.
    In particular, using the 2-arguments variation showMessageDialog(Component parentComponent, Object message):
    - The first argument parentComponent is not be the dialog you want to display, but the component over which you want the dialog to appear. The most typical value are this or null.
    - The second argument is the "message" to display, but as described in the API, it can be a JComponent, that is, even a JPanel with child widgets (in a word, a JPanel containing the specific form you'd display in the dialog if you were writing the dialog manually).
    Again, at the risk of insisting densely, I'm only quoting the API an tutorial, so please read them attentively.
    Edited by: jduprez on Nov 2, 2009 2:29 PM - Sorry Kevin, hadn't seen you latest reply. I completely subscribe to the thought process you recommend.
    Edited by: jduprez on Nov 2, 2009 2:32 PM
    Thinking about it further, I don't completely subscribe... Indeed it looks like a bad idea to make the OP wonder about dialog.setVisible() when JOptionPane enables him to forget about the hand-made dialog. I stand by my own advice ("JDialog" should not even appear in this code extract).

  • 451 4.7.0 Timeout waiting for client input

    My organization is running Small Business Server 2008 with Exchange.  After installing Exchange users reported not reciveing emails from Comcast and a few other domains.  Looking at the logs, domains including gmail and comcast are unable to deliver email to our Exchange mailboxes.  They receive an error message like the following.
    Technical details of temporary failure:
    Google tried to deliver your message, but it was rejected by the recipient domain. We recommend contacting the other email provider for further information about the cause of this error. The error that the other server returned was: 451 451 4.7.0 Timeout waiting for client input (state 18).
    Other domains send just fine. Any ideas what is causing the 451 4.7.0 connection timeout error message?  The following is an example SMTPReceive log.
    2009-06-08T23:15:11.964Z,,+,,
    2009-06-08T23:15:11.964Z,,SMTPSubmit SMTPAcceptAnySender SMTPAcceptAuthoritativeDomainSender AcceptRoutingHeaders,Set Session Permissions
    2009-06-08T23:15:11.964Z,,"220 remote.domain.com Microsoft ESMTP MAIL Service ready at Mon, 8 Jun 2009 16:15:11 -0700",
    2009-06-08T23:15:12.027Z,,<,EHLO smtp3.mail.com,
    2009-06-08T23:15:12.027Z,,250-remote.domain.com Hello [123.12.123.123],
    2009-06-08T23:15:12.027Z,,250-SIZE 10485760,
    2009-06-08T23:15:12.027Z,,250-PIPELINING,
    2009-06-08T23:15:12.027Z,,>,250-DSN,
    2009-06-08T23:15:12.027Z,,>,250-ENHANCEDSTATUSCODES,
    2009-06-08T23:15:12.027Z,,>,250-STARTTLS,
    2009-06-08T23:15:12.027Z,,>,250-AUTH,
    2009-06-08T23:15:12.027Z,,>,250-8BITMIME,
    2009-06-08T23:15:12.027Z,,>,250-BINARYMIME,
    2009-06-08T23:15:12.027Z,,>,250 CHUNKING,
    2009-06-08T23:15:12.105Z,,<,STARTTLS,
    2009-06-08T23:15:12.105Z,,>,220 2.0.0 SMTP server ready,
    2009-06-08T23:15:12.105Z,,*,,Sending certificate
    2009-06-08T23:15:12.105Z,,*,CN=remote.domain.com,Certificate subject
    2009-06-08T23:15:12.105Z,,*,CN=ecf-DOMAINSERVER-CA,Certificate issuer name
    2009-06-08T23:15:12.105Z,,*,,Certificate serial number
    2009-06-08T23:15:12.105Z,DOMAIN\Windows SBS Internet Receive DOMAIN,,20,,*,,Certificate thumbprint
    2009-06-08T23:15:12.105Z,DOMAIN\Windows SBS Internet Receive DOMAIN,,21,,,*,remote.domain.com;domain.com;DOMAIN.local,Certificate alternate names
    2009-06-08T23:15:12.355Z,,EHLO smtp3.mail.com,
    2009-06-08T23:15:12.355Z,,250-remote.domain.com Hello [123.12.123.123],
    2009-06-08T23:15:12.355Z,,250-SIZE 10485760,
    2009-06-08T23:15:12.355Z,,250-PIPELINING,
    2009-06-08T23:15:12.355Z,,250-DSN,
    2009-06-08T23:15:12.355Z,,250-ENHANCEDSTATUSCODES,
    2009-06-08T23:15:12.355Z,,250-AUTH,
    2009-06-08T23:15:12.355Z,,250-8BITMIME,
    2009-06-08T23:15:12.355Z,,>,250-BINARYMIME,
    2009-06-08T23:15:12.355Z,,>,250 CHUNKING,
    2009-06-08T23:15:12.433Z,,<,MAIL From:<[email protected]> SIZE=52018,
    2009-06-08T23:15:12.433Z,DOMAIN\Windows SBS Internet Receive DOMAIN,,,,,,,receiving message
    2009-06-08T23:15:12.433Z,,250 2.1.0 Sender OK,
    2009-06-08T23:15:12.496Z,,RCPT To:<[email protected]>,
    2009-06-08T23:15:12.496Z,,250 2.1.5 Recipient OK,
    2009-06-08T23:15:12.496Z,,DATA,
    2009-06-08T23:15:12.496Z,,354 Start mail input; end with <CRLF>.<CRLF>,
    2009-06-08T23:15:20.277Z,,451 4.7.0 Timeout waiting for client input,
    2009-06-08T23:15:20.277Z,,,Local
    2009-06-08T23:16:03.276Z,,451 4.7.0 Timeout waiting for client input,
    2009-06-08T23:16:03.276Z,,,Local

    I had a similar issue with fortigate firewall. I could not able to resolve this issue with fortigate. Fortunately I had a Cisco PIX firewall in my stock. Eventhough it is not a best practise I have replaced the fortigate firewall with Cisco PIX mail flow
    started perfectly without any issues.
    If any fortigate experts are seeing this forum please suggest what has to be done for solving this issue.
    I have escalated this case to fortigate and they resolved the issue by executing the following commands on the fortigate firewall.
    set tcp-mss-sender1452
    set tcp-mss-receiver1452
    Santhosh Sivaraman MCITP: Microsoft Exchange Server 2007/2010 | MCSE/MCSA

  • "catching" a prompt for user input and answering it through zenity?

    I'm trying to write a script (or multiple scripts) that will allow me to use command-line only applications via user defined actions in my file manager without having to open a terminal. Now I realize this basic functionality is already available, but as it stands I am unable to respond to command-line prompts for user input without opening a terminal. Is it possible to write a shell script that would act as a wrapper and allow me to use zenity (or another popup program) to respond to such queries?
    For example if I used a command-line program that prompted me for a password, could I "catch" that prompt with a shell script and answer it through another program, such as zenity?
    Last edited by falconheart (2011-01-16 22:37:25)

    The easier way to do this is to collect the info with zenity first, then pass it on the command line.  If the program insists on prompting, then you could try feeding it the info with redirection if it accepts it from stdin.  For example
    command < info.txt
    where info.txt is a temp file created by your script which contains whatever you want entered into the prompts.  This will work in some cases.

  • How to prompt for user input in Forms

    How do I prompt for user input in Forms?
    I am writing a piece of code where the user may choose, by clicking either of three buttons on an alert, to have the system assign a value to a variable, to input a value or to do neither?
    If the user chooses to input the value I want to update a set of database fields with the value.
    I have thought about showing a view where the value may be entered into a field displayed on that view. The value will be assigned to the variable by the user clicking a command button. The question I have in this case though, is whether, after the command button is clicked, control will be passed back to the code that called the view in the first place?

    Desgordon,
    This can be accomplished by displaying your message to the user using an Alert. I use 3 different Alerts (Note, Caution and Stop) in my forms and they are inherited from a central source file (such as an Object Library or a Template Form) so they can be used by all of my Forms. You can set the text of the Alert using the SET_ALERT_PROPERTY() built-in and capture what button the user presses with the SHOW_ALERT() built-in. Additionally, if you need more than one button to be displayed in an alert, you use the SET_ALERT_BUTTON_PROPERTY() built-in to rename the default button or to add up to a total of three buttons in the alert. Here's an example:
    DECLARE
       Alert_ID       ALERT;
       v_AlertType    VARCHAR2(10) := 'CAUTION';
       v_AlertTitle     VARCHAR2(25);
       v_AlertText    VARCHAR2(150);
       n_AlertButton  NUMBER;
    BEGIN
       v_AlertTitle := 'Title of Alert';
       v_AlertText := 'This is message to the user.';
       /* Code leading up to the decision point. */
       alert_id := FIND_ALERT(v_AlertType);
       /* Note: I only set the Label of Button 2 because the default button 1 label is 'OK' */
       SET_ALERT_BUTTON_PROPERTY(v_AlertType, ALERT_BUTTON2, LABEL, 'Cancel');
       SET_ALERT_PROPERTY(Alert_ID, v_AlertTitle, v_AlertText);
       n_AlertButton := SHOW_ALERT(Alert_ID);
      /* Now I can test the value of n_AlertButton for 1 or 2 to find out what button the user selected. */
      IF ( n_AlertButton = 1 ) THEN
         /* Do something, because the user selected 'OK' */
      ELSE
         /* It is assumed at this point that the user selected 'CANCEL' */
         /* Stop processing any further. */
         RAISE form_trigger_error;
      END IF;
    END:Hope this helps.
    Craig...
    -- If my response or the response of another answers your question, please mark the response accordingly. Thanks!

  • How to prompt for user input in PL/SQL

    How do I prompt for user input in PL/SQL?
    I am writing a piece of code where the user may choose, by clicking either of three buttons on an alert, to have the system assign a value to a variable, to input a value or to do neither?
    If the user chooses to input the value I want to update a set of database fields with the value.
    I have thought about showing a view where the value may be entered into a field displayed on that view. The value will be assigned to the variable by the user clicking a command button. The question I have in this case though, is whether, after the command button is clicked, control will be passed back to the code that called the view in the first place?
    Edited by: desgordon on Sep 3, 2008 10:33 AM

    desgordon wrote:
    How do I prompt for user input in PL/SQL?
    I am writing a piece of code where the user may choose, by clicking either of three buttons on an alert, to have the system assign a value to a variable, to input a value or to do neither?OK, you're doing that in Forms...
    >
    If the user chooses to input the value I want to update a set of database fields with the value.Write PL/SQL procedure for this purpose...
    >
    I have thought about showing a view where the value may be entered into a field displayed on that view. The value will be assigned to the variable by the user clicking a command button. The question I have in this case though, is whether, after the command button is clicked, control will be passed back to the code that called the view in the first place?Not clear what you mean with view?
    But if you call your procedure in that button then yes 'control will be passed back to the code'...
    Cheers!
    Edited by: Faust on Sep 3, 2008 7:57 PM
    Too slow...

  • How to pause while document printing and wait for user actions.

    How to pause while document printing and wait for user actions. (for sample: pressed button). Pause after each printed pages.

    Print page by page after considering the user actions!

Maybe you are looking for

  • How did you learn about performance issues?

    I've been thinking about trying to get a LV certification, so I tried out the online test, and I've got a few questions about learning LV on a deeper level. One question asked whether it is more efficient to cast each piece of an array as its being b

  • FCPX Photo Browser can't see Aperture?

    I use Final Cut Pro X 10.1.3 and Aperture 3.5.1. When I want to import pictures from Aperture to FCPX I'm supposed to be able to use Photo Browser in FCPX. But in Photo Browser I can only see my iPhoto pictures. I don't get the drop down menu and I c

  • Simple Data Type in CAF of SAP NetWeaver DevStudio 7.1 SP3

    Hallo Anybody knows about the use of Enumeration for simple Data Type in CAF of SAP NetWeaver DevStudio 7.1 SP3? I've defined an attribute "status" for the Entity "Project" with the following values 0: NEW; 1: ACTIVE; -1: INACTIVE.  As you see the da

  • How to delete the hidden partition (about 35 GB) on my H430 HDD?

    Hello dear sirs/madams I want to delete the hidden partition in my H430 desktop. It came with DOS. I am unable to use OneKey Recovery after the reseller installed Windows 7 Ultimate x32. And it is showing the hard disk capacity is 465 GB in my 500 GB

  • Unable to import D300 NEF files

    I am trying to import pix from Nikon D300. All shot in RAW format. iphoto 8 opens up and shows me thumbnails but is unable to import any pictures. I am assuming the iPhoto 8 is not updated for new cameras. is that correct? How long will it take for i