Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using preprocessed directive in a property?
Message
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01504362
Message ID:
01504377
Views:
41
>>>>Thank you. I got it now.
>>>>
>>>>>It's not going to work. The Preprocessor directives are resolved at compile time. You can store the value in another property
>>>>>
>>>>>this.AnotherProperty = CC_CODE
>>>>>...
>>>>>this.pass_code = this.AnotherProperty
>>>>>
>>>>>
>>>>>>
>>>
>>>Can you explain exactly what you're trying to achieve?
>>
>>Currently I have to set the value in code for each child class. For example:
>>Class 1 would have code in INIT method:
>>this.pass_code = CC_CODE
>>Class 2 would have code in INIT method:
>>this.pass_code = PP_CODE
>>and so on.
>>
>>I would prefer to have the property PASS_CODE to be set in the parent class INIT method and then for each child class enter the name (e.g. "CC_CODE", "PP_CODE", etc.) as value in a property.
>
>
>This is not going to work with #define. You can have one property
>
>this.Pass_Code_Prop = 'CC_CODE'
>
>this.Pass_Code = evaluate(this.Pass_Code_Prop) && this will result in the either value of cc_code field or cc_code variable if you have them in the scope of that method's call
>
>--------------------------------------------

Since it won't work with #define (as Sergey already said), I am giving up on this idea. Thanks.
"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