VIDEO

 

Syntax:

 

       Then: VIDEO off
       Then: VIDEO on
       Then: VIDEO sync

 

Version Ref:  4.5

 

Description:

Turns video updates on and off, or synchronizes screen to most current appearance without turning video on or off.

VIDEO SYNC forces the screen to be updated to the current state, without turning video back on.

If video updating is turned off, it is automatically turned back on if filePro needs to get a keystroke, and no PUSHKEYs are pending. This prevents the system from appearing frozen when it is in fact waiting for user input.

 

IMPORTANT: There are instances when you might need VIDEO SYNC or else you will not "see" what you expect to see. Because of the internal workings of filePro's "virtual screen", a change may happen to the screen that the process does not show. Consider the following code:

 

       Then: end
@keyT    If:
       Then:
       Then: show popup "the time is"<@tm
         If: @os eq "dos"
       Then: sleep "3000"
         If: @os eq "unix"
       Then: sleep "3"
       Then: clears ; end

The above code will not show anything on the screen! This is because filePro works internally, updating and displaying a virtual screen. If a change and a clear of that change are put up in sequence with nothing else happening, by the time the screen gets displayed, it is already in its cleared state. The code can be fixed by adding the VIDEO SYNC command to line 3 as follows:

 

       Then: show popup "the time is"<@tm ; video sync

 

This tells filePro to refresh all changes to the screen at that point, regardless of what follows. A blank screen is a fairly rare instance in filePro, but it is distressing not to know the explanation for this behavior when you do come across it.

 

HINT: When used with PUSHKEY, turning off the video updates with VIDEO OFF can produce very clean operations. Use VIDEO ON to turn screen updating back on when the pushkey is done.

 

 

Examples :

Use index A to find the name "Brody".

 

       Then: video off ; pushkey "X4ABrody[ENTR]" ; end

 

Automatically perform a long sequence of commands that normally update the display, and let the user know what’s going on.

 

       Then: show popup "Performing calculations..." ; video off ; clears

 

...put first part of calculations here...

 

       Then: show popup "Done first part. Starting part 2..." ;
             video sync ; clears

 

... put next part here...

 

       Then: video on ; msgbox "Done."

 

TIP on VIDEO SYNC

Use VIDEO SYNC to force the screen to be immediately drawn after showing the message.  Of course, this may slow things down if it draws many messages.  (Note how filePro updates the screen once a second, rather than every X records.)

Perhaps a subroutine?

    VidSync
          If:
        Then:  Declare LastTime(8,hms,g)
          If:  LastTime ne @tm
        Then:  video sync ; LastTime = @tm
          If:
        Then:  return

Then simply "gosub VidSync" to update the screen.  If more than one second has elapsed since the last call (or if this is the first call),
then the screen will be updated.