* src/rtl/dirdrive.c
+ Added HB_DIRCREATE(), which is same as MAKEDIR() C5.3 function,
but it's always available, not just when HB_COMPAT_C53 is enabled.
+ Added HB_DIRDELETE(), which is same as DIRREMOVE() C5.3 function,
but it's always available, not just when HB_COMPAT_C53 is enabled.
* contrib/hbnetio/tests/netiotst.prg
* contrib/hbnetio/tests/netiot03.prg
* contrib/hbfimage/tests/fitest.prg
* contrib/hbide/idesaveload.prg
* utils/hbmk2/hbmk2.prg
* utils/hbrun/hbrun.prg
* tests/wcecon.prg
* tests/flink.prg
* bin/hb3rdpat.hbs
* examples/hbdoc2/gentpl.prg
* Replaced MakeDir() with universally available hb_DirCreate().
; TODO: same in config/postinst.hbs (delayed to avoid a million
false bug reports)
* src/rtl/Makefile
+ src/rtl/hbfilehi.prg
+ Added generic file/dir/path handling functions.
They are taken from hbmk2 code, added parameter checking,
did two minor change to DirBuild() to be generic,
renamed to have HB_ prefix.
Please note the parameter list and any details are
subject to change yet, IOW these APIs are not yet finalized:
hb_cwd() -> <cPath>
hb_PathNormalize( <cPath> ) -> <cPath>
hb_PathMakeAbsolute( <cPathRel>, <cPathAbs> ) -> <cPath>
hb_PathMakeRelative( <cPathBase>, <cPathTarget>, <lForceRelative> ) -> <cPath>
hb_DirAddPathSep( <cDir> ) -> <cDir>
hb_DirDelPathSep( <cDir> ) -> <cDir>
hb_DirBuild( <cDir> ) -> <lSuccess>
hb_DirUnbuild( <cDir> ) -> <lSuccess>
hb_FNameDirGet( <cFileName> ) -> <cDir>
hb_FNameNameGet( <cFileName> ) -> <cName>
hb_FNameNameExtGet( <cFileName> ) -> <cNameExt>
hb_FNameExtGet( <cFileName> ) -> <cExt>
hb_FNameExtDef( <cFileName>, <cDefExt> ) -> <cFileName>
hb_FNameExtSet( <cFileName>, <cExt> ) -> <cFileName>
hb_FNameDirExtSet( <cFileName>, <cDirNew>, <cExtNew> ) -> <cFileName>
; TODO: Review, clean interface.
; TODO: Use these functions in .hbs files, utils, hbide.
* include/harbour.hbx
* Updated.
* utils/hbmk2/hbmk2.prg
* One internal function renamed.
104 lines
2.5 KiB
Plaintext
104 lines
2.5 KiB
Plaintext
/*
|
|
* $Id$
|
|
*/
|
|
|
|
/*
|
|
* Harbour Project source code:
|
|
* demonstration/test code for WinCE console program
|
|
*
|
|
* Copyright 2007 Przemyslaw Czerpak <druzus / at / priv.onet.pl>
|
|
* www - http://harbour-project.org
|
|
*
|
|
*/
|
|
|
|
#include "hbgtinfo.ch"
|
|
|
|
request DBFCDX
|
|
|
|
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( HB_GTI_CODEPAGE, 255 )
|
|
|
|
/* Set EN CP-437 encoding */
|
|
hb_cdpSelect( "EN" )
|
|
hb_setTermCP( "EN" )
|
|
|
|
/* Set font size */
|
|
hb_gtInfo( HB_GTI_FONTWIDTH, 6 )
|
|
hb_gtInfo( HB_GTI_FONTSIZE, 12 )
|
|
|
|
/* resize console window using new font size */
|
|
SetMode( MaxRow() + 1, MaxCol() + 1 )
|
|
|
|
/* get screen dimensions */
|
|
nMaxScrRow := hb_gtInfo( HB_GTI_DESKTOPROWS )
|
|
nMaxScrCol := hb_gtInfo( HB_GTI_DESKTOPCOLS )
|
|
|
|
/* resize console window to the screen size */
|
|
SetMode( nMaxScrRow, nMaxScrCol )
|
|
|
|
/* display console window size */
|
|
? "rows =", ltrim( str( maxrow() + 1 ) )
|
|
? "cols =", ltrim( str( maxcol() + 1 ) )
|
|
inkey( 0 )
|
|
|
|
/* display infomration aboout used OS, harbour version and GT driver */
|
|
alert( OS() + ";" + Version() + ";" + hb_gtVersion() )
|
|
|
|
/* database test */
|
|
hb_FNameSplit( hb_argv( 0 ), @cPath, @cName, @cExt, @cDrive )
|
|
cPath += "data" + hb_ps()
|
|
|
|
Alert( "Database path:;;" + cPath )
|
|
|
|
rddSetDefault("DBFCDX")
|
|
if !hb_dirExists( cPath )
|
|
hb_dirCreate( 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 ) )
|
|
next
|
|
?
|
|
next
|
|
inkey( 0 )
|
|
|
|
/* display boxes */
|
|
?; devout( "ÚÄÂÄ¿ ÉÍËÍ» ÕÍÑ͸ ÖÄÒÄ· ÜÜÜ" )
|
|
?; devout( "³ ³ ³ º º º ÃÄÅÄ´ ÇÄ×Ķ ÝþÞ" )
|
|
?; devout( "ÃÄÅÄ´ ÌÍÎ͹ ³ ³ ³ º º º ÝÛÞ" )
|
|
?; devout( "³ ³ ³ º º º ÆÍØÍµ ÌÍÎ͹ ÝþÞ" )
|
|
?; devout( "ÀÄÁÄÙ ÈÍÊͼ ÔÍÏ; ÓÄÐĽ ßßß" )
|
|
inkey( 0 )
|
|
|
|
?
|
|
? "@ - interrupt, keycodes test "
|
|
while ( k := inkey( 0 ) ) != 64
|
|
? ; devout( "key=" + str( k, 4 ) + ", char='" + chr( k ) + "'" )
|
|
enddo
|
|
|
|
return
|