2008-08-05 02:43 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/utils/hbdot/hbdot.prg
* removed holder class for HRB modules - it's not longer necessary
because we have automatic destructors for .hrb modules
* updated usage message for .hrb files
* minor modifications
* harbour/doc/man/hbdot.1
* updated man page for recent modifications
This commit is contained in:
@@ -8,6 +8,16 @@
|
||||
2008-12-31 13:59 UTC+0100 Foo Bar <foo.bar@foobar.org>
|
||||
*/
|
||||
|
||||
2008-08-05 02:43 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
|
||||
* harbour/utils/hbdot/hbdot.prg
|
||||
* removed holder class for HRB modules - it's not longer necessary
|
||||
because we have automatic destructors for .hrb modules
|
||||
* updated usage message for .hrb files
|
||||
* minor modifications
|
||||
|
||||
* harbour/doc/man/hbdot.1
|
||||
* updated man page for recent modifications
|
||||
|
||||
2008-08-05 00:22 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
|
||||
+ utils/hbmake/bld_vc.bat
|
||||
+ utils/hbmake/bld_b32.bat
|
||||
|
||||
@@ -4,13 +4,16 @@
|
||||
hbdot \- "DOt Prompt" Console for the Harbour Language
|
||||
|
||||
.SH SYNOPSIS
|
||||
\fBhbdot\fP \fB[<file[.prg]>\fP \fB[<parameters,...>]]\fP
|
||||
\fBhbdot\fP \fB[<file[.prg|.hrb]>\fP \fB[<parameters,...>]]\fP
|
||||
|
||||
.SH DESCRIPTION
|
||||
\fBhbdot\fP is "DOt Prompt" console for the Harbour Language.
|
||||
It can work as interpreter when run without parameters
|
||||
or can execute xBase/Clipper source code in .prg file given
|
||||
as first parameter.
|
||||
or can execute xBase/Clipper source code in .prg file or compiled
|
||||
Harbour Portable Objects (.hrb) given as first parameter.
|
||||
Type of file is recognized by extension used with \fB<file>\fP
|
||||
parameter. If not given then .hrb is used.
|
||||
|
||||
.PP
|
||||
\fBhbdot\fP can be also used to execute .prg files as scripts
|
||||
It's enough to add in the first line of .prg file:
|
||||
@@ -20,8 +23,11 @@ It's enough to add in the first line of .prg file:
|
||||
and set executable attribute.
|
||||
|
||||
.SH OPTIONS
|
||||
This program has no options. \fB<parameters,...>\fP are passed to
|
||||
startup function in executed code coming from \fB<file[.prg]>\fP.
|
||||
.IP "\fB-h, -?, --help\fP" 10
|
||||
When given as first parameter display help
|
||||
.PP
|
||||
This program has no other options. \fB<parameters,...>\fP are passed to
|
||||
startup function in executed code coming from \fB<file[.prg|.hrb]>\fP.
|
||||
|
||||
.SH AUTHOR
|
||||
|
||||
|
||||
@@ -54,8 +54,6 @@
|
||||
#include "setcurs.ch"
|
||||
#include "hbextern.ch"
|
||||
|
||||
#include "hbclass.ch"
|
||||
|
||||
#define HB_HISTORY_LEN 32
|
||||
#define HB_LINE_LEN 256
|
||||
#define HB_PROMPT "."
|
||||
@@ -66,10 +64,11 @@ STATIC s_aIncDir := {}
|
||||
/* ********************************************************************** */
|
||||
|
||||
PROCEDURE _APPMAIN( cFile, ... )
|
||||
LOCAL GetList, cLine, cCommand, cPath, nMaxRow, nMaxCol
|
||||
LOCAL GetList
|
||||
LOCAL cLine, cCommand, cPath, cExt
|
||||
LOCAL nMaxRow, nMaxCol
|
||||
LOCAL aHistory, nHistIndex
|
||||
LOCAL bKeyUP, bKeyDown, bKeyIns
|
||||
LOCAL cExt
|
||||
|
||||
#ifdef _DEFAULT_INC_DIR
|
||||
AADD( s_aIncDir, "-I" + _DEFAULT_INC_DIR )
|
||||
@@ -87,16 +86,13 @@ PROCEDURE _APPMAIN( cFile, ... )
|
||||
SWITCH lower( cFile )
|
||||
CASE "-?"
|
||||
CASE "-h"
|
||||
CASE "-h"
|
||||
CASE "--help"
|
||||
CASE "/?"
|
||||
CASE "/h"
|
||||
HB_DotUsage()
|
||||
EXIT
|
||||
OTHERWISE
|
||||
|
||||
hb_FNameSplit( cFile, NIL, NIL, @cExt )
|
||||
|
||||
IF Lower( cExt ) == ".prg"
|
||||
cFile := HB_COMPILEBUF( HB_ARGV( 0 ), "-n", "-w", "-es2", "-q0", ;
|
||||
s_aIncDir, cFile )
|
||||
@@ -194,7 +190,7 @@ STATIC PROCEDURE HB_DotUsage()
|
||||
'Copyright 1999-2008, Przemyslaw Czerpak' + HB_OSNewLine() + ;
|
||||
'http://www.harbour-project.org' + HB_OSNewLine() +;
|
||||
HB_OSNewLine() +;
|
||||
'Syntax: hbdot [<hrbfile[.prg]> [<parameters,...>]]' + HB_OSNewLine() + ;
|
||||
'Syntax: hbdot [<hrbfile[.prg|.hrb]> [<parameters,...>]]' + HB_OSNewLine() + ;
|
||||
HB_OSNewLine() +;
|
||||
"Note: Linked with " + Version() + HB_OSNewLine() )
|
||||
|
||||
@@ -258,7 +254,7 @@ STATIC PROCEDURE HB_DotErr( oErr, cCommand )
|
||||
/* ********************************************************************** */
|
||||
|
||||
STATIC PROCEDURE HB_DotExec( cCommand )
|
||||
LOCAL oHRB, cHRB, cFunc, bBlock, cEol
|
||||
LOCAL pHRB, cHRB, cFunc, bBlock, cEol
|
||||
|
||||
cEol := hb_osNewLine()
|
||||
cFunc := "STATIC FUNC __HBDOT()" + cEol + ;
|
||||
@@ -273,22 +269,20 @@ STATIC PROCEDURE HB_DotExec( cCommand )
|
||||
IF cHRB == NIL
|
||||
EVAL( ErrorBlock(), "Syntax error." )
|
||||
ELSE
|
||||
oHRB := hrbHolder():New( cHRB )
|
||||
bBlock := oHRB:do()
|
||||
|
||||
DevPos( s_nRow, s_nCol )
|
||||
Eval( bBlock )
|
||||
s_nRow := Row()
|
||||
s_nCol := Col()
|
||||
IF s_nRow < 2
|
||||
s_nRow := 2
|
||||
pHRB := __hrbLoad( cHRB )
|
||||
IF pHrb != NIL
|
||||
bBlock := __hrbDo( pHRB )
|
||||
DevPos( s_nRow, s_nCol )
|
||||
Eval( bBlock )
|
||||
s_nRow := Row()
|
||||
s_nCol := Col()
|
||||
IF s_nRow < 2
|
||||
s_nRow := 2
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
ENDIF
|
||||
|
||||
END SEQUENCE
|
||||
|
||||
oHRB := NIL
|
||||
ENDSEQUENCE
|
||||
|
||||
__MVSETBASE()
|
||||
|
||||
@@ -296,31 +290,6 @@ RETURN
|
||||
|
||||
/* ********************************************************************** */
|
||||
|
||||
CREATE CLASS hrbHolder STATIC
|
||||
VAR pHRB
|
||||
METHOD init( cHRB )
|
||||
METHOD do()
|
||||
DESTRUCTOR hrbDestruct
|
||||
ENDCLASS
|
||||
|
||||
METHOD init( cHRB )
|
||||
::pHRB := __hrbLoad( cHRB )
|
||||
RETURN Self
|
||||
|
||||
METHOD do()
|
||||
IF ::pHRB != NIL
|
||||
RETURN __hrbDo( ::pHRB )
|
||||
ENDIF
|
||||
RETURN NIL
|
||||
|
||||
METHOD PROCEDURE hrbDestruct
|
||||
IF ::pHRB != NIL
|
||||
__hrbUnLoad( ::pHRB )
|
||||
ENDIF
|
||||
RETURN
|
||||
|
||||
/* ********************************************************************** */
|
||||
|
||||
/* request for full screen GT driver */
|
||||
#if defined( __PLATFORM__WINCE )
|
||||
REQUEST HB_GT_WVT_DEFAULT
|
||||
|
||||
Reference in New Issue
Block a user