Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
I need the entire reference for an object
Message
 
 
À
05/02/1999 14:50:19
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00184477
Message ID:
00184633
Vues:
27
Alain,

once again with formatting...

Here's a recursive routine that takes an object reference as an argument and returns it's full containership name:
* FullName.prg  13-Jun-95

* Generate an object's full containership name

* 03-Dec-95 added additional validity testing
* 26-Apr-96 added testing to handle _VFP object which is its own .Parent
* 15-Jan-98 used IsObject()
* 12-Nov-98 added testing for Name property

function FullName( roObject )

if ( IsObject( m.roObject ) and ;
     ( type( "roObject.Name" ) == 'C' ) )
   if ( ( type( "roObject.Parent" ) == 'O' ) and ;
        ( roObject.Name != "Microsoft Visual FoxPro" ) )
      return ( FullName( roObject.Parent ) + "." + roObject.Name )
   else
      return roObject.Name
   endif
else
   return ""
endif

function IsObject
lparameter roObject

return( ( type( "m.roObject" ) == 'O' ) and ( ! isnull( m.roObject ) ) )
>Is there a way to get the entire reference for an object ?
>
>Ex: frmxxx.cntxxx.txtxxx.name
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform