Key press cause animation stop...

Author: dammie@seznam.cz (dammie)

Hi,

I am implementing loop interupt and find out, that every key press cause animation stop on form.... (despite refresh and show command)

Is there any way how to avoid this behaviour or re-run animation again ?

Example: code button <detail> trigger - after button click it animates runing numbers countup in field but if you press any key animation stops and field is then refreshed after loop ends

varibales
  x numeric 
endvariables

x = 0
while ( x < 100000 )
  refresh
  show 
  FIELD = x
  x = x + 1
endwhile

 

(Uniface 9.3)

3 Comments

  1. Hi David,

    saw what you mean, but please have in mind;

    the "SHOW" command was introduced to uniface
    to provide widget handles prior to the edit command

    Not to show in-between animations;
    the single-best one would be plain messages.

    Maybe using the READ_KEY option I mentioned on your other Question will help you out of the problem.
     

    Success, Uli


    Author: ulrich-merkel (ulrichmerkel@web.de)
  2. OK, I implemented READ_KEY via dll...( as mentioned here http://uniface.communityzero.com/uniface?go=2209990 )


    varibales
      x numeric
    endvariables

    x = 0
    while ( x < 100000 )
      refresh
      show
      FIELD = x

      activate "my3gl".READ_KEY() ;perform "READ_KEY"
                 ; testing for SPACE or ESCAPE or SCROLL LOCK or PAUSE
                if (($status == 32)||($status == 27)||($status == 145)||($status == 19))
                      askmess "Cancel ?"
                      if ($status = 1)
                        break
                      endif
                endif


      x = x + 1
    endwhile

    For listed keys (SPACE, ESCAPE, SCROLL LOCK, PAUSE) it works very well, but if I press other
    key, loop is still running (thats O.K.) but animation is stopped (what I dont want to).

    Now... In loop still running but without animation, I press listed key (SPACE, ESCAPE, SCROLL LOCK, PAUSE) and askmess
    "Cancel?" appear. if I choose NO (I want loop to continue) .... animation continues properly from that moment! :-O


    Author: dammie (dammie@seznam.cz)
  3. Hi David,

    looks like the askmess reset the "show" context.

    In the example from awen, he choose to check only a couple of keys; you can make it "ANYKEY" as well.

    Think this will solve the situation.

    Success, Uli


    Author: ulrich-merkel (ulrichmerkel@web.de)