Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Method names suggestion
Message
De
18/03/2013 15:25:04
Mike Yearwood
Toronto, Ontario, Canada
 
 
À
18/03/2013 14:48:59
Walter Meester
HoogkarspelPays-Bas
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2008
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01568344
Message ID:
01568739
Vues:
61
>>
>>loCustomerRec = createobject("recno('customer')")
>>select customer
>>scan
>>  select invoice
>>  loInvoiceRec = createobject("recno('invoice')")
>>  scan
>>    ?invoice.num
>>  endscan
>>endscan
>>
>>When this method ends, loInvoiceRec would be destroyed first, then loCustomerRec.
>
>Mike,
>
>How would you create an object out of a class named "recno('customer')" ?

I wasn't trying to give executable code - I meant to type something more like create an object and pass it the expression to evaluate.

>
>Though I get the idea, I would be very carefull with relying on functionality bound to implicit the destroy of an object. It generally is hard to follow and harder to debug. What would happen if the variable is not declared local (as in your example above), or even more sneaky, if you have a spelling mistake in the variable name when you assign or declare it and such variable exists already as a private (e.g. Due to recursive calls).

If you don't declare the variable scope properly you can run into such problems. You can release the object any time you'd like. My point was only to show that Fox has a stack already.

>
>IMO, It would make more sense to just restore it explicitely.
>
>Walter,
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform