Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
#DEFINE problem
Message
From
07/02/2006 16:31:44
 
 
To
07/02/2006 16:06:32
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01094430
Message ID:
01094451
Views:
16
Thanks Borislav.

>Becuse precompiler can't substitute UGI_CCONFEE with 8159760. You have it in PARAMETERs and during the compilation compiler doesn't know parameter values.
>If you change this (for testing only) to:
>
>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
>
>tRecord = "UGI_CCONFEE"
>TRY
>   iGroupID = EVALUATE(tRecord)
>CATCH
>   iGroupID = 0  && I land here because UGI_CCONFEE is undefined why?
>ENDTRY
>
>
>Then it will works, becuase precompiler will change the row with tRecord = "UGI_CCONFEE" to
>tRecord = "8159760". BUT THIS IS ONLY FOR TESTING :o)))
>
>>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"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform