2001-06-03 23:50 UTC-0800 Ron Pinkas <ron@profit-master.com>

* contrib/dot/pp.prg
     + Added #ifdef WIN to support using Windows MessageBox() instead of Alert(), use BLD pp -dWIN to activate.
   * contrib/dot/pp_harb.ch
     + Minor revision in TInnterpreter() class.
     + Added wrapper for MessageBox()
   * contrib/dot/rp_run.ch
     + Added #ifdef #command to translate
This commit is contained in:
Ron Pinkas
2001-06-04 06:55:16 +00:00
parent 2089356692
commit 2c507cf450
4 changed files with 42 additions and 6 deletions

View File

@@ -1,3 +1,12 @@
2001-06-03 23:50 UTC-0800 Ron Pinkas <ron@profit-master.com>
* contrib/dot/pp.prg
+ Added #ifdef WIN to support using Windows MessageBox() instead of Alert(), use BLD pp -dWIN to activate.
* contrib/dot/pp_harb.ch
+ Minor revision in TInnterpreter() class.
+ Added wrapper for MessageBox()
* contrib/dot/rp_run.ch
+ Added #ifdef #command to translate
2001-06-03 09:35 UTC+1 JFL (mafact) <jfl@mafact.com>
* harbour/source/vm/Classe.c
* Temporary disabled scoping for rel. 0.37 !

View File

@@ -29,6 +29,11 @@
#DEFINE CRLF HB_OsNewLine()
#ifdef FW
#INCLUDE "fwextern.ch"
#else
#ifdef WIN
#COMMAND Alert( <x> ) => MessageBox( 0, xToStr( <x> ), "PP for Windows", 0 )
EXTERN MessageBox
#endif
#endif
#else
#DEFINE __CLIPPER__
@@ -571,6 +576,9 @@ PROCEDURE RP_Dot()
bCount := .F.
PP_PreProFile( "rp_dot.ch" )
#ifdef WIN
PP_PreProLine( '#COMMAND Alert( <x> ) => MessageBox( 0, xToStr( <x> ), "TInterpreter for Windows", 0 )' )
#endif
ErrorBlock( {|oErr| RP_Dot_Err( oErr ) } )
@@ -2513,7 +2521,7 @@ FUNCTION PP_PreProFile( sSource, sPPOExt, bBlanks )
ENDIF
ENDIF
IF ProcName(1) == 'MAIN'
IF ProcName(2) == ""
FClose( hPP )
IF bCCH
@@ -7575,6 +7583,9 @@ STATIC FUNCTION InitRunRules()
aAdd( aTransRules, { 'PROCLINE' , { { 0, 0, '(', NIL, NIL }, { 1, 1, NIL, '<', { ')' } }, { 0, 0, ')', NIL, NIL } } , .F. } )
/* Commands */
#ifdef WIN
aAdd( aCommRules, { 'ALERT' , { { 1, 0, '(', '<', NIL }, { 0, 0, ')', NIL, NIL } } , .F. } )
#endif
aAdd( aCommRules, { '_HB_CLASS' , { { 1, 0, NIL, '*', NIL } } , .F. } )
aAdd( aCommRules, { '_HB_MEMBER' , { { 1, 0, NIL, '*', NIL } } , .F. } )
aAdd( aCommRules, { 'MEMVAR' , { { 1, 0, NIL, '*', NIL } } , .F. } )
@@ -7635,6 +7646,9 @@ STATIC FUNCTION InitRunResults()
aAdd( aTransResults, { { { 0, 'PP_ProcLine( ' }, { 0, 1 }, { 0, ' )' } }, { -1, 1, -1} , { NIL } } )
/* Commands Results*/
#ifdef WIN
aAdd( aCommResults, { { { 0, 'MessageBox( 0, xToStr( ' }, { 0, 1 }, { 0, ' ), "TInterpreter for Windows", 0 )' } }, { -1, 1, -1} , { NIL } } )
#endif
aAdd( aCommResults, { , , { NIL } } )
aAdd( aCommResults, { , , { NIL } } )
aAdd( aCommResults, { , , { NIL } } )

View File

@@ -8,6 +8,7 @@ CLASS TInterpreter
DATA cText
DATA acPPed
DATA cPPed
DATA aCompiledProcs
DATA aInitExit
DATA nProcs
@@ -16,6 +17,7 @@ CLASS TInterpreter
METHOD AddLine( cLine ) INLINE ( ::nProcs := 0, ::acPPed := {}, ::cText += ( cLine + Chr(10) ) )
METHOD SetScript( cText ) INLINE ( ::nProcs := 0, ::acPPed := {}, ::cText := cText )
METHOD GetPPO() INLINE ( ::cPPed )
METHOD Compile()
METHOD Run()
@@ -48,7 +50,7 @@ METHOD Compile()
IF Len( ::acPPed ) == 0
PP_InitStd()
PP_LoadRun()
PP_PreProText( ::cText, ::acPPed )
::cPPed := PP_PreProText( ::cText, ::acPPed )
::aCompiledProcs := {}
::aInitExit := { {}, {} }
ENDIF
@@ -136,7 +138,7 @@ static HB_FUNC( NEXTTOKEN )
s2[0] = sLine[0];
s2[1] = sLine[1];
if( strstr( "++\--\->\:=\==\!=\<>\>=\<=\+=\-=\*=\^=\**\/=\%=\??", (char*) s2 ) )
if( strstr( "++\\--\\->\\:=\\==\\!=\\<>\\>=\\<=\\+=\\-=\\*=\\^=\\**\\/=\\%=\\??", (char*) s2 ) )
{
sReturn[0] = s2[0];
sReturn[1] = s2[1];
@@ -363,7 +365,7 @@ static HB_FUNC( NEXTTOKEN )
goto Done;
}
else if ( strchr( "+-*/:=^!&()[]{}@,|<>#%?$", sLine[0] ) )
else if ( strchr( "+-*/:=^!&()[]{}@,|<>#%?$~", sLine[0] ) )
{
sReturn[0] = sLine[0];
sReturn[1] = '\0';
@@ -526,7 +528,7 @@ static HB_FUNC( NEXTIDENTIFIER )
}
else
{
char *sSkipped = hb_xgrab( nStart + 1 );
char *sSkipped = (char *) hb_xgrab( nStart + 1 );
strncpy( sSkipped, sLine, nStart );
sSkipped[nStart]= '\0';
@@ -538,7 +540,7 @@ static HB_FUNC( NEXTIDENTIFIER )
if( nStart >= 0 )
{
char *sIdentifier = hb_xgrab( ( nAt - nStart ) + 1 );
char *sIdentifier = (char *) hb_xgrab( ( nAt - nStart ) + 1 );
strncpy( sIdentifier, sLine + nStart, ( nAt - nStart ) );
sIdentifier[nAt - nStart] = '\0';
@@ -565,6 +567,14 @@ static HB_FUNC( NEXTIDENTIFIER )
}
}
//----------------------------------------------------------------------------//
#include <Windows.h>
HB_FUNC( MESSAGEBOX )
{
hb_retni( MessageBox( ( HWND ) hb_parnl( 1 ), hb_parc( 2 ), hb_parc( 3 ), hb_parni( 4 ) ) );
}
#pragma STOPDUMP
STATIC FUNCTION InitFWRules()

View File

@@ -1,4 +1,7 @@
#ifdef __HARBOUR__
#ifdef WIN
#COMMAND Alert( <x> ) => MessageBox( 0, xToStr( <x> ), "TInterpreter for Windows", 0 )
#endif
#else
//#define __CLIPPER__
#endif