Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Macro or Evaluate?
Message
 
 
To
21/09/2018 06:44:51
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01662147
Message ID:
01662186
Views:
37
>>First, thank you. Your approach should work and should be my solution. But I have changed the TEXT TO ENDTEXT to a string (because I will store it in the app object). So in my case I have
>>
>> cExpr = "<<tcAliasName>>.INSTOCK + <<tcAliasName>>.ONORDER - <<tcAliasName>>.REORDERPNT"
>>nQty = EVALUATE( cExpr ) 
>>
>>
>>But I get error Missing Operand. I must be doing something wrong. I will keep checking my syntax.
>>
>>UPDATE. The error is actually Missing Expression, not Operand.
>
>
>  cExpr =textmerge( "<< m.tcAliasName >>.INSTOCK + << m.tcAliasName >>.ONORDER - << m.tcAliasName >>.REORDERPNT")
>  nQty = EVALUATE( m.cExpr ) 
>
>
>Or without merging (merging is nice BTW):
>
>
>  cExpr = m.tcAliasName + ".INSTOCK + " +  m.tcAliasName + ".ONORDER - " + m.tcAliasName +".REORDERPNT"
>  nQty = EVALUATE( m.cExpr ) 
>
>(Without text merging it is a bit obscure using operands)

Thank you, Cetin. I ended up using the Textmerge() approach because I need to save the entire string to an XML file. That is, for different customers the expression may be different.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Reply
Map
View

Click here to load this message in the networking platform