Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
#DEFINE problem
Message
De
07/02/2006 16:28:48
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01094430
Message ID:
01094449
Vues:
8
Thanks Sergey, I remember that now! Don't know why I was thinking of doing it that way...


>Tracy,
>
>The #DEFINE is evaluated at pre-compile time. In runtime it has no effect because it doesn't exists anymore.
>
>>I have in a method of a form:
>>
>>FOR m.icounter = 1 TO THISFORM.ControlCount
>>	oControl = ThisForm.Controls[m.icounter]
>>	IF ALLTRIM(UPPER(oControl.Baseclass)) = "TEXTBOX"
>>		IF !EMPTY(oControl.Tag) .and. !EMPTY(oControl.controlsource)
>>			TRY
>>				qtag = ocontrol.Tag
>>				qnewval = EVALUATE(oControl.controlSource)
>>				qtype = TYPE('EVALUATE(oControl.controlsource)')
>>				qsysnum = thisform.ca_sysnum
>>				qagnum = thisform.ca_ag_num
>>                                *UWUSRCreate is a program part of which is shown below
>>				=UWUSRCreate(qTag,qnewval,qtype,qsysnum,qagnum)
>>			CATCH
>>			ENDTRY
>>		ENDIF
>>	ENDIF
>>ENDFOR
>>
>>A snapshot of the UWUSRCreate function:
>>
>>LPARAMETERS tRecord, tValue, tType, tCoId, tAgId
>>
>>*I verified that at this point the following values are correct:
>>*tRecord = "UGI_CCONFEE"
>>*tValue = 1.15
>>*tType = "N"
>>*tcoId = 12
>>*tAgId = ""
>>
>>#DEFINE UGI_CCONFEE        8159760   && Contract Fee
>>
>>TRY
>>   iGroupID = EVALUATE(tRecord)
>>CATCH
>>   iGroupID = 0  && I land here because UGI_CCONFEE is undefined why?
>>ENDTRY
>>
>>Yet this works from the command window:
>>
>>UGI_CCONFEE = 8159760
>>trecord = "UGI_CCONFEE"
>>?EVALUATE(trecord) && returns 8159760 as it should
>>
>>Why does it not work in my program using #DEFINE? I must be overlooking something basic... ?
>>
>>TIA,
>>Tracy
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform