Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Unusual substitution syntax
Message
 
 
À
19/01/2004 03:48:17
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00867888
Message ID:
00868078
Vues:
21
Fabio,

I repeat, there's no relaible way to control that. Your code doesn't work anymore if additional cursor's opened before or after cursor 'ccc'.
CLEAR
*CREATE CURSOR aaa ( ff I DEFAULT RECNO())
CREATE CURSOR ccc ( ff I DEFAULT RECNO())
APPEND BLANK
APPEND BLANK
APPEND BLANK
APPEND BLANK
APPEND BLANK
APPEND BLANK
APPEND BLANK
GO TOP
CREATE CURSOR aaa ( ff I DEFAULT RECNO())

SELECT RECNO('B'),RECNO('C'),* FROM ccc B,ccc C WHERE myCall(B.ff,C.ff)

USE
USE IN ccc

FUNCTION MYCALL(xx,yy)
RETURN RECNO('B')=RECNO('C')+1
ENDFUNC
>Hi Sergey,
>
>>>>>>>>>>>>>>>
>You cannot control those functions because you don't know know what aliases FoxPro will assign tables opened in SQL. Your second SELECT confirms that because RECNO('B') and RECNO('C') return 1 for all rows or other incorrect results depending on what tables are already open.
>
>My example was hurried ( i have not many time ),
>but the problem is that VFP tries to optimize the SELECT.
>
>However, this would have to resolve the problem.
>
>
>CLEAR
>CREATE CURSOR ccc ( ff I DEFAULT RECNO())
>APPEND BLANK
>APPEND BLANK
>APPEND BLANK
>APPEND BLANK
>APPEND BLANK
>APPEND BLANK
>APPEND BLANK
>GO TOP
>
>SELECT RECNO('B'),RECNO('C'),* FROM ccc B,ccc C WHERE myCall(B.ff,C.ff)
>
>USE
>USE IN ccc
>
>FUNCTION MYCALL(xx,yy)
>RETURN RECNO('B')=RECNO('C')+1
>ENDFUNC
>
>
>
>I repeat, it is possible to control these commands ( RECNO(),... ) on a SELECT.
>
>Fabio
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform