Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Clipper > Re: Tbrowse hel...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 4 Topic 3817 of 3904
Post > Topic >>

Re: Tbrowse help.

by "Stephen Quinn" <stevejqNO@[EMAIL PROTECTED] > Jan 13, 2008 at 02:36 AM

> 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




 4 Posts in Topic:
Tbrowse help.
vmk1508@[EMAIL PROTECTED]  2008-01-12 07:14:44 
Re: Tbrowse help.
"Stephen Quinn"  2008-01-13 02:36:52 
Re: Tbrowse help.
sebas22 <nospam@[EMAIL  2008-01-13 08:37:38 
Re: Tbrowse help.
sebas22 <nospam@[EMAIL  2008-01-13 08:41:03 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat May 17 6:32:05 CDT 2008.