Post Reply 
wait(-1)
06-18-2019, 06:37 PM
Post: #1
wait(-1)
Bonjour

Un problème avec WAIT(-1), voici un petit bout de code assez simple un premier WAIT détecte que vous touchez l'écran, on entre alors dans une boucle qui attend que vous relachiez l'écran.
Si vous faites un glissé lent ou un étirement ces événements sont bien enregistrés dans L2 puis quand vous relachez le programme s'arrête et le premier élément de la dernière liste de L2 est =2
souris relachée.
Si par contre vous faîtes un glissé rapide et que vous relachez dans la foulée pour donner un effet kinétique alors le programme ne s'arrête pas car le dernier événement détecté est de type 1.

J'espère être assez clair ?

Hello

A problem with WAIT(-1), here is a small piece of code quite simple a first WAIT detects that you touch the screen, we then enter a loop that waits for you to release the screen.
If you do a slow drag or stretch these events are well recorded in L2 then when you release the program stops and the first item in the last list of L2 is =2
mouse released.
If, on the other hand, you make a quick slip and release in the process to give a kinetic effect, then the program does not stop because the last event detected is type 1.

I hope I'm clear enough?

Translated with http://www.DeepL.com/Translator

Code:
EXPORT ESSW()
BEGIN
 L1:={};L2:={};A:=0;
 TEXTOUT_P("Toucher l écran",100,125,3);
 L1:=WAIT(−1);
 RECT_P();
 TEXTOUT_P("Relacher pour quitter",100,125,3);
 REPEAT
  L2(0):=WAIT(−1);A:=A+1;
 UNTIL L2(A,1)==2; 
 {L1,L2};
END;

Sorry for my english
Find all posts by this user
Quote this message in a reply
06-18-2019, 08:58 PM
Post: #2
RE: wait(-1)
They are aware of that
https://www.hpmuseum.org/forum/thread-5074.html

Viga C | TD | FB
Visit this user's website Find all posts by this user
Quote this message in a reply
06-18-2019, 09:02 PM
Post: #3
RE: wait(-1)
Certainly it has only limited me to hide an image scrollbar, it has not generated any other problem.

Viga C | TD | FB
Visit this user's website Find all posts by this user
Quote this message in a reply
06-19-2019, 04:52 AM
Post: #4
RE: wait(-1)
(06-18-2019 09:02 PM)Carlos295pz Wrote:  Certainly it has only limited me to hide an image scrollbar, it has not generated any other problem.

Bonjour Carlos295pz

Merci de vôtre réponse, je n'avais pas vu cette discussion.
Tim en est conscient mais ne semble pas convaincu.
Typiquement ce petit bout de code est me semble t-il un problème comment savoir quand l'utilisateur a relaché l'écran, j'ai essayé d'ajouter un test sur MOUSE(4) mais celui renvoie toujours 2 = glissé.
De plus il arrive qu'un glissé simple soit quelquefois interprété comme un glissé kinétique et peut ainsi bloquer un programme.

Hello Carlos295pz

Thank you for your answer, I hadn't seen this discussion.
Tim is aware of this but does not seem convinced.
Typically this little piece of code seems to me to be a problem how to know when the user released the screen, I tried to add a test on MOUSE(4) but the one always returns 2 = slipped.
In addition, it happens that a simple slide is sometimes interpreted as a kinetic slide and can thus block a program.

Translated with http://www.DeepL.com/Translator

Sorry for my english
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)