Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
#DEFINE problem
Message
 
 
À
07/02/2006 15:58:56
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:
01094434
Vues:
8
This message has been marked as the solution to the initial question of the thread.
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
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform