Dear All,
I am using Clipper 5.01 with Rtlink.
I am using the following Tbrowse routine in my program.
Tbrowse program,
**********************************************************************
Function Dblist()
Private mb,key,Mtype,Mdata
Store spac(2) to Mtype
Store spac(30) to Mdata
save scre to Dblsscr
Sele 1
use Party inde Party shared readonly
@[EMAIL PROTECTED]
05,10 clea to 22,75
@[EMAIL PROTECTED]
05,10 to 22,75 double
mb := Tbrowsedb(06,11,21,74)
mb :colsep = ' '+chr(179)+' '
mb :headsep = chr(205)
mb :footsep = chr(205)
mb :addcolumn(Tbcolumnnew('Pt. Code', {||1 -> Pt_code }))
mb :addcolumn(Tbcolumnnew('Party Name',{||1 -> Pt_name }))
mb :addcolumn(Tbcolumnnew('Party Addr',{||1 -> Pt_add1 }))
mb :addcolumn(Tbcolumnnew('Party Addr',{||1 -> Pt_add2 }))
mb :addcolumn(Tbcolumnnew('Party Addr',{||1 -> Pt_add3 }))
mb :addcolumn(Tbcolumnnew('Party Addr',{||1 -> Pt_add4 }))
mb :addcolumn(Tbcolumnnew('Party Addr',{||1 -> Pt_stat }))
mb :addcolumn(Tbcolumnnew('Party Addr',{||1 -> Pt_pin }))
mb :addcolumn(Tbcolumnnew('Party Phone',{||1 -> Pt_phone }))
mb :addcolumn(Tbcolumnnew('Party Lst No.',{||1 -> Pt_tngst }))
mb :addcolumn(Tbcolumnnew('Party Cst No.',{||1 -> Pt_cst }))
mb :addcolumn(Tbcolumnnew('Party Frm No.',{||1 -> Pt_frmno }))
mb :addcolumn(Tbcolumnnew('Party Ordno.',{||1 -> Pt_ordno }))
mb :addcolumn(Tbcolumnnew('Party Ordsl.',{||1 -> Pt_ordsl }))
mb :addcolumn(Tbcolumnnew('Party Ordno.',{||1 -> Pt_ordno1 }))
mb :addcolumn(Tbcolumnnew('Party Ordslo.',{||1 -> Pt_ordsl1 }))
Messag('Use Arrow Keys To Navigate Or Press Esc')
do while (key:=inkey()) != 27
ol_autoyield(.t.)
if !mb: Stable
do while !(Mb:Stabilize())
ol_autoyield(.t.)
if inkey() != 0
Keyboard chr(Lastkey())
exit
endif
enddo
endif
key = inkey(0)
do case
case Key = ENTER
Exit
case Key = ESC
Exit
case Key = LEFT
Mb:left()
case Key = SHFTAB
Mb:left()
case Key = TAB
Mb:right()
case Key = RIGHT
Mb:right()
case Key = UP
if !(Mb:Hittop)
Mb:up()
else
tone(600)
endif
case Key = DOWN
if !(Mb:Hitbottom)
Mb:down()
else
tone(600)
endif
case Key = CTRL_RIGHT
Mb:panend()
case Key = CTRL_LEFT
Mb:panhome()
case Key = HOME
Mb:Panleft()
case Key = END
Mb:Panright()
case key = F2
Swapcol()
case Key = PGDN
if !(Mb:Hitbottom)
Mb:pagedown()
else
tone(600)
endif
case Key = PGUP
if !(Mb:Hittop)
Mb:pageup()
else
tone(600)
endif
case Key = CTRL_PGUP
if !(Mb:hittop)
Mb:gotop()
else
tone(600)
endif
case Key = CTRL_PGDN
if !(Mb:hitbottom)
Mb:gobottom()
else
tone(600)
endif
endcase
enddo
Rest scre from Dblsscr
Return Nil
*********************************************************************
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. Please suggest
me with a sample program or modification in this routine. My record
size is 7000+.
Also pl. inform me how to use colors in the Tbrowse windows (If a
conditions meets then it should be in a color).
Thanks & Regards for the help well in advance.
V.Mahesh Kumar.


|