Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
The biggest mistake of the season :)
Message
De
24/05/2006 13:09:11
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01124333
Message ID:
01124584
Vues:
13
local laProblemTxt[5], laProblemFlag[5]
        * should be in setup code or table driven... 
        * not inited again and again...
	laProblemTxt[1] = " payment arrangements"
	laProblemTxt[2] = " recent payments"
	laProblemTxt[3] = " been recently billed"
	laProblemTxt[4] = " some process pending"
	laProblemTxt[5]	= " recent status changes"

        *-- Short and sweet if it is only flags!
	laProblemFlag = 0

* Processing code
for lnI = 1 to Alen(laProblemTxt)
    if laProblemFlag[lnI] > 0
	.cProblemText = .cProblemText + "," + CRLF + ;
	transform(laProblemFlag[lnI]) + ;
	iif(laProblemFlag[lnI] > 1, ;
	" accounts have", ;
	" account has") + laProblemTxt[lnI]
     endif
next
if not empty(.cProblemText)
   .cProblemText = substr(.cProblemText,4) + "."
endif
why couple the flags and the text in 1 Array ?
It is easier to code in 2 arrays and lets you decouple the constant text...
Also independant of later additions to the error state.

regds

thomas
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform