From 50d37bb23330a1cd1501eba0a6f176ea730f6bde Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Mon, 5 Nov 2007 17:36:10 +0000 Subject: [PATCH] 2007-11-05 18:35 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/tests/wcecon.prg + added small test for DBF/FPT/CDX file creation and browsing in PocketPC/WinCE --- harbour/ChangeLog | 5 +++++ harbour/tests/wcecon.prg | 35 +++++++++++++++++++++++++++++++---- 2 files changed, 36 insertions(+), 4 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index b10e1f7984..1dae75e768 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,11 @@ 2002-12-01 13:30 UTC+0100 Foo Bar */ +2007-11-05 18:35 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/tests/wcecon.prg + + added small test for DBF/FPT/CDX file creation and browsing + in PocketPC/WinCE + 2007-11-05 01:12 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/utils/hbmake/hbmlang.c * pacify some other data lost conversion warnings by explicit casting diff --git a/harbour/tests/wcecon.prg b/harbour/tests/wcecon.prg index 98e2012326..7611664662 100644 --- a/harbour/tests/wcecon.prg +++ b/harbour/tests/wcecon.prg @@ -15,15 +15,17 @@ proc main() + field F1, F2, FX local nMaxScrRow, nMaxScrCol + local cPath, cName, cExt, cDrive local i, j, k /* set OEM font encoding for non unicode modes */ hb_gtInfo( GTI_CODEPAGE, 255 ) /* Set EN CP-437 encoding */ - HB_SETCODEPAGE( "EN" ) - HB_SETTERMCP( "EN" ) + hb_setCodePage( "EN" ) + hb_setTermCP( "EN" ) /* Set font size */ hb_gtInfo( GTI_FONTSIZE, 12 ) @@ -45,10 +47,35 @@ proc main() inkey( 0 ) /* display infomration aboout used OS, harbour version and GT driver */ - alert( OS() + ";" + VERSION() + ";" + HB_GTVERSION() ) + alert( OS() + ";" + Version() + ";" + hb_gtVersion() ) + + /* database test */ + hb_FNameSplit( hb_argv( 0 ), @cPath, @cName, @cExt, @cDrive ) + cPath += "data" + hb_osPathSeparator() + + Alert( "Database path:;;" + cPath ) + + rddSetDefault("DBFCDX") + if !hb_dirExists( cPath ) + MakeDir( cPath ) + endif + dbCreate( cPath + "mydata", { { "F1", "C", 10, 0 }, ; + { "F2", "=", 8, 0 }, ; + { "FX", "M", 4, 0 } } ) + use ( cPath+"mydata" ) + index on F1 tag T1 + index on F2 tag T2 + while lastrec() < 10 + dbappend() + F1 := "rec:" + str( recno(), 3 ) + FX := "[rec:" + str( recno(), 3 ) + "]" + enddo + dbCommit() + dbGoTop() + browse() /* display all characters */ - ? + CLS for i := 0 to 15 for j := 0 to 15 dispout( " " + chr( i * 16 + j ) )