Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DynamicBackColor in grid question
Message
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00409939
Message ID:
00410000
Views:
28
Nadya,
1. Yes you can return strings from methods of this nature but you would get an errr in this case. The "THISFORM.GetBackColor()" reference is setting a property - DynamicBackColor. In order for it to work, the function must return a value that BackColor can use.

2. It will be slightly slower because you are adding the overhead of an object.method call instead of a simple function. But sometimes you sacrifice small performance hits for maintainability.

>>>Larry:
>>>
>>>Thanks for the help. Hate to ask, but do you have an example?
>>>
>>>TIA
>>>
>>
>>I like this idea better than mine.
>>
>>Here's one example - ugly results, but...
>>
>>** custom form method GetBackColor()
>>Local lcDOW, lnretval
>>lcDOW = cdow(mytable.datefield)
>>do case
>> case inlist(lcDOW,"Monday", "Wednesday", "Friday")
>>  lnretval = rgb(0,0,255)
>> case inlist(lcDOW,"Tuesday", "Thursday")
>>  lnretval = rgb(0,255,0)
>> otherwise
>>  lnretval = rgb(255,0,0)
>>endcase
>>return lnretval
>>
>>** grid.Init()
>>this.setall("DynamicBackColor", "thisform.GetBackColor()", "Column")
>
>Wanted to suggest the same, Larry suggested, but hesitated for some reason :)
>
>Two additional questions:
>1) Can we return character from the function, e.g. str(lnRetVal) and call thisform.GetBackColor without quotes?
>2) Would it be slower than nested iif?
>
>Thanks in advance.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Reply
Map
View

Click here to load this message in the networking platform