Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Did anybody meet this bug?
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Did anybody meet this bug?
Divers
Thread ID:
00714296
Message ID:
00714296
Vues:
44
Hi all,
command LOCATE called on indexed table within class method, where class property is in FOR clause, cause error "Variable ... is not found".
Is this problem anywhere reported?
Jiri

*--------------------------------------------------------
Code sample:
*----------------------------
CLOSE ALL
CLEAR ALL
CREATE TABLE Tab1 (Field1 C(3))
INDEX ON Field1 TAG Field1
INSERT INTO Tab1 VALUES("ABC")
INSERT INTO Tab1 VALUES("123")
INSERT INTO Tab1 VALUES("XYZ")
USE

o = CREATEOBJECT("cTest", "TAB1.DBF")
? o.Find("123")

*----------------------------
DEFINE CLASS cTest AS Custom
cField1 = SPACE(3)
cDBF = ""
PROCEDURE Init
LPARAMETERS tcDBF
THIS.cDBF = tcDBF
ENDPROC
PROCEDURE Find
LPARAMETERS tcValue
USE (THIS.cDBF) ALIAS aTab
THIS.cField1 = tcValue
LOCATE FOR Field1 = THIS.cField1
WITH THIS
WAIT WINDOW ".cField1 = '" + .cField1 + "'"
*---- next command cause error "Variable 'CFIELD1' is not found"
LOCATE FOR aTab.Field1 = .cField1
*---- next two commands resolve this problem
* LOCATE FOR aTab.Field1 = THIS.cField1
* LOCATE FOR aTab.Field1 = .cField1 NOOPTIMIZE
RETURN FOUND()
ENDWITH
USE
ENDPROC
ENDDEFINE
*----------------------------
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform