// Déclaration
W_C_NomFic est une chaîne = "c:\toto.txt"
W_E_IdFic est un entier
W_C_Ligne est un entier
W_C_Val est une chaîne
W_E_IdFic = fOuvre(W_C_NomFic,foLecture)
SI W_E_IdFic = -1 ALORS
Erreur(ErreurInfo( errMessage ))
SINON
W_C_Ligne = fLitLigne (W_E_IdFic)
TANTQUE W_C_Ligne <> EOT ET W_C_Ligne <> ""
HRAZ(AppelTph)
W_C_Val = ExtraitChaîne(W_C_Ligne,1,";")
AppelTh.DateHeure = PL_FormaterDH(W_C_Val)
W_C_Val = ExtraitChaîne(W_C_Ligne,2,";")
AppelTh.NCorrespondant = Val(W_C_Val)
AppelTh.Motif = ExtraitChaîne(W_C_Ligne,3,";")
AppelTh.Reponse = ExtraitChaîne(W_C_Ligne,4,";")
SI PAS HAjoute(AppelTph) ALORS
// TRACER l'erreur (Eviter message lors d'une importation ...)
FIN
W_C_Ligne = fLitLigne (W_E_IdFic)
FIN
SI fFerme(W_E_IdFic) = -1 ALORS
Erreur(ErreurInfo(errMessage))
FIN
FIN
PROCEDURE PL_FormaterDH(P_DH)
// Param P_DH exemple 17/12/2005 11:55:00
// Chaine retournée 20051217115500
// Déclaration
W_C_Date est une chaîne = P_DH[[1 A 10]]
W_C_Heure est une chaîne = P_DH[[12 A 19]]
W_C_DateHeure est une chaîne = ""
W_C_Val est une chaîne
W_C_Val = W_C_Date[[7 A 10]] + W_C_Date[[4 A 5]] + W_C_Date[[1 A 2]]
W_C_DateHeure = W_C_Val
W_C_Val = Remplace(W_C_Heure,":","")
W_C_DateHeure += W_C_Val
RENVOYER W_C_DateHeure
Cette contribution était de : http://old.wdforge.org/newbb/viewtopic.php?forum=14&topic_id=3430&post_id=14549