> Function Swapcol()
>
> Private cur_col,C_obj_1,C_obj_2
> Cur_col = mb:colpos
> C_obj_1 = mb:getcolumn(1)
> C_obj_2 = mb:getcolumn(mb:colpos)
> mb:setcolumn(1,C_obj_2)
> mb:setcolumn(Cur_col,C_obj_1)
>
> Return Nil
> *********************************************************************
>
> The function is called when ever required.
> I want to use for while condition in the above routine.
What for??
Your swapping 2 columns why would you need a while condition??
> Please suggest me with a sample program or modification in this routine.
Unless you mean
if SomeValueIsTrue()
SwapCol()
endif
> My record size is 7000+.
Nothing to do with your question.
Also you have no code in there to check if your trying to swap column 1
with itself
ie mb:Colpos = 1
oTB:ColorSpec := {,,,,,,,,,,} // aList of colors - see help about the
defaults
// This Column uses colours 2 & 3 from the above list
oCol:ColorBlock := {|| {2, 3} }
// This Column uses colours 5,7 if somevalue = true else colours 3 & 4
oCol:ColorBlock := {|| iif( Somevalue, { 5, 7 }, { 3, 4 } ) }
or
oCol:ColorBlock := {|| CheckItOut( oTB) }
function CheckItOut( oTB)
local aArray := {2,3}
local nCol := oTB:ColPos
do case
case nCol = 1 .AND. SomeValue
aArray := {5, 7 }
case nCol = 2 .AND. SomeValue
aArray := {3, 4 }
endcase
return aArray
Please check the help about the correct names etc... as I wrote this from
memory
CYA
Steve


|