Yannick
Nombre de messages : 8635 Age : 53 Localisation : Bretagne Date d'inscription : 15/02/2010
| Sujet: Equi-Vaccins Mer 24 Mar 2010 - 18:06 | |
| un petit truc pour ceux qui ont des chevaux de compétition pour gérer les vaccinations sans avoir à ouvrir tous les documents d'accompagnements à chaque fois. Bon faut créer un fichier "LC.txt" dans le même dossier . plus tard je le mettrai en auto-création quoi qu'il vous est facile de rajouter en entete de source le code - Code:
-
if file_exists "LC.txt" =0 file_open_write 1,"LC.txt" file_close 1 end_if bon voici le petit truc qui calcule en fait l' écart entre la date de vaccination logé dans le Txt et la date du jours et compare cet écart avec celui des autorités sanitaire. - Code:
-
dim ecranL,ecranT dim An,An_bis dim d$,d2$,J$,M$,A$ dim N_An_bis,N_An,Mois,bis,Nbre_J,Nbre_J2,Diff_date dim FFE,FEI dim L,L$,S,Chv$,Vacc$,L_Sup
label EFF,Aj,Modif,Supp,CHD,Quit,chargt,Aj_Chv,Choix,Sup_Chv,Mod_Chv,A_Propos
caption 0,"Vérif Vaccins V 0.0.1" height 0,300 : width 0,500 ecranL=(screen_x-500)/2:ecranT=(screen_y-300)/2 top 0,ecranT:left 0,ecranL
main_menu 2 sub_menu 3:caption 3,"Fichiers" :parent 3,2 sub_menu 4:caption 4,"Effectif" :parent 4,3 sub_menu 5:caption 5,"Chevaux Hors délais":parent 5,3 sub_menu 6:caption 6,"Quitter" :parent 6,3 sub_menu 7:caption 7,"Outils" :parent 7,2 :inactive 7 sub_menu 8:caption 8,"Ajouter" :parent 8,7 sub_menu 9:caption 9,"Modifier" :parent 9,7 sub_menu 10:caption 10,"Supprimer" :parent 10,7 sub_menu 11:caption 11,"A Propos" :parent 11,2 alpha 20:hide 20:top 20,10:left 20,10:caption 20,"Effectif" :font_name 20,"Times new roman":font_size 20,10:font_color 20,150,0,0 list 21 :hide 21:top 21,30:left 21,10:height 21,150:width 21,240:font_name 21,"Times new roman":font_size 21,8:font_color 21,0,0,150
alpha 22:hide 22:top 22,15:left 22,10 caption 22,"Chevaux hors délai de vaccination FFE":font_name 22,"Times new roman":font_size 22,10:font_color 22,150,0,0 list 23 :hide 23:top 23,35:left 23,10:height 23,75:width 23,240:font_name 23,"Times new roman":font_size 23,8:font_color 23,0,0,150 alpha 24:hide 24:top 24,115:left 24,10 caption 24,"Chevaux hors délai de vaccination FEI":font_name 24,"Times new roman":font_size 24,10:font_color 24,150,0,0 list 25 :hide 25:top 25,135:left 25,10:height 25,75:width 25,240:font_name 25,"Times new roman":font_size 25,8:font_color 25,0,0,150 alpha 26:hide 26:top 26,185:left 26,10:caption 26,"Nom du cheval":font_name 26,"Times new roman":font_size 26,10:font_color 26,150,0,0 edit 27 :hide 27:top 27,200:left 27,10:width 27,140 alpha 28:hide 28:top 28,185:left 28,155:caption 28,"Vaccination":font_name 28,"Times new roman":font_size 28,10:font_color 28,150,0,0 edit 29 :hide 29:top 29,200:left 29,155:width 29,80 alpha 30:hide 30:top 30,205:left 30,245:caption 30,"(format : JJ/MM/AAAA)":font_name 30,"Times new roman":font_size 30,8:font_italic 30
button 31:hide 31:top 31,210:left 31,390:caption 31,"Enregistrer":cursor_point 31:font_name 31,"Times new roman" button 32:hide 32:top 32,210:left 32,390:caption 32,"Modifier":cursor_point 32:font_name 32,"Times new roman" button 33:hide 33:top 33,210:left 33,390:caption 33,"Supprimer":cursor_point 33:font_name 33,"Times new roman" alpha 34:hide 34:top 34,202:left 34,10:font_name 34,"Times new roman":font_size 34,10 picture 100:height 100,240:width 100,482:stretch_on 100:file_load 100,"fond.jpg" picture 101:left 101,285:height 101,200:width 101,167:file_load 101,"img1.jpg":hide 101 dlist 1 gosub chargt
on_click 4,EFF on_click 5,CHD on_click 6,Quit on_click 8,Aj on_click 9,Modif on_click 10,Supp on_click 11,A_Propos on_click 21,Choix on_click 31,Aj_Chv on_click 33,Sup_Chv on_click 32,Mod_Chv end EFF: hide 100:hide 22:hide 23:hide 24:hide 25:hide 26: hide 27:hide 28:hide 29:hide 30:hide 31:hide 32:hide 33:hide 34 show 20:show 21:show 101 active 7 return CHD: L_Sup=0 hide 100:hide 20:hide 21:hide 26:hide 28:hide 29:hide 30:hide 31:hide 32:hide 33:hide 34 show 22:show 23:show 24:show 25:show 101 inactive 7 return Aj: hide 100:hide 22:hide 23:hide 24:hide 25:hide 32:hide 33:hide 34 show 26:show 27:show 28:show 29:show 30:show 31:show 101 top 30,205:left 30,245:caption 30,"(format : JJ/MM/AAAA)":font_name 30,"Times new roman":font_size 30,8:font_italic 30:font_color 30,0,0,0 return Aj_Chv: item_add 1,text$(27)+"|"+text$(29) file_save 1,"LC.txt" text 27,"":text 29,"" hide 26:hide 27:hide 28:hide 29:hide 30:hide 31 gosub chargt return Modif: hide 100:hide 22:hide 23:hide 24:hide 25:hide 26: hide 27:hide 31:hide 33 show 28:show 29:show 30:show 32:show 34:show 101 top 30,205:left 30,245:caption 30,"(format : JJ/MM/AAAA)":font_name 30,"Times new roman":font_size 30,8:font_italic 30:font_color 30,0,0,0 return Mod_Chv: item_insert 1,item_index(21),item_index$(21)+"3|"+text$(29) item_delete 1,item_index(21)+1 file_save 1,"LC.txt" text 29,"" hide 28:hide 29:hide 30:hide 32:hide 34 gosub chargt return Supp: hide 100:hide 22:hide 23:hide 24:hide 25:hide 26: hide 27:hide 28:hide 29:hide 31:hide 32:hide 34 show 33:show 30:show 101 top 30,195:left 30,10:caption 30,"Sélectionner un cheval dans la liste":font_color 30,255,0,0 return Choix: L_Sup=item_index(21) caption 34,item_index$(21) return Sup_Chv: item_delete 1,L_Sup file_save 1,"LC.txt" hide 33:hide 30 gosub chargt return chargt: clear 1 clear 21 clear 23 clear 25 file_load 1,"LC.txt" for L= 1 to count(1) L$=item_read$(1,L) S=instr(L$,"|") Chv$=left$(L$,S-1) Vacc$=right$(L$,len(L$)-S) d$=Vacc$:An=365:An_bis=366 if len(d$)=8 J$=left$(d$,2):M$=mid$(d$,4,2):A$=str$(20)+right$(d$,2) else J$=left$(d$,2):M$=mid$(d$,4,2):A$=right$(d$,4) end_if if frac(val(A$)/4)=0 then bis=1 N_An_bis=int(int(val(A$)/4)/4) N_An= val(A$)-1-N_An_bis if val(M$)=1 then Mois=0 if val(M$)=2 then Mois=31 if val(M$)=3 then Mois=59 if val(M$)=4 then Mois=90 if val(M$)=5 then Mois=120 if val(M$)=6 then Mois=151 if val(M$)=7 then Mois=181 if val(M$)=8 then Mois=212 if val(M$)=9 then Mois=242 if val(M$)=10 then Mois=273 if val(M$)=11 then Mois=303 if val(M$)=12 then Mois=334 if bis=1 then Mois=Mois+1 Nbre_J=val(J$)+Mois+(N_An*An)+(N_An_bis*An_bis) d2$=date$:An=365:An_bis=366 if len(d2$)=8 J$=left$(d2$,2):M$=mid$(d2$,4,2):A$=str$(20)+right$(d2$,2) else J$=left$(d2$,2):M$=mid$(d2$,4,2):A$=right$(d2$,4) end_if if frac(val(A$)/4)=0 then bis=1 N_An_bis=int(int(val(A$)/4)/4) N_An= val(A$)-1-N_An_bis if val(M$)=1 then Mois=0 if val(M$)=2 then Mois=31 if val(M$)=3 then Mois=59 if val(M$)=4 then Mois=90 if val(M$)=5 then Mois=120 if val(M$)=6 then Mois=151 if val(M$)=7 then Mois=181 if val(M$)=8 then Mois=212 if val(M$)=9 then Mois=242 if val(M$)=10 then Mois=273 if val(M$)=11 then Mois=303 if val(M$)=12 then Mois=334 if bis=1 then Mois=Mois+1 Nbre_J2=val(J$)+Mois+(N_An*An)+(N_An_bis*An_bis) Diff_date = Nbre_J2-Nbre_J FFE=365 FEI=73 item_add 21,Chv$ if Diff_date >365 item_add 23,Chv$+" / "+str$(Diff_date) end_if if Diff_date >73 item_add 25,Chv$+" / "+str$(Diff_date) end_if next L return A_Propos: return
Quit: terminate
Amusez vous bien | |
|