#include 'fivewin.ch'
#include 'ord.ch'
#include 'xbrowse.ch'
REQUEST DBFCDX
function Main()
local oWnd, oBrw
USE CUSTOMER SHARED
DEFINE WINDOW oWnd TITLE 'XBrowse without BackGrounds'
@ 0, 0 XBROWSE oBrw OF oWnd ;
ALIAS 'CUSTOMER' AUTOCOLS ;
CELL LINES ;
COLOR CLR_BLUE, CLR_WHITE
SET MESSAGE OF oWnd TO FWVERSION 2007
oBrw:CreateFromCode()
oWnd:oClient := oBrw
ACTIVATE WINDOW oWnd MAXIMIZED
return nil
#include "fivewin.ch"
REQUEST DBFCDX
function Main()
field FIRST,LAST,STREET,CITY,STATE,ZIP,HIREDATE,MARRIED,AGE,SALARY
field FIRST2,LAST2,STREET2,CITY2,STATE2,ZIP2,HIREDATE2,MARRIED2,AGE2,SALARY2
field FIRST3,LAST3,STREET3,CITY3,STATE3,ZIP3,HIREDATE3,MARRIED3,AGE3,SALARY3
field FIRST4,LAST4,STREET4,CITY4,STATE4,ZIP4,HIREDATE4,MARRIED4,AGE4,SALARY4
field FIRST5,LAST5,STREET5,CITY5,STATE5,ZIP5,HIREDATE5,MARRIED5,AGE5,SALARY5
field FIRST6,LAST6,STREET6,CITY6,STATE6,ZIP6,HIREDATE6,MARRIED6,AGE6,SALARY6
field FIRST7,LAST7,STREET7,CITY7,STATE7,ZIP7,HIREDATE7,MARRIED7,AGE7,SALARY7
field FIRST8,LAST8,STREET8,CITY8,STATE8,ZIP8,HIREDATE8,MARRIED8,AGE8,SALARY8
local aStruct, cCust, cmiln, n, nLen, a, i, c
cCust := "c:\fwh\samples\customer.dbf"
cmiln := "c:\fwh\samples\custmiln.dbf"
if File( cmiln )
USE ( cmiln ) NEW ALIAS "CUST" VIA "DBFCDX"
else
aStruct := FW_DBFSTRUCT( cCust )
ASize( aStruct, Len( aStruct ) - 1 )
nLen := Len( aStruct )
for i := 2 to 8
c := Str( i, 1, 0 )
for n := 2 to nLen
a := AClone( aStruct[ n ] )
a[ 1 ] += c
AAdd( aStruct, a )
next
next
XBROWSER aStruct SHOW SLNUM
DBCREATE( cmiln, aStruct, "DBFCDX", .t., "CUST" )
for n := 1 to 2000
APPEND FROM c:\fwh\samples\customer.dbf ;
FIELDS FIRST,LAST,STREET,CITY,STATE,ZIP,HIREDATE,MARRIED,AGE,SALARY
next
GO TOP
REPLACE ALL FIRST2 WITH FIRST, LAST2 WITH LAST, CITY2 WITH CITY, STATE2 WITH STATE, ;
ZIP2 WITH ZIP, HIREDATE2 WITH HIREDATE, MARRIED2 WITH MARRIED, ;
AGE2 WITH AGE, SALARY2 WITH SALARY
REPLACE ALL FIRST3 WITH FIRST, LAST3 WITH LAST, CITY3 WITH CITY, STATE3 WITH STATE, ;
ZIP3 WITH ZIP, HIREDATE3 WITH HIREDATE, MARRIED3 WITH MARRIED, ;
AGE3 WITH AGE, SALARY3 WITH SALARY
REPLACE ALL FIRST4 WITH FIRST, LAST4 WITH LAST, CITY4 WITH CITY, STATE4 WITH STATE, ;
ZIP4 WITH ZIP, HIREDATE4 WITH HIREDATE, MARRIED4 WITH MARRIED, ;
AGE4 WITH AGE, SALARY4 WITH SALARY
REPLACE ALL FIRST5 WITH FIRST, LAST5 WITH LAST, CITY5 WITH CITY, STATE5 WITH STATE, ;
ZIP5 WITH ZIP, HIREDATE5 WITH HIREDATE, MARRIED5 WITH MARRIED, ;
AGE5 WITH AGE, SALARY5 WITH SALARY
REPLACE ALL FIRST6 WITH FIRST, LAST6 WITH LAST, CITY6 WITH CITY, STATE6 WITH STATE, ;
ZIP6 WITH ZIP, HIREDATE6 WITH HIREDATE, MARRIED6 WITH MARRIED, ;
AGE6 WITH AGE, SALARY6 WITH SALARY
REPLACE ALL FIRST7 WITH FIRST, LAST7 WITH LAST, CITY7 WITH CITY, STATE7 WITH STATE, ;
ZIP7 WITH ZIP, HIREDATE7 WITH HIREDATE, MARRIED7 WITH MARRIED, ;
AGE7 WITH AGE, SALARY7 WITH SALARY
REPLACE ALL FIRST8 WITH FIRST, LAST8 WITH LAST, CITY8 WITH CITY, STATE8 WITH STATE, ;
ZIP8 WITH ZIP, HIREDATE8 WITH HIREDATE, MARRIED8 WITH MARRIED, ;
AGE8 WITH AGE, SALARY8 WITH SALARY
GO TOP
FW_CdxCreate( "ID,FIRST,LAST,STREET,CITY,STATE,ZIP,HIREDATE,MARRIED,AGE,SALARY" )
GO TOP
endif
XBROWSER ALIAS() TITLE "One Million Records: 81 Fields: Record Len: 1061" ;
SETUP ( oBrw:aCols[ 1 ]:cEditPicture := "99,999,999", oBrw:lFastDraw := .t., ;
oBrw:lVThumbTrack := .t., oBrw:lAutosort := .t. )
return nil
#include "fivewin.ch"
REQUEST DBFCDX
function Main()
local cDbf := "c:\fwh\samples\customer.dbf"
local cNew := "c:\fwh\samples\cust400f.dbf"
local i,j,n,c,aCol, aData, aRow, aCols, aNew := {}
if File( cNew )
USE ( cNew ) NEW ALIAS C400 VIA "DBFCDX"
? "Open"
else
USE ( cDbf )
aCols := DBSTRUCT( cDbf )
AAdd( aNew, aCols[ 1 ] )
for i := 1 to 40
c := StrZero( i, 2, 0 )
for n := 2 to 11
aCol := AClone( aCols[ n ] )
aCol[ 1 ] += c
AAdd( aNew, aCol )
next
next
aData := FW_DbfToArray( nil, nil, { || RECNO() <= 100 } )
CLOSE DATA
DBCREATE( cNew, aNew, "DBFCDX", .T., "C400" )
for each aRow in aData
DBAPPEND()
n := 2
for i := 1 to 40
for j := 2 to 11
FieldPut( n, aRow[ j ] )
n++
next
next
next
GO TOP
endif
XBROWSER ALIAS() SETUP ( oBrw:nMarqueeStyle := 3, oBrw:lFastDraw := .t. )
return nil
oBrw:GoToCol( <column_name> )
#include 'fivewin.ch'
#include 'ord.ch'
#include 'xbrowse.ch'
REQUEST DBFCDX
function Main()
local oWnd, oBrw
USE CUSTOMER SHARED
DEFINE WINDOW oWnd TITLE 'XBrowse without BackGrounds'
@ 0, 0 XBROWSE oBrw OF oWnd ;
ALIAS 'CUSTOMER' AUTOCOLS ;
CELL LINES ;
COLOR CLR_BLUE, CLR_WHITE
SET MESSAGE OF oWnd TO FWVERSION 2007
oBrw:CreateFromCode()
oWnd:oClient := oBrw
ACTIVATE WINDOW oWnd MAXIMIZED
return nil
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 18 guests