Adn56
Messages postés1172Date d'inscriptionjeudi 24 mai 2007StatutMembreDernière intervention28 septembre 20131 10 sept. 2009 à 10:55
Re, Tiens essaye un truc du style pour voir :
private sub affiche (byval Val_a_afficher as integer, byval addr as integer)
checksum = 256 - (13 + (addr) + 65 + (Asc(Val_a_afficher)) Mod 256)
commandstring = Chr$(13) & Chr$(addr4) & Chr$(65) & Chr$(Asc(Val_a_afficher)) & Chr$(checksum)
Comm.Output = commandstring
end sub
tu peux ensuite faire une boucle aussi, place H1,H2,M1,etc dans un tableau Heure(6)
et appel 6 fois la fonction affiche comme suit :
for i as integer = 1 to 6
call affiche(heure(i),i)
next i
et voila 6 lignes pour faire pareil (c'est pour la philo du code, car je ne l'ai pas testé, je n'ai pas VB6 alors c'est pas forcément la bonne syntaxe)
kénavo
10 sept. 2009 à 10:55
private sub affiche (byval Val_a_afficher as integer, byval addr as integer)
checksum = 256 - (13 + (addr) + 65 + (Asc(Val_a_afficher)) Mod 256)
commandstring = Chr$(13) & Chr$(addr4) & Chr$(65) & Chr$(Asc(Val_a_afficher)) & Chr$(checksum)
Comm.Output = commandstring
end sub
tu peux ensuite faire une boucle aussi, place H1,H2,M1,etc dans un tableau Heure(6)
et appel 6 fois la fonction affiche comme suit :
for i as integer = 1 to 6
call affiche(heure(i),i)
next i
et voila 6 lignes pour faire pareil (c'est pour la philo du code, car je ne l'ai pas testé, je n'ai pas VB6 alors c'est pas forcément la bonne syntaxe)
kénavo