Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
BUG: USE fire a
Message
 
À
24/04/2004 16:59:11
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00897949
Message ID:
00898015
Vues:
21
Hi Fabio,

I stripped everything from your example except the lines with an error.
As you see, the code is the same.
USE (getDBF()) IN 100 ALIAS myAlias  AGAIN && <== ERROR : "File is in use."
USE (getDBF()) IN 100 ALIAS myAlias  AGAIN && <== ERROR : "File is in use."
USE (getDBF()) IN 100 ALIAS myAlias  AGAIN && <== ERROR : "File is in use."
Although we could get into a discussion why this code sometimes works, we both agree that the code can fail in several version of vfp including the latest one.
When I would see this code during a code review I would correct it because for me, everything between the parenthesis is a named expression and that means that certain restrictions apply (at least for me).
I use the following rule for named expressions. Add the expression as a watch in the debugger, if the debugger shows as the value in the watch window as: (Expression cannot be evaluated), do not use it (directly).
getDBF() does not pass my rule and therefor the code must be changed (IMHO) to:
lcDBFName=getDBF()
USE (lcDBFName) IN 100 ALIAS myAlias  AGAIN
For me you are trying to find out where the boundaries are what VFP can and cannot do. I rather define my own rules that will keep me away from those rules.

When I started to work as a VFP developer I had to support an APP that had it roots in 2.6 and was converted to VFP. It worked fine until VFP6 SP3 was released and it would no longer work. The previous programmer used a trick to have several procedures with the same name in different prg's and the behaviour changed in that SP. So that was for me one of the reasons never to use a trick or a shortcut like that again.

Once I encounter something that doesn't work all the time because crossed Ithe line, I will define the boundaries in where it was intended to work and stick with those.

I rather use code that works all the time, than code that tries to stay on the borderline.

Remember, this is all my opinion. And personally I enjoy reading your posts because for me I can see if the VFP team has moved the border so that I can reset my own boundaries.

Regards,
Frank Camp
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform