|
Thread |
|
Developpeur WDF
Inscrit: 24/01/2006 13:42
De Chartres
Post(s): 142
|
Voila j'utilise dans un objet un threadExecute hélas etant appler plusieurs fois est malgré que le nom du thread change il plante. Il faut avec threadmode autoriser une procédure a etre lancer plusieurs fois or je n'ai rien trouver dans l'aide. tmp=Hasard(1000000)
ThreadExécute(i+tmp,threadNormal,::MouvXM,i,i+tmp)
Contribution le : 17/05/2006 14:29
|
|
|
Re: Thread |
|
Anonyme
|
Essayer plutôt ça:
sIdentAuto = "Thread"+HeureSys()+NumériqueVersChaîne(DonneIdentifiant())
ThreadExécute(sIdentAuto,threadNormal, ... )
Contribution le : 17/05/2006 17:23
|
|
|
Re: Thread |
|
Developpeur WDF
Inscrit: 24/01/2006 13:42
De Chartres
Post(s): 142
|
Cela ne marche pas se qui pose probleme c'est que plusieur thread utilise la meme methode et c'est pour ca qu'il me jete. Je veux remplacer mon Tantque par un thread dans ma classe. voila mon code c'est pas trés propre je vous l'accorde...
CLSuiCursor est une classe
GLOBAL
str_obj est une chaîne
str_msg est une chaîne
lstr_mot,type est un entier
Tstr_tab est un tableau dynamique
FIN
PROCEDURE Constructeur(obj,msg est une chaîne)
::str_obj = obj
::str_msg = msg
{::str_obj}..Valeur = ::str_msg
::lstr_mot = Taille(::str_msg)
i,oc est un entier
str_tmp est chaîne
oc=0
POUR i = 1 A ::lstr_mot
oc++
FIN
::Tstr_tab=allouer un tableau de oc chaîne
POUR i = 1 A ::lstr_mot
str_tmp="lbl"+i
::Tstr_tab[i]=str_tmp
ChampClone({::str_obj},str_tmp,50,50)
{str_tmp}..Valeur = Milieu(::str_msg,i,1)
FIN
AnimationChangeType({::str_obj},actDéfilement)
AnimationLitParamètre({::str_obj},acpBoucle)
{::str_obj}..Animation = Vrai
InitHasard()
TimerSys("::SuisCur",10,10)
TimerSys("::Changecolor",50,11)
PROCEDURE Destructeur()
PROCEDURE GLOBAL SuisCur()
nPos, nPosX, nPosY, i sont des entiers
nPos = CurseurPos(cpFenêtre)
nPosX = PoidsFaible(nPos)
nPosY = PoidsFort(nPos)
POUR i=1 A ::lstr_mot
SI i = 1 ALORS
{::Tstr_tab[i]}..X = nPosX
{::Tstr_tab[i]}..Y = nPosY
SINON
::Mouv(i)
FIN
FIN
PROCEDURE GLOBAL Changecolor()
mapolice est une Police
R,V,B sont des entiers sur 1 octet
R=Hasard(255)
V=Hasard(255)
B=Hasard(255)
mapolice..Couleur = RVB(R,V,B)
mapolice..Taille = 14
i est un entier
POUR i=1 A ::lstr_mot
{::Tstr_tab[i]}..Police = mapolice
FIN
PROCEDURE GLOBALE Mouv(i)
tmp est un entier = Hasard(1000000)
SI {::Tstr_tab[i]}..X > {::Tstr_tab[i-1]}..X + 10 ALORS
TANTQUE {::Tstr_tab[i]}..X <> {::Tstr_tab[i-1]}..X + 10
{::Tstr_tab[i]}..X = {::Tstr_tab[i]}..X-1
FIN
//ThreadExécute(i+tmp,threadNormal,::MouvXP,i,i+tmp)
FIN
SI {::Tstr_tab[i]}..X < {::Tstr_tab[i-1]}..X + 10 ALORS
TANTQUE {::Tstr_tab[i]}..X <> {::Tstr_tab[i-1]}..X + 10
{::Tstr_tab[i]}..X = {::Tstr_tab[i]}..X+1
FIN
//tmp=Hasard(1000000)
//ThreadExécute(i+tmp,threadNormal,::MouvXM,i,i+tmp)
FIN
SI {::Tstr_tab[i]}..Y > {::Tstr_tab[i-1]}..Y ALORS
TANTQUE {::Tstr_tab[i]}..Y <> {::Tstr_tab[i-1]}..Y
{::Tstr_tab[i]}..Y --
FIN
FIN
SI {::Tstr_tab[i]}..Y < {::Tstr_tab[i-1]}..Y ALORS
TANTQUE {::Tstr_tab[i]}..Y <> {::Tstr_tab[i-1]}..Y
{::Tstr_tab[i]}..Y ++
FIN
FIN
PROCEDURE GLOBALE MouvXP(i,nom)
TANTQUE {::Tstr_tab[i]}..X <> {::Tstr_tab[i-1]}..X + 10
{::Tstr_tab[i]}..X = {::Tstr_tab[i]}..X-1
FIN
ThreadArrête(nom)
PROCEDURE GLOBALE MouvXM(i,nom)
TANTQUE {::Tstr_tab[i]}..X <> {::Tstr_tab[i-1]}..X + 10
{::Tstr_tab[i]}..X = {::Tstr_tab[i]}..X+1
FIN
ThreadArrête(nom)
Contribution le : 18/05/2006 09:35
|
|
|
Re: Thread |
|
Developpeur WDF
Inscrit: 24/01/2006 13:42
De Chartres
Post(s): 142
|
Personne n'as une idée pour remplacer les tantque par un thread sans que ca plante? Ou meme autre chose qu'un thread.
Contribution le : 19/05/2006 10:27
Edité par Celtic sur 19/5/2006 10:54:01
|
|
Vous ne pouvez pas débuter de nouveaux sujets.
Vous pouvez voir les sujets.
Vous ne pouvez pas répondre aux contributions.
Vous ne pouvez pas éditer vos contributions.
Vous ne pouvez pas effacez vos contributions.
Vous ne pouvez pas ajouter de nouveaux sondages.
Vous ne pouvez pas voter en sondage.
Vous ne pouvez pas attacher des fichiers à vos contributions.
Vous ne pouvez pas poster sans approbation.
|
Connexion
Menu
Chercher WDForge
Chercher Web
Partenaires
|