Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Object TABLE1 is not found?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00515293
Message ID:
00515437
Vues:
16
>I agree with everyone here, it seems to be a scope problem with my variables. It's not easy to find a good example of SCATTER NAME whatever MEMO or GATHER NAME whatever MEMO. I have about a dozen FoxPro and VFP books and there is not much on SCATTER NAME. I have lots of info on plain old SCATTER MEMVAR MEMO.

>Thanks everyone!

Steve,

As for the object that you create with SCATTER NAME, a couple points.

1. It is an object (didn't I say that already?)

2. It has the scope of whatever you have defined it earlier in the program, just like any variable.

Consider the following:
PUBLIC  oMyRecord   && I've often wondered if object orientation wasn't created by the Irish?

SELECT myTable
SCATTER NAME oMyRecord     && Public scope -- visible throughout the application
LOCAL  oMyRecord  

SELECT myTable
SCATTER NAME oMyRecord     && Local scope -- visible only in this procedure
SELECT myTable
SCATTER NAME oMyRecord     && Private scope -- also can be declared private.
                           && Visible in this procedure and any called by it. 
                           && But not above
In the latter case, sometimes you can declare a variable PRIVATE, such as before calling a form -- so that it is visible throughout the form, but doesn't have the application-wide impact of a public.

Sorry if this is redundant for you, but I often find it helpful to lay the options out.

Jay
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform