Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP Defying me
Message
De
28/01/2005 08:42:46
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
VFP Defying me
Versions des environnements
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
00981673
Message ID:
00981673
Vues:
59
Dear Fox Maniacs

I have the most puzzling bit of code that seems to me that it absolutely should work fine but "disobeys" me.
It's reading a Low Level File (CIF format - English) of Bus Stops details, in order to import them into my DB.
- Each LL rec, I get its County Code which I need to map to my system's equivalent, in the function/method ".lmLookUpCCode()".
- It's likely that many stops for the same county will be contiguous, so I don't call the look-up every
time, only when the CIF county code differs from the previous (lcPrevCIFCCode)
- So the first time round the loop they will definitely be different, as I've
initialised lcPrevCIFCCode to "" and I know I have a value in lcCIFCCode.
This is verified in debug
- However, at the line:

If lcCIFCCode <> lcPrevCIFCCode && No point re-seeking C Code if same as prev

it just skips past the if test and goes straight on to:

If Not EMPTY( lcCountyCode)

- Couldn't believe my mince pies (eyes)!! How dare VFP disobey me!?
- I know I have a && comment after the If statement but I usually do and it's legal.
- I know there's a comment line after - * 23/12/04 - but that's perfectly legal, and there's no continuation line ";" at the end of it. Just to be on the safe side I've tried moving it about, leaving free lines around it, etc., but makes no difference.

This is singularly bewildering. Any ideas?

'ppreciate it

Terry
...

lcPrevCIFCCode     = ""

...

Do While Not llEOF	    && of Stops source records
  Store ""	To lcStopNo, lcName, lcLoc1, lcLoc2, lcCountyCode, lcDistrictCode
  Store 0	To lnZoneNo, lnEastings, lnNorthings
  .cString	= .lmReadString( .nStopsHdl)    && Get a line of source
  lnDone		= lnDone + 1
  If EMPTY( .cString) ;
  Or FEOF( .nStopsHdl)			    && if no data or at eof
      llEOF	= .T.
  Else
      lcRecID	= SUBSTR( .cString, 1, 2)
      If  lcRecID <> "QL";
      And lcRecID <> "QB"			    && not locn header rec (QL) or add. locn rec (QB)
          llEOF	    = .T.               	    && NOTE continue from here with OPERATOR dets
      Else				    && QL or QB record
   	 lcCIFCCode  = ALLTRIM( SUBSTR( .cString, 4, 3))	&& 23/12/04 County part of string
	 lcStopNo	    = ALLTRIM( SUBSTR( .cString, 8, 8))	&& Stop# part of string
   	 If lcCIFCCode <> lcPrevCIFCCode			&& No point re-seeking C Code if same as prev
		   	  
* 23/12/04  lcCountyCode	= .lmLookUpCCode( lcStopNo, .cString)			
  	     lcCountyCode	  = .lmLookUpCCode( lcStopNo, lcCIFCCode, lcRecID)	&& Look up County code
     	     lcPrevCIFCCode = lcCIFCCode 
  	 EndIf 
  	  	  	  
*         07/12/04 Stop Nos. not unique across counties.  If can't find the county code then can't store the 
*         stop as Stop's primary key is now composite of Stop No. and County Code
*         _______________________________________________________________________
  	 If Not EMPTY( lcCountyCode		    && Found look-up up equiv county code in County table
  	     lcStopCounty	 = PADR( lcStopNo, 8, " ") ;
  	  	  	 + PADR( lcCountyCode, 2, " ") 	&& need seek on composite (mPlan-like) key
          ...
- Whoever said that women are the weaker sex never tried to wrest the bedclothes off one in the middle of the night
- Worry is the interest you pay, in advance, for a loan that you may never need to take out.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform