xBrowse - Add Array
Posted: Tue Oct 09, 2012 4:17 am
Hi All,
I have a problem with xBrowse and array,
if I want to add record ( array ) in a xbrowse in the same times,
but the result is a blank record.....??
my code like this:
someone can help me..?
Mulyadi.
I have a problem with xBrowse and array,
if I want to add record ( array ) in a xbrowse in the same times,
but the result is a blank record.....??
my code like this:
- Code: Select all Expand view
- #include "FiveWin.ch"
#include "xbrowse.ch"
func main
local oDlg
local nWidth := GetSysMetrics( 0 )
local nHeight := GetSysMetrics( 1 )
local nLeft
local oBrw, aData := {{"",ctod("00-00-0000"),0,""}}
local oHeadfont := TFont():New("Segoe UI Light",,-32, .F.,.F.,,,,.F.)
local oDatafont := TFont():New("Segoe UI Light",,-14, .F.,.F.,,,,.F.)
fwNumFormat( 'E', .t. )
nLeft := nWidth/7/2.05
nHeight := (((nHeight - 100)/ 3 ) * 2 ) // - 20
DEFINE DIALOG oDlg ;
FROM 100, -6 ;
TO nHeight+200, nWidth + 6 ;
PIXEL ;
STYLE nOr( DS_MODALFRAME, WS_POPUP ) ;
COLOR CLR_BLACK, CLR_CYAN ;
FONT odatafont
@ 1,(nWidth/2)-100 say "Test Import" of oDlg size 100, 32 pixel font oHeadfont color CLR_WHITE, CLR_CYAN
@ 5,10 BTNBMP prompt "&Import" size 80, 12 font odatafont OF oDlg center 2007 noborder ;
action ( aData := do_import_array( aData ), ;
oBrw:aArrayData := aData, ;
oBrw:refresh() )
// oBrw:SetArray( aData ) )
@ 2,1 XBROWSE oBrw ARRAY aData OF oDlg ;
FIELDS oBrw:aRow:cNo, oBrw:aRow:dDate, oBrw:aRow:nRow, oBrw:aRow:cDesc ;
HEADERS "No","Date","Row","Desc." ;
COLSIZES 100, 100, 100, 500 ;
SIZE 600, 230 ;
CELL LINES NOBORDER
oBrw:lHScroll = .T.
oBrw:lVScroll = .T.
oBrw:lRecordSelector = .F.
oBrw:CreateFromCode()
oBrw:SetFocus()
activate dialog oDlg
odatafont:end()
oheadfont:end()
return .F.
static func do_import_array( aData )
local i := 0
for i := 1 to 5
aadd( aData, { str(i,5), dtoc( date() + 1 ), i + 100, "test i + 100" } )
next i
return aData
someone can help me..?
Mulyadi.