Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What exaclty is this code doing?
Message
From
21/03/2013 13:12:53
 
 
To
21/03/2013 09:36:51
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01568853
Message ID:
01568942
Views:
53
>>>>>
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?
>>>>
>>>>Actually, I think it's looking for an address not in Mexico and parsing city, state and zip from it. mER holds an error message, but the code you showed doesn't do anything with that error message.
>>>>
>>>>Tamar
>>>
>>>The error is dealt with in another portion of the code, basically a hidden display box looks for it to contain a message and displays it if there is one.
>>>
>>>I see what it's doing for the error now, thanks. I'm still confused as to what actually happens when it does find MX or 00000 in the Dzp field though...
>>
>>Well, you didn't show us that part. Is there an ELSE clause?
>>
>>Tamar
>
>
>I found every occurrence of "MX" in the code, I don't see any ELSE statements or anything that looks to handle what happens when MX is found. The PRG is huge and there are tie ins all over the place so I can't post the whole thing which is a problem in this case, I guess I'll have to keep looking around in it.

Use the Debugger and step through the code to see what's going on. Here's an article I wrote about the Debugger to get you started:

http://www.tomorrowssolutionsllc.com/Materials/debugger.html

Tamar
Previous
Reply
Map
View

Click here to load this message in the networking platform