Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What exaclty is this code doing?
Message
De
20/03/2013 13:09:28
 
 
À
20/03/2013 12:47:12
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01568853
Message ID:
01568857
Vues:
69
>
IF ALLTRIM(m.DZp) <> "MX" AND m.DZp <> "00000"
>		fd=AT(",", m.DCiSt)
>		IF fd = 0
>			mEr = mEr + nb + "Cannot Determine Destination State"
>		ELSE
>			mCity = ALLTRIM(LEFT(m.DCiSt,fd-1))
>			mState = ALLTRIM(SUBSTR(m.DCiSt,fd+1))
>			IF NOT mState $ StStr OR LEN(mCity) < 3 OR m.DCiSt = "Unknown"
>				mEr = mEr + nb + "Cannot Determine City, State of Destination"
>			ENDIF 
>		ENDIF 		
>	ENDIF
>
>To me it looks like it's looking for a Mexico address that includes the city and zip code all in one line and parsing/splitting it out if it finds it. I'm having issue figuring how exactly the mEr is called upon, can someone help?


Looks like if the zip code does not contain "MX" and is not all 0s, then it's parsing the city/state combination in the expected form "city, st" and if it can't find the state in a StStr variable (which is presumably something like "AB,AL,AK..." or the city is 2 characters or less, or it contains the word "Unknown" then it gives the error.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform