Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
New eyes to find an error please
Message
 
 
À
07/06/2011 11:24:44
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01513347
Message ID:
01513377
Vues:
74
>I have seeded the tables to make sure something should occur, but nothing is found.
>I must have made a coder's invisible yet obvious error.
>
>
>USE Results IN 1
>USE Phrases IN 2
>SELECT Results
>FOR Recrd = 1 TO LastEntry
>	GOTO Recrd
>	RecordText = Results.SiteText
>	SELECT Phrases
>	ThePhrase = ALLTRIM(UPPER(WordUsed))
>	IF ALLTRIM(UPPER(ThePhrase)) $ ALLTRIM(UPPER(RecordText))
>		FOR PhraseRecord = 1 TO PhraseEnd
>			GOTO PhraseRecord
>* AT(cSearchExpression, cExpressionSearched [, nOccurrence])
>			PhrasePosition = AT(ThePhrase,RecordText,1)
>* SUBSTR(cExpression, nStartPosition [, nCharactersReturned])
>			  PhrasePosition = PhrasePosition - 20
>			? PhrasePosition  (ALWAYS MINUS 20)   &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
>			ThePhrase = SUBSTR(RecordText,PhrasePosition,60)
>			? ThePhrase (ALWAYS BLANK - NO RESULT)  &&&&&&&&&&&&&&&&&&&&&&&&&&
>		NEXT PhraseRecord
>	ENDIF
>SELECT Results
>NEXT Recrd
>
Try using SCAN and SEEK/SCAN WHILE instead of your code.
USE Results IN 0 SHARED
USE Phrases IN 0 SHARED
SELECT Results
SCAN
	RecordText = UPPER(ALLTRIM(Results.SiteText))

	SELECT Phrases
                    LOCATE FOR UPPER(ALLTRIM(WordUsed)) 	 $ m.RecordText
                    IF FOUND()
                             ** Some code goes here
                   ENDIF
ENDSCAN
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform