Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Macro Substitution & Grids
Message
From
25/01/2002 04:16:38
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
25/01/2002 03:02:21
N. Lea
Nic Cross Enterprises
Valencia, California, United States
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00610214
Message ID:
00610331
Views:
25
Your basic problem is missing quotes. If you have 9 columns only a setall() followed by a :

.grdFinancialChart.Column1.DynamicBackcolor = ""

could do the job. Assuming columncount varies highly (and gcBackcolor is something like 'myTable.myField') :
with .grdFinancialChart
 for ix = 2 to 9
  with eval('.Column'+trans(ix)) && Assuming columns(ix) n/a
    .Dynamicbackcolor = "(iif("+gcBackColor+"=0,rgb(255,255,0),RGB(255,255,255)))"
  endwith
 endfor
endwith
PS: Please use only <PRE> and </PRE> tags for code.
Cetin

>Well here is what I got. I created a table with 3 fields (name, table, index). Upon choice of item from a combobox (linked to table mentioned above), the system places it into a variable:
>
>
>
>gcProfitName = RTRIM(chartselect.pnl_name)
>gcProfitFile = RTRIM(chartselect.pnl_file)
>gcGLIndex = RTRIM(chartselect.pnl_index)
>
>

>
>Now, when the next form executes, the update form method assigns the DynamicBackColor with the new properties associated with the variables. The reasoning behind this is that the index field in the above mentioned table (also acts as data linked to other tables, so it has two purposes {sets the order and seeks out the data related to the information in that field}). Confused yet?
>
>Now this is what attempts to executes:
>
>
>
> .grdFinancialChart.Column1.ControlSource = profitfile.&gcGlIndex
>
> gcBackColor = profitfile.&gcGlIndex
> .grdFinancialChart.Column2.DynamicBackcolor = IIF('&gcBackColor' = 0,RGB(255,255,0),RGB(255,255,255))
> .grdFinancialChart.Column3.DynamicBackcolor = IIF('&gcBackColor' = 0,RGB(255,255,0),RGB(255,255,255))
> .grdFinancialChart.Column4.DynamicBackcolor = IIF('&gcBackColor' = 0,RGB(255,255,0),RGB(255,255,255))
> .grdFinancialChart.Column5.DynamicBackcolor = IIF('&gcBackColor' = 0,RGB(255,255,0),RGB(255,255,255))
> .grdFinancialChart.Column6.DynamicBackcolor = IIF('&gcBackColor' = 0,RGB(255,255,0),RGB(255,255,255))
> .grdFinancialChart.Column7.DynamicBackcolor = IIF('&gcBackColor'= 0,RGB(255,255,0),RGB(255,255,255))
> .grdFinancialChart.Column8.DynamicBackcolor = IIF('&gcBackColor' = 0,RGB(255,255,0),RGB(255,255,255))
> .grdFinancialChart.Column9.DynamicBackcolor = IIF('&gcBackColor' = 0,RGB(255,255,0),RGB(255,255,255))
>
>

>
>However, the system blows an error with this procedure. I attempted to not use quotes around the variable in the DynamicBackColor, but to no avail. Does this help you out??
>
>Thanx in adavance for any assistance!
>
>Regards,
>
>Nicholas
>"Never Underestimate Radical Vision"
>
>>>Can anyone help me. I am trying to use macro substituion in my form that has a grid. My grid needs to have particular backcolor in the dynamic mask. I attempted to use the macro sub, but it tells me invalid data type for this field. Can anyone help me. Thanks!
>>
>>Without seeing your code it's almost impossible to help.
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform