Salut,

j'ai essayé SetGadgetState(99, a) et je constate qu'il prend un temps effroyable dans une boucle (enorme) !!!
Alors, j'essaye de l'executer en parallèle mais je n'y comprend rien.
Je voudrais que toutes les 4 secondes, le SetGadgetState(99, a) s'actualise (sans qu'il soit dans la boucle) : c'est le role d'un thread je crois...
Voici le code qui ne fonctinnera pas car il manque tous les dim() et autres....

Code : Tout sélectionner
Procedure AlertThread2(a)
SetGadgetState (99, a)
EndProcedure
ProgressBarGadget(99, 13, 619, 722, 15, 0, longueur_q-1)
thread =CreateThread(@AlertThread2(), a)
If thread
For a=0 To longueur_q-1 ; ecriture d'un fichier de (781250 ko soit lus de 781Mo)
;SetGadgetState(99, a) ;;;;;;
x=Random(Len(mdp3$))+1
quad_hazard.q=octets1(x)+octets1(x+1)*256+octets1(x+2)*65536+octets1(x+3)*16777216+octets1(x+4)*4294967296+octets1(x+5)*1099511627776+octets1(x+6)*281474976710656+octets1(x+7)*72057594037927936
; ici2=Random(Len(mdp3$)-10)
x=Random(Len(sph$))+1
quad_hazard.q!octets2(x)+octets2(x+1)*256+octets2(x+2)*65536+octets2(x+3)*16777216+octets2(x+4)*4294967296+octets2(x+5)*1099511627776+octets2(x+6)*281474976710656+octets2(x+7)*72057594037927936
; a$="$"+Mid(sph$,ici1,16)
; quad_hazard.q=Val(a$)
; a$="$"+Mid(mdp3$,ici2,16)
; quad_hazard.q=Val(a$)
;;;;;
tableau(a)!quad_hazard
q=Random(65536*32768-1)+cent(Random(100))
q*Random(65536*32768-1)*vingt(Random(20)+1)
q*Random(65536*32768-1)*vingt(Random(20)+1)
q*Random(65536*32768-1)+vingt(Random(20)+1)
q*Random(65536*32768-1)+vingt(Random(20)+1)
q+Random(65536*32768-1)+cent(Random(100))
q+Random(65536*32768-1)+cent(Random(100))
tableau(a)!q
WriteQuad(0, tableau(a)); ########
Next a
EndIf