Coucou,
Dandypunk je te remercie pour ta réponse ... et j'ai particuliére aprécier que tu prennes le temps de m'aider
Donc en vrais, au moment ou j'ai posé la question j'imaginais bien que aucune solutions n'existes, a ma connaisance, on ne peut pas
savoir :
1) Le mapping d'une variable
2) Si la variable est sérializable
3) Si la variable est clef unique.
Ce sont des informations qui m'interesse beaucoup et j espere les avoirs de disponible dans la version 23.
Mais crois moi, j'ai était toucher par ta réponse, alors je t'ai ecris un code spécialement pour toi, j'espere que il te seras utiles, et si tu as n'importe quel question sur ce code je serais vraimment ravis de t'aider.
Dandypunk :
CTools_Enumerating est une Classe
PRIVÉE
m_pclObject est un object dynamique
m_xDefinition est une Definition
m_taDefinitions est un tableau associatif de tableau associatif de Variant
FIN
Procedure Constructeur(_pclObject est un object dynamique)
:m_pclObject <- _pclObject
Procedure Destructeur()
Procedure PRIVÉE Definition() : Definition
ErreurChangeParamètre(epGotoCasErreur)
ExceptionChangeParamètre(epGotoCasException)
SI :m_xDefinition..Nom ~= "" ALORS
:m_xDefinition = RécupèreDéfinition(:m_pclObject)
FIN
RENVOYER :m_xDefinition
CAS ERREUR:
ErreurPropage()
RENVOYER Null
CAS EXCEPTION:
ExceptionPropage()
RENVOYER Null
Procedure PUBLIQUE Definition(_xDefinition est Definition)
:m_xDefinition = _xDefinition
Procedure PUBLIC Definitions()
RENVOYER :m_taDefinitions
Procedure PRIVÉE Definitions(_taDefinitions)
:m_taDefinitions = _taDefinitions
Procedure PRIVÉE GetDefinition(_xDefinition est une Definition)<multisyntaxe>: tableau associatif de tableau associatif de Variant
ErreurChangeParamètre(epGotoCasErreur)
ExceptionChangeParamètre(epGotoCasException)
_taDefinitions est un tableau associatif de tableau associatif de Variant
_taContents est un tableau associatif de Variant
POUR TOUT _Procedure de _xDefinition..Procédure
_taContents[_Procedure..Nom] = :GetDefinitionProcedure(_Procedure)
FIN
SI TableauOccurrence(_taContents) > 0 ALORS
_taDefinitions["Procedures"] = _taContents
FIN
VariableRAZ(_taContents)
POUR TOUT _Variable de _xDefinition..Variable
_taContents[_Variable..Nom] = :GetDefinitionVariable(_Variable)
FIN
SI TableauOccurrence(_taContents) > 0 ALORS
_taDefinitions["Variables"] = _taContents
FIN
VariableRAZ(_taContents)
POUR TOUT _Property de _xDefinition..Propriété
_taContents[_Property..Nom] = :GetDefinitionProperty(_Property)
FIN
SI TableauOccurrence(_taContents) > 0 ALORS
_taDefinitions["Propertys"] = _taContents
FIN
RENVOYER _taDefinitions
CAS ERREUR:
VariableRAZ(_taDefinitions)
ErreurPropage()
RENVOYER _taDefinitions
CAS EXCEPTION:
VariableRAZ(_taDefinitions)
ExceptionPropage()
RENVOYER _taDefinitions
Procedure PRIVÉE GetDefinitionProcedure(_xDescription est une Description de Procedure): tableau associatif de Variant
ErreurChangeParamètre(epGotoCasErreur)
ExceptionChangeParamètre(epGotoCasException)
_taProcedure est un tableau associatif de Variant
AVEC _xDescription
_taProcedure["Nom"] = ..Nom
_taProcedure["Global"] = ..Global
_taProcedure["Hérité"] = ..Hérité
_taProcedure["Virtual"] = ..Virtual
FIN
RENVOYER _taProcedure
CAS ERREUR:
VariableRAZ(_taProcedure)
ErreurPropage()
RENVOYER _taProcedure
CAS EXCEPTION:
VariableRAZ(_taProcedure)
ExceptionPropage()
RENVOYER _taProcedure
Procedure PRIVÉE GetDefinitionProperty(_xDescription est une Description de Propriété): tableau associatif de Variant
ErreurChangeParamètre(epGotoCasErreur)
ExceptionChangeParamètre(epGotoCasException)
_taProperty est un tableau associatif de Variant
AVEC _xDescription
_taProperty["Nom"] = ..Nom
_taProperty["Global"] = ..Global
_taProperty["Hérité"] = ..Hérité
_taProperty["Virtual"] = ..Virtual
_taProperty["Lecture"] = ..Lecture
_taProperty["Ecriture"] = ..Ecriture
FIN
RENVOYER _taProperty
CAS ERREUR:
VariableRAZ(_taProperty)
ErreurPropage()
RENVOYER _taProperty
CAS EXCEPTION:
VariableRAZ(_taProperty)
ExceptionPropage()
RENVOYER _taProperty
Procedure PRIVÉE GetDefinitionVariable(_xDescription est une Description de Variable): tableau associatif de Variant
ErreurChangeParamètre(epGotoCasErreur)
ExceptionChangeParamètre(epGotoCasException)
_taVariable est un tableau associatif de Variant
AVEC _xDescription
_taVariable["Nom"] = ..Nom
_taVariable["Global"] = ..Global
_taVariable["Hérité"] = ..Hérité
_taVariable["Masquage"] = ..Masquage
_taVariable["Type"] = CTools_Enumerating::GetTypeVarName(..Définition..Type)
SI Val(Gauche(VersionWinDev(versionVM), 2)) > 21
_taVariable["Associé"] = ..Associé
FIN
SI Val(Gauche(VersionWinDev(versionVM), 2)) > 22
_taVariable["Mapping"] = ..Mapping
_taVariable["CléUnique"] = ..CléUnique
_taVariable["Serialize"] = ..Serialize
FIN
FIN
_taContents est un tableau associatif de tableau associatif de Variant
SELON _xDescription..Définition..Type
CAS wlTableau, ...
wlTableauAssociatif
_taDefinitions est un tableau associatif de tableau associatif de Variant
_taDefinitionVariables est un tableau associatif de tableau associatif de tableau associatif de Variant
AVEC _xDescription..Déclaration
POUR _nIndice = 1 _TO_ ..Variable..Occurrence
SELON ..Type
CAS wlTableau, ...
wlTableauAssociatif, ...
wlInstance, ...
wlStructure
_taDefinitionVariables[..Variable[_nIndice]..Nom] <- CTools_Enumerating:GetDefinition(_xDescription..Définition)
AUTRE CAS
_taDefinitions[..Variable[_nIndice]..Nom] = CTools_Enumerating:GetDefinitionVariable(..Variable[_nIndice])
FIN
FIN
FIN
SELON Vrai
CAS TableauOccurrence(_taDefinitions) > 0
_taContents <- _taDefinitions
CAS TableauOccurrence(_taDefinitionVariables) > 0
_taVariable["Contents"] <- _taDefinitionVariables
FIN
CAS wlInstance, ...
wlStructure
_taContents <- :GetDefinition(_xDescription..Définition)
FIN
SI TableauOccurrence(_taContents) > 0 ALORS
_taVariable["Contents"] <- _taContents
FIN
RENVOYER _taVariable
CAS ERREUR:
VariableRAZ(_taVariable)
ErreurPropage()
RENVOYER _taVariable
CAS EXCEPTION:
VariableRAZ(_taVariable)
ExceptionPropage()
RENVOYER _taVariable
Procedure PUBLIC GetDefinitions()
ErreurChangeParamètre(epGotoCasErreur)
ExceptionChangeParamètre(epGotoCasException)
:m_taDefinitions <- :GetDefinition(:Definition)
RENVOYER :Definitions
CAS ERREUR:
VariableRAZ(:m_taDefinitions)
ErreurPropage()
RENVOYER :Definitions
CAS EXCEPTION:
VariableRAZ(:m_taDefinitions)
ExceptionPropage()
RENVOYER :Definitions
Procedure PUBLIC GLOBAL GetTypeVarName(_nTypeVar est un entier): chaîne
ErreurChangeParamètre(epGotoCasErreur)
ExceptionChangeParamètre(epGotoCasException)
_sTypeVarName est une chaîne
SELON _nTypeVar
CAS 0
_sTypeVarName = "Champs qui ne renvoient pas de valeur (bouton, champ OLE, ...)."
CAS wlBooléen
_sTypeVarName = "wlBooléen"
CAS wlEntierSansSigne_1
_sTypeVarName = "wlEntierSansSigne_1"
CAS wlEntierSansSigne_2
_sTypeVarName = "wlEntierSansSigne_2"
CAS wlEntierSansSigne_4
_sTypeVarName = "wlEntierSansSigne_4"
CAS wlEntierSansSigne_8
_sTypeVarName = "wlEntierSansSigne_8"
CAS wlEntier_1
_sTypeVarName = "wlEntier_1"
CAS wlEntier_2
_sTypeVarName = "wlEntier_2"
CAS wlEntier
_sTypeVarName = "wlEntier"
CAS wlEntier_8
_sTypeVarName = "wlEntier_8"
CAS wlMonétaire
_sTypeVarName = "wlMonétaire"
CAS wlRéel_4
_sTypeVarName = "wlRéel_4"
CAS wlRéel
_sTypeVarName = "wlRéel"
CAS wlHandle
_sTypeVarName = "wlHandle"
CAS wlCaractère
_sTypeVarName = "wlCaractère"
CAS wlChaîneAnsi
_sTypeVarName = "wlChaîneAnsi"
CAS wlChaîneUnicode
_sTypeVarName = "wlChaîneUnicode"
CAS wlSourceDeDonnées
_sTypeVarName = "wlSourceDeDonnées"
CAS wlChaînePascal
_sTypeVarName = "wlChaînePascal"
CAS wlChaîneFixe
_sTypeVarName = "wlChaîneFixe"
CAS wlChaîneASCIIZ
_sTypeVarName = "wlChaîneASCIIZ"
CAS wlDate
_sTypeVarName = "wlDate"
CAS wlHeure
_sTypeVarName = "wlHeure"
CAS wlDateHeure
_sTypeVarName = "wlDateHeure"
CAS wlDurée
_sTypeVarName = "wlDurée"
CAS wlBuffer
_sTypeVarName = "wlBuffer"
CAS wlMémoBinaire
_sTypeVarName = "wlMémoBinaire"
CAS wlVariant
_sTypeVarName = "wlVariant"
CAS wlAutomation
_sTypeVarName = "wlAutomation"
CAS wlChampOLE
_sTypeVarName = "wlAutomation"
CAS wlTableau
_sTypeVarName = "wlTableau"
CAS wlTableauAssociatif
_sTypeVarName = "wlTableauAssociatif"
CAS wlVariableComposée
_sTypeVarName = "wlVariableComposée"
CAS wlStructure
_sTypeVarName = "wlStructure"
CAS wlInstance
_sTypeVarName = "wlInstance"
CAS wlDescriptionFichier
_sTypeVarName = "wlDescriptionFichier"
CAS wlDescriptionRubrique
_sTypeVarName = "wlDescriptionRubrique"
CAS wlDescriptionLiaison
_sTypeVarName = "wlDescriptionLiaison"
CAS wlPolice
_sTypeVarName = "wlPolice"
CAS wlNumérique
_sTypeVarName = "wlNumérique"
CAS wlConnexion
_sTypeVarName = "wlConnexion"
CAS wlObjetDotNet
_sTypeVarName = "wlObjetDotNet"
CAS wlEnumeration
_sTypeVarName = "wlEnumération"
CAS wlCombinaison
_sTypeVarName = "wlCombinaison"
CAS wlChamp
_sTypeVarName = "wlChamp"
AUTRE CAS
_sTypeVarName = "Unknown"
dbgErreur(ChaîneConstruit("TypeVar: '%1' Unknown !", _nTypeVar))
FIN
RENVOYER _sTypeVarName
CAS ERREUR:
ErreurPropage()
RENVOYER ""
CAS EXCEPTION:
ExceptionPropage()
RENVOYER ""
Procedure PUBLIC Trace(): boolean
ErreurChangeParamètre(epGotoCasErreur)
ExceptionChangeParamètre(epGotoCasException)
TraceDébut(trCreation+trDessusTout)
_TraceTableauAssociatif(:Definitions)
PROCEDURE INTERNE _TraceTableauAssociatif(_taTableau, _nDepth est un entier = 0)
POUR TOUT _xElement, _sKey de _taTableau
QUAND EXCEPTIONEXCEPTION DANS
TraceConstruit("%1>%2" + TAB + "%3", Répète(" ", _nDepth), _sKey, _xElement)
FAIRE
ExceptionActive()
TraceConstruit("%1+%2", Répète(" ", _nDepth), _sKey)
_TraceTableauAssociatif(_xElement, _nDepth + 1)
FIN
FIN
FIN
RENVOYER Vrai
CAS ERREUR:
ErreurInfo(errMessage)
RENVOYER Faux
CAS EXCEPTION:
ExceptionInfo(errMessage)
RENVOYER Faux
=====================
STMembreStruct est une structure
sMembre1 est une chaîne
nMembre2 est un entier
sMembre3 est chaîne
FIN
STTestStruct est une structure
sMembre3 est une chaîne
stMembre4 est STMembreStruct
FIN
CTools_Test est une Classe
x est STTestStruct
y est STTestStruct
FIN
Procedure Constructeur()
Procedure Destructeur()
_clCTools_Test est un CTools_Test
_clCTools_Enumerating est un CTools_Enumerating(_clCTools_Test)
AVEC _clCTools_Enumerating
.GetDefinitions()
.Trace()
FIN
Le fichier de trace de l'example que tu as fournis
+Variables
+x
>Nom x
>Global 0
>Hérité 0
>Masquage 0
>Type wlStructure
+Contents
+Variables
+sMembre3
>Nom sMembre3
>Global 0
>Hérité 0
>Masquage 0
>Type wlChaîneAnsi
+stMembre4
>Nom stMembre4
>Global 0
>Hérité 0
>Masquage 0
>Type wlStructure
+Contents
+Variables
+sMembre1
>Nom sMembre1
>Global 0
>Hérité 0
>Masquage 0
>Type wlChaîneAnsi
+nMembre2
>Nom nMembre2
>Global 0
>Hérité 0
>Masquage 0
>Type wlEntier
+sMembre3
>Nom sMembre3
>Global 0
>Hérité 0
>Masquage 0
>Type wlChaîneAnsi
+y
>Nom y
>Global 0
>Hérité 0
>Masquage 0
>Type wlStructure
+Contents
+Variables
+sMembre3
>Nom sMembre3
>Global 0
>Hérité 0
>Masquage 0
>Type wlChaîneAnsi
+stMembre4
>Nom stMembre4
>Global 0
>Hérité 0
>Masquage 0
>Type wlStructure
+Contents
+Variables
+sMembre1
>Nom sMembre1
>Global 0
>Hérité 0
>Masquage 0
>Type wlChaîneAnsi
+nMembre2
>Nom nMembre2
>Global 0
>Hérité 0
>Masquage 0
>Type wlEntier
+sMembre3
>Nom sMembre3
>Global 0
>Hérité 0
>Masquage 0
>Type wlChaîneAnsi
Merci encore a toi Dandypunk $-]
--
Charly CanDo.
Forg en Nouvelle-Zélande - In üs we trust
Nasi Goreng en Indonesie - #oulouou
Char Kuey Tiao en Malaisie - #OKLM
Ratatouille en Provence
irc.freenode.net - ##pcsoftMensaje modificado, 18,agosto 2017 - 01:44