Waiting until a process is 'ready'.

Basically, in my application I have to start a process (a server to be precise), wait for it to be ready and then run a program which connects to it. The problem is the server doesn't give any output when it's ready. It gives some output, but then looking at the CPU usage I can see it grinds for half a minute or so and then it's ready. I tested it and for the other process to connect the server must be 'ready' (ie. stopped using huge amounts of processing power).
There are no paramaters or anything to make the server output more info so I can't do it by reading output. The only way I can think of doing it is to keep trying to connect to the server and then when it's ready it will work, but I'd rather do it differently for other error/exception reasons.
Can anyone think of a way I could make my program wait until the processing has stopped to continue? Thanks.

most servers write into a logfile during startup. If
you know that file, your program can wait until no
more changes are done to this logfile.This implies that the client has to wait (no more changes made to the logfile). Wouldn't it be
simpler then to attempt to connect, wait, say 30 seconds if the attempt failed and try again?
The OP wrote that the server can be up after 30 seconds of whatchamacallit, so, say, five
retries with a sleep of 30 seconds would be adequate, don't you think?
kind regards,
Jos

Similar Messages

  • Java.lang.Process input stream waiting until process is complete to print

    I have tried to simplify this problem as much as possible. Basically, I have a java.lang.Process which executes a simple C program.
    test.c
    #include <stdio.h>
    #include <unistd.h>
    int main()
      printf("foo\n");
      sleep(2);
      printf("bar\n");
    ...The process has an input stream and error stream handler each on a separate thread. I have tried both buffered and unbuffered (BufferedReader, BufferedInputStream, InputStreamReader...) stream handlers. Both produce the same problem of waiting until the process has exited to receive anything from the process's streams.
    The only time this does not happen is when I call fflush(stdout); after each printf(). This can't be a solution because the real application calls a massive C application which would require thousands of fflush()'s to be added. What is causing this to happen? This doesn't happen when the C program is executed from the shell. Is there a way the InputStream can be forced to extract from the stream?

    hi.....
    I have closed the output stream of the process as you told me to do...
    The hitch is that, if my program contains only printf() statements,it works fine
    as soon as scanf() statement is encountered within the C code,it is totally neglected,and the output comes as if no scanf() statement existed in the C code.
    Consequently the thread doesnt wait for input which was bound for scanf() from the thread
    the code...
        public void run()
         try
             PrintWriter out = new PrintWriter(socket.getOutputStream(),true);
             BufferedReader in = new BufferedReader(
                            new InputStreamReader(
                            socket.getInputStream()));
             try
                     Process p;
              p=new ProcessBuilder("./a.out").start();
                     PrintWriter exOut=null;
                     BufferedReader exIn=null;
              exOut = new PrintWriter(p.getOutputStream(),true);
              exIn = new BufferedReader(
                           new InputStreamReader(
                           p.getInputStream()));
                  //String inputLine="", outputLine="";        
                  String str="";
                     int c;          
                  while(true)                   
                        //System.out.println("In While");
                  str="";exOut.close();                  
                        while((c=exIn.read())!=-1)
                                 str=str+(char)(c);
                                    System.out.print(str);
                        str=str+(char)(0);
                        System.out.print(str+"outside");
                        out.print(str);
                        sleep(100);
                        try
                            int x=p.exitValue();
                              out.print(str);
                   System.out.print("Bye 1");
                            String str1="Bye"+(char)(0);
                   out.println(str1);              
                   break;
                        catch(IllegalThreadStateException e)
                            //System.out.println("The Process has not ended yet");
                        //str=str+((char)-1);
                        //System.out.print(str+"Control reaches here too");
                        str="";
                        exOut = new PrintWriter(p.getOutputStream(),true);//I have tried to run the program without this also but the effect is the same
                        while((c=in.read())!=-1)
                            str=str+(char)(c);                                    
                        if(str.contentEquals(""))
                                System.out.print("Bye 2");
                                String str1="Bye"+(char)(0);
                                out.println(str1); 
                                p.destroy();
                                exOut.close();
                                exIn.close();
                                out.close();
                                in.close();        
                                socket.close();
                                break;
                        //str=str+(char)(0);
                  exOut.print(str);
                        try
                            int x=p.exitValue();
                            System.out.print("Bye 3");
                            String str1="Bye"+(char)(0);
                   out.println(str1);
                            break;
                        catch(IllegalThreadStateException e)
                            //System.out.println("The Process has not ended yet");
                  /*while ((inputLine = in.readLine()) != null)
                        exOut.println(inputLine);
                        outputLine=exIn.readLine();
                        //outputLine=inputLine;
                        //out.println(outputLine);}*/                   
             exOut.close();
             exIn.close();
             catch(IOException e)
                  System.err.println("Accept failed."+e);
             out.close();
             in.close();        
             socket.close();
         catch (Exception e)
             e.printStackTrace();
    }

  • How to wait until the 1st part of the processing is done

    Hi,
    I had a hard time to combine two parts of processing in one .vi file, and thus would like to get some advice/help through the forum.
    Attached is the partial finished vi file I made. You can see that it is composed of two parts. The upper part is to run a bat file (check_result.bat), which generates a result.txt file. The lower part is to use the result.txt file as an input file, and check if the key word called "test case passed" is included in the result.txt file or not. So I want to run the upper part firstly, and then run the lower part after the upper part is finished.
    However, I don't know how to connect the two parts in a right way that the lower part only starts running after the upper part is finished. Any comments/help is highly appreciated.
    Thank you in advance.
    Xuedong 
    Attachments:
    question.vi ‏49 KB

    The magic of dataflow!
    All you need is a data dependency between the two parts. Often critical parts of each section contain error terminals, so you can just string em along in the proper order and each part must wait until the previous node has finished.
    In your particular case, the read operation has no error input, so you can recruit any other input. Create a fake data dependency by strategically placing a small sequence frame containing common code. The sequence cannot start until all code that provides imputs has finished, serving your purpose.
    Of course it seems silly to even try to read the file if the previous node failed. Right? So simply place the second part inside a case and hook it up to the error output. Now the second part (1) waits until the first part has finished AND (2) execute only of the first part succeeded. No sequence needed.
    All clear?  
    Message Edited by altenbach on 02-07-2007 02:34 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    dataflow.gif ‏4 KB
    dataflow2.gif ‏4 KB

  • Wait until the session has been processed

    Hi folks,
    I have a report in which I create and trigger an SM35 session. I use RSBDCSUB report to do the same.
    Now, is there anyway to wait until the session has been processed? I mean, I need to do a few things in the report only after the session has been processed.
    Thanks
    Sagar

    Hi,
    You could try checking the job status (table TBTCO) inside a DO or WHILE loop.  To pause up to 5 seconds between your lookup on TBTCO, you can call function module 'RZL_SLEEP'. 
    If checking TBTCO does not work out for you, you can try the same loop logic with a call to function module 'ENQUEUE_BDC_QID' instead of looking up the job status.  If the enqueue has been released then the job has finished.
    Regards,
    James G.

  • How to keep waiting time between processed messages !!

    Hi Folks,
    I have got one scenario required waiting time between processed messages. The problem as follows !!
    File --> Proxy scenario. I receive 15 messages from sender side (same messages structure) so working with one interfaces. File picking and transforming this message and split into 2 messages. messages are receiving to receiver. I am using BPM with 7,8 steps like receiving step, block , message transformation step , internal block 1 for sender 1, internal block 2 for sender 2.
    All things are working fine, messages are going to receiver properly. But customer requirement is , wait step required between processed messages before sender1. I have put wait step still, PI picks all messages in one shot processing and waiting for 2 minutes, after 2 minutes sending all messages at the same time, this process is not working.
    I have tried with wait step in mapping (Sarvesh) given excellent idea, still PI works the same way.
    Can someone please explain a bit why the messages or not waiting message by message. I am using EOIO with Queue name and file process mode "BY NAME" and I have tried "BY TIME" as well. I have given priority to this Queue. On BPM Queue assignment : One Queue.
    Please I am expecting positive answer !!
    Many Thanks in Advance
    San

    Hi Rudolf Yaskorski ,
    Not sure about your PI release and BPM model, do you create separate process instance for each file, or do you process files collecting them in one single instance? Are you using parallelization within your ccBPM ?
    I am using serialization, I don't think bpm can do Parallization until PI 7.0, but PI 7.11 has got has queue assignment. But I am using one queue. This must be serialization.
    To me it looks like your issue is not in ccBPM but rather more in polling files (as per your post file CC polls all 15 files in one shot). So if you wish to poll the files not at the same time some workaround is required. Possible options you could check out:
    A. Either implement "wait" in your mapping based on file name or other criteria (e.g. directory name). Check out if respective BPM instances are really created at different times.
    I have used wait step in mapping. These 15 messages has to go through one interface. So I am using one interface. But I have checked mapping process time in all messages on receiver system. Shows same timing, even though I put 40000 ms waiting time in mapping.
    B. Try polling different files (or use different directories) with different channels and coordinate starting / stopping of your channels by scheduling availability for each CC in RWB. E.g. you poll file 1 with CC 1. You start 2 minutes later CC 2 and poll file 2. And so on.
    I am not clear about this . On BPM waiting step is working and it keeps wait all messages, which are coming through one interface. Then it releases all messages at the same time.
    I don't know how to resolve this. I have tried with Transport acknowledgment, but all messages are going to reciver system waiting at receiver system in priority queue and processing in EOIO, but taking so long. Rather all messages go and sits in queue, I want to stop messages by message with 2 minutes time gap. How please?
    Kind Regards
    San

  • File Adapter -- Picking has to wait untill it get fully loaded/write.

    Hi All,
    I need to pick the files from a folder and I need to pick the files only which has been written completely.
    I should not pick the file in the middle while writing, I need to wait untill it finishes the writing completely.
    Is there any setting I can put in Sender File adapter to do this?
    Thanks
    Seema

    Nithya,
    >> Try to increase the processing time in the sender communication channel, so that it allows you to completely load the file. Check the time which is needed to upload the file to the directory manually and correspondingly change the processing time.
    We do not know exactly at what time the file will be placed in the folder. It may be at any time. So I cannot put the processing time accurately.
    Aamir,
    >> If you are picking from FTP,MSecs wont work there.the sender program which writes the file must write the file in some temporary format like .dat etc and once the file is complete it should change the filename to .txt,configure the sender file adapter to pick only *.txt files.
    This is a good idea. But I don't think I can ask them to change at the other end as it is working previously with other middleware.
    Guys,
    Can you please advice which is the best thing we can do at this point of time.?
    Thanks
    Seema.

  • WaitFor() doesn't wait for my process to complete?

    Hi all,
    I'm launching a browser from my java program to display a text file, and when this is done i want to delete that text file from the server, so i tell the process that launches the browser to wait, then i make a call to delete the file from the server
    my code goes something like this:
    Process browserProc = Runtime.getRuntime().exec(<command to launch browser>);
    browserProc.waitFor();
    //here i call an external process to delete the file
    this works sometimes, but others the file is deleted before the browser gets to display it. what am i doing wrong?! if this is due to subprocesses being spawned is there any solution? any help is greatly appreciated!
    thanks and regards,
    emh3

    This is from some legacy code..urlToPointTo is the url
    of my file - does this fall into that category?Apparently it does. And it should, too. I can see the designers thinking "Should this command wait until the GUI is closed? No. Of course not. Obviously the user of this command only wants to launch the GUI. Why on earth would they want to wait until it is closed?"
    When you are having so much trouble doing something so simple, that's a good indication that you're doing something that isn't a good idea. Can you explain why you need to delete the remote file after it's displayed? Maybe that was your idea of how to implement some other requirement.

  • How can I wait until a Swing.Timer has finished?

    I have a Swing.Timer runing which displays some animated text (more precisely it fades out a text with a delay of 50 until all characters are erased.
    Afterwards a time consuming operation shall begin. How can I achieve that this operation waits to start until the text has been faded out? The time to fade out the text depends on the length of the text, of course.
    So, how can I make the operation waiting until the Timer has finished its work?
    Thanks,
    Dirk

    dirku wrote:
    I have a Swing.Timer runing which displays some animated text (more precisely it fades out a text with a delay of 50 until all characters are erased.
    Afterwards a time consuming operation shall begin. How can I achieve that this operation waits to start until the text has been faded out? The time to fade out the text depends on the length of the text, of course.
    So, how can I make the operation waiting until the Timer has finished its work?I gave you an answer to this with sample code yesterday:
    [http://forum.java.sun.com/thread.jspa?threadID=5294087&messageID=10244564#10244564|http://forum.java.sun.com/thread.jspa?threadID=5294087&messageID=10244564#10244564]
            public void actionPerformed(ActionEvent e)
                if (sb.length() > 0)
                    sb.deleteCharAt(0);
                    label.setText(sb.toString());
                else
                    label.setForeground(color);
                    label.setText(text);
                    Timer timer = (Timer)e.getSource();
                    timer.stop();
                    // ***** start process here ***
            }The timer here continues until a condition is satisfied (here it's where the Stringbuffer that holds the text that is sent to the JLabel is empty). So all you have to do is place any code that needs to happen when the Timer ends in the else block. It's so simple as to be trivial.

  • [Restore] "Waiting for iPod to become Ready"? [ver 1.2 iTunes 7.0]

    I just updated my iTunes from version 6.0.5 to 7.0. This install also updated my iPod. My iPod is no longer read by my computer or any other. ***? Now when I attmept to connect it to any Mac it freezes up and fails to mount. Come on apple. Also, why the is there no longer an iPod preference section in the new iTunes. I keep trying to Restore the firmware, but I keep getting the "Waiting for iPod to become ready" message.
    Attempted solutions:
    • Re-installing iTunes 7.0 (no luck)
    • Resetting the iPod (no luck)
    • Forcing the iPod into disk mode (no luck)
    • Re-installing iPod software (iPod won't mount...so that didn't work)
    HELP!!!

    You may want to look at this:
    http://docs.info.apple.com/article.html?artnum=61705
    You may want to look at this:
    http://docs.info.apple.com/article.html?artnum=61705
    I had the same problem and was able to fix it by following the directions on resetting the iPod, renaming the iPod and also ensuring that I removed any files that might not be understood by the iPod from the 'notes' folder on the iPod (if you have enabled disk access):
    http://discussions.apple.com/message.jspa?messageID=3111498#3111498
    PS: If you need to get out of the 'Do not disconnect' screen so that you can apply these changes you need to hold down the 'menu' and 'select' or center button until you see the Apple logo. When the iPod mount you can proceed to reset the iPod to original settings which will erase everything from the iPod but not your iTunes library on your computer

  • How to wait until an Entourage Schedule item completed

    I am trying to script the "Send & Receive All" operation in Entourage, and I have found that I can trigger the process off (from within my script) by:
    tell application "Microsoft Entourage"
    execute schedule "Send & Receive All"
    end tell
    However, the script continues to process while the scheduled actions take place.
    Is there any way to wait until the schedule actions complete and then process the rest of the script?
    Thanks
    Susan

    Glad to help, Susan
    I found out about "connection in progress" by looking at the properties of "application" in the Entourage dictionary:
    connection in progress boolean [r/o] -- Are there any network connections in progress?
    (In fact I searched through the dictionary for the phrase "connect".) The property is a boolean (true/false), and my script uses a "repeat while" loop to test for that boolean condition.
    As well as properties, the Entourage application object also has elements. These include "POP account", "IMAP account", "Exchange account" and "Hotmail account". These can be referred to "by numeric index, test". So if you pass a list of accounts to the "connect" command, Entourage will connect and download mail from those accounts. For example, if you have two POP accounts, this works:
    tell application "Microsoft Entourage" to connect to {POP account 1, POP account 2}
    AppleScript lists are contained in curly braces.
    But it's simpler (and less prone to error) to do this:
    tell application "Microsoft Entourage" to connect to every POP account
    Alternatively, the "test" lets you refer to individual accounts by name - a list isn't essential, despite what the dictionary says:
    tell application "Microsoft Entourage" to connect to POP account "My Account"
    There's many ways of skinning a cat.
    To answer your more general question, though, there is no one "user guide" for AppleScript. You can learn the about the basics of the language from the AppleScript Language Guide. But that will tell you nothing about how to script particular applications. This is because every developer, if they do implement AppleScript in their application (and lots don't), implements it in different ways.
    So as well as learning AS, for each application that you want to script you have to learn a slightly different set of commands. There's an awful lot of trial and error involved, but one way to learn is to look at scripts that others have written. There are good resources at Apple's own AppleScript page and at AppleScript Central among others. For specifically scripting Entourage, try Paul Berkowitz's scripts.
    Different people will also recommend different books. My recommendation is AppleScript: The Definitive Guide by Matt Neuberg, but again it's not application-specific.
    Hope this helps, at least to give you some pointers.
    H

  • "Waiting for index to be ready (905 0)"

    The behavior of TM (and also Time Capsule) seems to have deteriorated significantly since I did the latest TC firmware upgrade. I realize this is the TM forum and that is the basis of this question, but the revised TC is much more difficult to be seen by the TM process since the upgrade and thus results in many failed or unfinished TM backups.
    TM has failed in the last three attempts and seems to have fallen into a loop. The log of the atempt before the current one shows the following:
    Starting standard backup
    Mounted network destination using URL: afp://[email protected]/Data
    Backup destination mounted at path: /Volumes/Data
    Disk image /Volumes/Data/MacBook3_001b63af0352.sparsebundle mounted at: /Volumes/Backup of MacBook3
    Backing up to: /Volumes/Backup of MacBook3/Backups.backupdb
    Event store UUIDs don't match for volume: Backup of MacBook3
    Node requires deep traversal:/Volumes/Backup of MacBook3 reason:kFSEDBEventFlagMustScanSubDirs|kFSEDBEventFlagReasonEventDBUntrustable|
    No pre-backup thinning needed: 736.8 MB requested (including padding), 468.91 GB available
    Waiting for index to be ready (905 > 0)
    Waiting for index to be ready (905 > 0)
    Waiting for index to be ready (905 > 0)
    Waiting for index to be ready (905 > 0)
    Waiting for index to be ready (905 > 0)
    Waiting for index to be ready (905 > 0)
    Waiting for index to be ready (905 > 0)
    Waiting for index to be ready (905 > 0)
    Waiting for index to be ready (905 > 0)
    Waiting for index to be ready (905 > 0)
    Waiting for index to be ready (905 > 0)
    Waiting for index to be ready (905 > 0)
    Waiting for index to be ready (905 > 0)
    Waiting for index to be ready (905 > 0)
    Waiting for index to be ready (905 > 0)
    Stopping backupd to allow ejection of backup destination disk!
    Error writing to backup log. NSFileHandleOperationException:* -[NSConcreteFileHandle writeData:]: Input/output error
    Error writing to backup log. NSFileHandleOperationException:* -[NSConcreteFileHandle writeData:]: Input/output error
    Copied 0 files (0 bytes) from volume Macintosh HD.
    Error writing to backup log. NSFileHandleOperationException:* -[NSConcreteFileHandle writeData:]: Input/output error
    Error writing to backup log. NSFileHandleOperationException:* -[NSConcreteFileHandle writeData:]: Input/output error
    Error writing to backup log. NSFileH
    .... at which point, I guess the sleep timer kicked in.
    The current backup attempt has the same initial messages and is presently looping on "Waiting for index to be ready (905>0)".
    Any help and advice much appreciated.

    travellerva wrote:
    When you say "disk problems", do you mean hardware problems, firmware problems or software problems?
    On directly-attached disks, we see this when the disk spins down, but won't spin back up fast enough or properly; or with a USB disk that gets its power from the Mac, but not quite enough sometimes; or port or cable problems; or one that's beginning to fail. It's very hard to tell, of course, which.
    I'm not very familiar with TCs, but a disk is a disk!

  • What is going on "under the hood" of the 'Wait Until Next ms Multiple' vi?

    Hi,
    This question is really for the developers of LabVIEW, and I don't know if they are willing to divulge what might be considered "trade secrets". Anyway, I just thought there's no harm in asking.
    I use the Wait Until Next ms Multiple vi and it works great. For example, if I set my program to output a character on the serial port every 20 millisecond (mS), and check the output on an oscilloscope, I see the output at 20 +/-2 mS (that is, 18 to 22 mS). That's quite good and is all that can be expected on a PC running a non-real-time OS such as Windows.
    My question is this: Since the default Windows timer has a tick rate of 15.625 (1/64th of a second) (some PC's may default to 10 mS), how does LabVIEW attain roughly 1 mS accuracy? If the same thing is coded in any .NET framework program, such as C# or Visual Basic using any of the available timers (the System.Windows.Forms timer or the .System timer), the timer interval may be set in 1 mS increments, but if you time it you will see it actually has a granularity of 15.625 mS. So instead of getting 20 mS I get 2 ticks, or about 31 mS. So I can get an output every 15.6, 31, 47, 62.5, etc. but nothing in between.
    The System.Diagnostics.Stopwatch timer can be use to time code with very high resolution, or to create a high-CPU usage delay loop, but I haven't been able to find an easy way of generating an interrupt (timer tick) at say 1 mS. There are Win API functions that can set the timer to 1 mS on XP and 0.5 mS on Windows 7 and 8 Microsoft, but I have not tried them. (They come with the caveat that another program or process can come along and reset your timer!) There is the "multi-media" timer (now the HPET or High Performance Event Timer"), but it is meant for sound and video at the driver/kernel level, and not for the UI level, as LabVIEW or C# are.
    So how does the 'Wait Until Next ms Multiple work? It obviously is timer interrupt-driven because it yields to other processes (which is a primary reason for putting it in your overall While loop). And is it guaranteed on all recent OS versions (mine was timed on an dual core XP OS)?
    Thanks for any insight.
    Your typical curious engineer,
    Ed

    Ian,
    Thanks for your reply. Yes, I'm sure LabVIEW uses the (default) Windows timer. And yes, 1 mS is not guaranteed due to the preemptive nature of Windows (and even "RTOSs" to varying degrees), which is why I see about plus or minus 2 mS. 
    Apparently the Windows timer can be set by API calls. See: http://www.lucashale.com/timer-resolution/. Here's a screen shot of his TimerResolution.exe on a Windows 7 PC:
    Here it is on my Windows XP PC after I set it to "Maximum" (initially it was 15.625 mS):
    Notice that it sets the Maximum to less than 1 mS, which is supposed to be the max, so there are some bugs. Plus the Default button does not reset it in XP, but does work on Windows 7 or 8. (I know this is not the place to "debug" non-LabVIEW applications!)
    I'll bet LabVIEW sets it, too. The only caveat, as I said, is it looks like another application can change it, since the hardware timer is a "global" timer. I have not seen this issue in my LabVIEW applications, have you?
    I guess I need to do some more digging to see the code to set the timer, but it looks like the developers of LabVIEW have it figured it out.
    (FYI, I did notice that running my LabVIEW app (which gives about 2 mS resolution) or a C# app, which gives 15.625 mS resolution, does not affect what TimerResolution.exe reports, so I'm not sure if it's really working correctly. If I figure it out I'll post the results.)
    Ed

  • How to make VI wait until data is saved before it can open and read data

    I have developed two VIs for continuous monitoring. First VI is for acquiring raw strain data and saving it into a folder, let's say, every 10 minutes or every 100 Mbyte of data (for example, after monitoring for an hour, the folder will have 6 files, each of which contains 10 minutes of data). Second VI is for opening/reading/processing data files collected by the first VI.   Right now, this second VI can handle only one file at a time. What I am trying to do is to have this second VI open the files one after another automatically. Also (here is what I think will be difficult part), I want the second VI recognize that a file is saved by the first VI before opening it (i.e., wait until the first 10 minutes of data file is saved by first VI, open and process this first data, wait until the second 10 minutes of data file is saved by first VI, open this second file and process it, wait until the third 10 minutes of data file is saved by first VI, open and process it........). Any help or comments would be appreciated.
    Thanks in advance for your help.
    Brdg.

    Basically, If your purpose is to keep one thread from opening the file until the DAQ thread has finished with it, then the queue is what I would use.
    All functions are on the ADVANCED | SYNCHRONIZATION | QUEUE palette.
    Use the OBTAIN QUEUE to create the queue. Set the DATA TYPE to a PATH constant. This creates a queue of paths.
    Pass the QUEUE REFNUM to both the DAQ VI, and the PROCESSING vi.
    In the DAQ VI, when you write a file, take the PATH from the CLOSE FILE function and use ENQUEUE ELEMENT to put it into the queue (use the refnum you passed in).
    In the processing thread, use DEQUEUE ELEMENT to fetch the path from the queue. You probably should use a timeout value of 1000 mSec or so. If you timed out, go check your PROGRAM RUNNING flag (so you can stop without waiting forever on the queue), and if you're not stopped, try again.
    If the DEQUEUE ELEMENT returns WITHOUT a timeout, then open the path it gives you - the file is guaranteed to be closed, since you closed it before you enqueued it.
    Steve Bird
    Culverson Software - Elegant software that is a pleasure to use.
    Culverson.com
    Blog for (mostly LabVIEW) programmers: Tips And Tricks

  • How to make a slide wait until user has answered a question correctly, even after activating a smartshape?

    Background:
    I have created a quiz in which the user must answer each question correctly before proceeding to the next slide. This is what I did:
    Set preferences to Settings > Required > Answer All - The user must answer every question to continue
    Set the number of attempts on the question level to Infinite
    Made the Next button invisible and disabled the playbar
    This way, the user can only proceed to the next question slide with the Submit process – and, since attempts are infinite, that means only after successfully answering the question.
    Current goal: 
    I want the user to be able to click on a prompt for a hint. To set this up, I did the following:
    Created a smartshape labeled “click_for_hint” displaying text that says, “Click here for a hint”
    Created a smartshape labeled “hint” displaying text hint
    Set “click_for_hint” to show “hint” on success
    Now, when the user clicks on the text that says, “Click here for a hint,” the hint pops up. So, that works – awesome! However, once the hint is activated, I would like for the user to be able to continue infinite attempts until successfully answering the question… and only then, after answering correctly, proceed to the next slide.
    The problem:
    If the user has submitted one or more incorrect answers and then activates the hint, the slide no longer waits until the user has answered the question correctly. Instead, it automatically resumes playing, proceeding to the next slide. I tried setting the smartshape “hint” to pause on success, but that did not work.
    Is there a way to make the slide wait until the question is answered correctly before proceeding to the next slide, even after the hint has been activated?

    Are you aware of the fact that your Required setting can cause problems, blocking the user? It is also totally unnecessary, because you have infinite attempts on question level, and did hide the Next button (hope you don't need Review, otherwise I would recommend not to hide that button but to drag it under the Clear button: Question Question Slides in Captivate - Captivate blog)
    The hint problem is linked with the fact that a simple action will release the playhead. I would like to see the timeline of the slide, to compare the pausing points of the shape button and the question slide. And maybe this blog post can also clarify difference between simple/advanced: Why choose Standard over Simple action? - Captivate blog
    As for shape buttons on question slides: Buttons on Question/Score Slides in Captivate 6? - Captivate blog

  • URLLoader - how to wait until URL is loaded and then contine...

    Hello,
    I have litle problem because I don't know how to load
    external XML file, wait when loading is completed and after that
    continue with next code.
    Consider following situation. I have a function in
    actionscript, let's say, handleXML()
    function handleXML() {
    someURLRequest = new URLRequest("some XML file");
    someURLLoader.addEventListener("complete","LoadCompleted");
    someURLLoader.load(someURLRequest );
    Alert.show("Print Second")
    function LoadCompleted(event:Event) {
    someXML = XML(someURLLoader.data)
    Alert.Show("Print first")
    The problem is, when someURLLoader.load is called, Alert
    window with Print second is displayed and then "Print first" alert
    is displayed because flex perform action behind someURLLoader.load
    and then perform function LoadCompleted().
    I would like that first, when someURLLoader.load is called, flex
    wait until external XML is loaded, display "Prinf first" alert AND
    THEN continue with code and displat "Print second" alert.
    It is possible to do it someway??
    thanks for help

    Hi, thanks for answer, but I think it is the same:) So what
    happens if I change your code like this...
    srv = new HTTPService();
    srv.url = "some XML file";
    srv.resultFormat = "xml";
    srv.addEventListener( ResultEvent.RESULT, loadCompleted );
    srv.send();
    Alert.show("Print Second")
    function loadCompleted( event:ResultEvent ) : void
    someXML = XML(event.result);
    Alert.show("Print First")
    In this case, after calling srv.send(), next code in the
    fuction is performed, so the Alert "Print Second"" is dsplayed.
    After that, URL request is completed and "Print Second" appears. I
    think it is because data calls are asynchronous. Is it there a
    possibillity to wait after calling send() function, until the
    request is processed and then continue with code which the send()
    function was called from ? It means, first Alert.show("Print
    First") is executed and then Alert.show("Print Second").???

Maybe you are looking for