Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SCATTER NAME object -> Class definition question
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00852138
Message ID:
00852142
Vues:
8
This message has been marked as the solution to the initial question of the thread.
John,

Use amembers() to enumerate the properties. You can build a string into _cliptext and paste it in your code.
function ObjectToCode1( lcObjectName )

loObject = eval( lcObjectName )
if ( vartype( loObject ) = 'O' )
   _cliptext = ""
   n = amembers( laProperties, loObject )
   for i = 1 to n
      _cliptext = _cliptext + lcObjectName + "." + laProperties[i] + " = " + chr(13) + chr(10)
   endfor
endif
return
scatter name oX
ObjectToCode1( "oX" )

>Does anyone know of a method to easily generate object definition code based on an object generated by SCATTER NAME?
>
>Quite simply, I'd like to drop whatever property names and values contained in the object directly into my code for easy reference and manuipulation:
>
>oThing.FirstProperty='Fruit'
>oThing.SecondProperty='Apple'
>oThing.ThirdProperty='Red'
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