Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Object not found when creating
Message
De
20/09/2007 12:22:07
 
 
À
20/09/2007 12:15:25
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
01255744
Message ID:
01255771
Vues:
10
This message has been marked as the solution to the initial question of the thread.
>>>I'm getting an error that oHL7ComponentSeparator is not found. If I'm creating it on that line, why is it looking for it?
>>>
>>>
>>>	**********************************************************
>>>	PROCEDURE ProcessData(Company, DataExchangeType, DataArea, KeyFieldValue)
>>>
>>>		DODEFAULT()
>>>
>>>		LOCAL strProcessData, strAcknowledgment
>>>
>>>		strProcessData = ''
>>>
>>>		THIS.oHL7ComponentSeparator = CREATEOBJECT('empty')
>>>
>>
>>Because that property is not defined before that row. You could use:
>>
>>PROCEDURE ProcessData(Company, DataExchangeType, DataArea, KeyFieldValue)
>>          DODEFAULT()
>>          LOCAL strProcessData, strAcknowledgment
>>          strProcessData = ''
>>          IF PEMSTATUS(this,[oHL7ComponentSeparator],5)
>>             THIS.oHL7ComponentSeparator = NULL
>>          ELSE
>>             ADDPROPERTY(this,[oHL7ComponentSeparator])
>>          ENDIF
>>          THIS.oHL7ComponentSeparator = CREATEOBJECT('empty')
>>...
>>
>
>I tried using the NULL before it, but I got an error on that too. Not with your code, but with mine.

That is because you didn't check for existence of that property. Properties unlike variables aren't created dynamically, you must defined them in the designer, or use ADDPROPERTY() function (I use it, because not all classes have .AddProperty() methond)
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform