

![]() | Start a set with this search |
![]() | Include this search in one of my sets |
![]() | Exclude this search from one of my sets |
![]() | Permalink to these results Paste this link in email or IM: |
| Atom feed for tracking future search results Paste this URL into your reader: |
29 messages in org.openoffice.fr.progRe: [prog] Chronomètre| From | Sent On | Attachments |
|---|---|---|
| Michel Grentzinger | Oct 9, 2007 7:53 am | |
| Laurent Godard | Oct 9, 2007 8:25 am | |
| Bernard Marcelly | Oct 9, 2007 10:02 am | |
| Laurent Godard | Oct 9, 2007 10:11 am | |
| Michel Grentzinger | Oct 9, 2007 10:58 am | |
| Anthony Benoist | Oct 9, 2007 4:15 pm | |
| Serge LE LOUARNE | Oct 10, 2007 12:43 am | |
| Anthony Benoist | Oct 10, 2007 1:06 am | |
| Serge LE LOUARNE | Oct 10, 2007 1:18 am | |
| Bernard Marcelly | Oct 10, 2007 6:03 am | |
| Anthony Benoist | Oct 10, 2007 6:28 am | |
| Michel Grentzinger | Oct 10, 2007 11:38 am | |
| Anthony Benoist | Oct 10, 2007 12:47 pm | |
| Laurent Godard | Oct 10, 2007 1:30 pm | |
| Anthony Benoist | Oct 10, 2007 3:07 pm | |
| Bernard Marcelly | Oct 11, 2007 5:17 am | |
| Michel Grentzinger | Oct 11, 2007 5:40 am | |
| Bernard Marcelly | Oct 11, 2007 6:02 am | |
| Francois Gatto | Oct 11, 2007 10:22 am | |
| Anthony Benoist | Oct 11, 2007 10:26 am | |
| Anthony Benoist | Oct 11, 2007 10:37 am | |
| Michel Grentzinger | Oct 11, 2007 11:01 am | |
| Bernard Marcelly | Oct 11, 2007 11:37 am | |
| Hervé Grac | Oct 11, 2007 11:54 am | |
| Michel Grentzinger | Oct 11, 2007 1:26 pm | |
| christianwtd | Oct 13, 2007 8:11 am | |
| Bernard Marcelly | Oct 13, 2007 12:49 pm | |
| Bernard Marcelly | Oct 13, 2007 1:04 pm | |
| christianwtd | Oct 14, 2007 1:56 am |

![]() | Permalink for this message Paste this link in email or IM: |
![]() | Permalink for this thread Paste this link in email or IM: |
| Atom feed for this thread Paste this URL into your reader: |
| Subject: | Re: [prog] Chronomètre | Actions... |
|---|---|---|
| From: | Bernard Marcelly (marc...@club-internet.fr) | |
| Date: | Oct 11, 2007 6:02:47 am | |
| List: | org.openoffice.fr.prog | |
Bonjour, Alors voici ma solution. Il y en a d'autres possibles, comme d'habitude. Il s'agit d'une base de travail, sans fioritures ni contrôles anti-crétin.
Ma macro écrit à partir de la cellule courante, et finalement place le pointeur de cellule sur la dernière écrite.
La seule contrainte est de formater les cellules de temps au format Heure MM:SS,00 ce qui permet de voir les centièmes de secondes (théoriques). On peut se contenter du dixième de seconde avec le format MM:SS,0 ou de la seconde avec le format MM:SS
Sub chronoIci Dim cellule as object, feuille as object Dim t as long, x as long, y as long
if MsgBox("Départ !", 1) = 1 then ' page 150-151 t = GetSystemTicks ' page 142 cellule = thisComponent.CurrentSelection ' page 326 feuille = cellule.Spreadsheet ' page 323 x = cellule.CellAddress.Column ' page 323 y = cellule.CellAddress.Row ' page 323 Do While MsgBox("Top !", 1) = 1 ' page 114 cellule.Value = (GetSystemTicks -t)/86400000.0 ' page 86 y = y+1 cellule = Feuille.getCellByPosition(x, y) ' page 321 Loop thisComponent.CurrentController.select(cellule) ' page 327 end if End Sub
Utilisation: Cliquer sur la première cellule de la zone de temps, exemple cellule B2. Lancer la macro. Pour terminer, cliquer sur Annuler dans le message Top!
Remarque: Si vous avez cliqué plusieurs fois très rapidement sur OK du message Top! vous aurez remarqué qu'il s'écoule un délai minimal (environ 0,12 à 0,17 seconde entre deux tops sur mon PC). Je me suis demandé si on pouvait aller plus vite. Avec plusieurs variantes, MsgBox ou boutons de formulaire, même en faisant un codage plus rapide qui se contente de stocker les SystemTicks dans un tableau, j'obtiens toujours ce délai minimum entre deux tops. Probablement inhérent à la lenteur de OooBasic et API. C'est pourquoi je trouve que c'est un mauvais chronomètre.
A propos de GetSystemTicks() Sur un PC elle renvoie un nombre de millisecondes. Mais l'horloge matérielle utilisée pour cela a une période de 16ms environ, et la valeur obtenue a donc cette imprécision.
Voilà :) Les références aux pages du livre peuvent vous aider à comprendre l'algorithme. Pour la formule : dans une journée il y a 86400 secondes
Bonne journée Bernard







