Information générale
Catégorie:
Codage, syntaxe et commandes
>Is there a way to reference a field without specifiying the currently selected alias, something in the flavor of m.Fieldname? I think I've seen this in old Dbase code, just don't know if there is a way to do it in VFP.
You can refer to a field without using the alias, as long as the work area that it is in is the current work area... for example...
select 1
use thisview
x = thisview.thisfield && works
x = thisfield && works
If you want to have a different current work area and refer to the field you have to use the alis. If you only want the value, you can scatter the record to memvars and refer to / modify the mem vars... You have to make sure that you have no duplicate field names...
select 1
use thisview
scatter memvars
select 2
cOldVal = m.ThisField
m.ThisField = cNewVal
select 1
gather from memvars
Of course, it uses Privates.
BOb
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement