From 8aca0ed0f6c1a0af63e553b8de72d4950a80a51f Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Tue, 5 Aug 2008 00:43:40 +0000 Subject: [PATCH] 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 --- harbour/ChangeLog | 10 ++++++ harbour/doc/man/hbdot.1 | 16 ++++++--- harbour/utils/hbdot/hbdot.prg | 63 +++++++++-------------------------- 3 files changed, 37 insertions(+), 52 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 667c6c5305..974b411a05 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,16 @@ 2008-12-31 13:59 UTC+0100 Foo Bar */ +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 diff --git a/harbour/doc/man/hbdot.1 b/harbour/doc/man/hbdot.1 index 94a87dacf1..4da8ea52c5 100644 --- a/harbour/doc/man/hbdot.1 +++ b/harbour/doc/man/hbdot.1 @@ -4,13 +4,16 @@ hbdot \- "DOt Prompt" Console for the Harbour Language .SH SYNOPSIS -\fBhbdot\fP \fB[\fP \fB[]]\fP +\fBhbdot\fP \fB[\fP \fB[]]\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\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\fP are passed to -startup function in executed code coming from \fB\fP. +.IP "\fB-h, -?, --help\fP" 10 +When given as first parameter display help +.PP +This program has no other options. \fB\fP are passed to +startup function in executed code coming from \fB\fP. .SH AUTHOR diff --git a/harbour/utils/hbdot/hbdot.prg b/harbour/utils/hbdot/hbdot.prg index cafe7a3098..f7cefc7734 100644 --- a/harbour/utils/hbdot/hbdot.prg +++ b/harbour/utils/hbdot/hbdot.prg @@ -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 [ []]' + HB_OSNewLine() + ; + 'Syntax: hbdot [ []]' + 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