From 054dc4ed08feaf84caaf14742d3b3fc319c32f84 Mon Sep 17 00:00:00 2001 From: Ron Pinkas Date: Tue, 7 Aug 2001 08:11:51 +0000 Subject: [PATCH] 2001-08-07 01:10 UTC-0800 Ron Pinkas + doc/en/clipper.txt + New file describing Harbour features that are different from Clipper. * include/hbpcode.h * Corrected typo in comment /* Thanks to Dave for info. */ --- harbour/ChangeLog | 7 +++++ harbour/doc/en/clipper.txt | 58 ++++++++++++++++++++++++++++++++++++++ harbour/include/hbpcode.h | 4 +-- 3 files changed, 67 insertions(+), 2 deletions(-) create mode 100644 harbour/doc/en/clipper.txt diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 14004163c4..b1a421224e 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,10 @@ +2001-08-07 01:10 UTC-0800 Ron Pinkas + + doc/en/clipper.txt + + New file describing Harbour features that are different from Clipper. + + * include/hbpcode.h + * Corrected typo in comment /* Thanks to Dave for info. */ + 2001-08-06 23:50 UTC-0800 Ron Pinkas * source/compiler/harbour.c ! Corrected assigment of HB_FS_FIRST scope, for proper execution of first non INIT/EXIT procedure in main module. diff --git a/harbour/doc/en/clipper.txt b/harbour/doc/en/clipper.txt new file mode 100644 index 0000000000..c24889de94 --- /dev/null +++ b/harbour/doc/en/clipper.txt @@ -0,0 +1,58 @@ +This document attempts to describes the features separating Harbour +from Clipper. + +/* TODO: @FunPointer(), and all other Harbour extensions. */ + +Harbour Macro Compiler +---------------------- +The Harbour Macro Compiler offers 2 additional layers of functionality +controlled by means of HB_SETMACRO()* function, not available in Clipper. + +HB_SETMACRO( HB_SM_HARBOUR, TRUE ) will enable macro compilation and +evaluation of complex expressions not supported by Clipper like: + + - exp++, exp--, exp += exp, (exp), etc.. + - Nested codeblocks. + - Expressions longer then 254 characters. + +HB_SETMACRO( HB_SM_XBASE, TRUE ) will enable macro compilation and +evaluation of comma separated lists in all contexts where lists are +acceptable by Clipper*, including: + + - { &cMacro } // Literal array elements list. + - SomeArray[ &cMacro ] // Array index list. + - SomeFun( &cMacro ) // Arguments list. + - ( &cMacro ) // parenthesized list expression. + +*Clipper only supports list macros within codeblocks context. + +Both these extra layers are activated by default. + +* See also -k Compiler switch. + +LIST Command +------------ + +LIST &cMacro + +LIST in clipper [superficially] supports macros of lists expressions. No +error will be produced, and all expressions in the list will be +evaluated, but *only* the *last* expression will be displayed. This is +not a documented in either the LIST or the Macro Operator, but is the +de-facto behavior in all Clipper 5.x versions. + +Harbour instead will not only evaluate all of the expressions in +such list macro, but will also display all such values. This default +behavior may be disabled with HB_SETMACRO( HB_SM_XBASE, .F. )* + +* See also -k Compiler switch. + +INIT/EXIT and startup procedures +-------------------------------- + +In Clipper the startup procedure is always the first procedure/function +of the main module, even if such symbol is an INIT or EXIT symbol. In +such case the program will never execute the "main" symbol. In Harbour +the first *non* INIT/EXIT symbol, will be executed as the main symbol +after all INIT procedures have been executed. + diff --git a/harbour/include/hbpcode.h b/harbour/include/hbpcode.h index b4db8c97c1..ab6dcdbba2 100644 --- a/harbour/include/hbpcode.h +++ b/harbour/include/hbpcode.h @@ -186,8 +186,8 @@ typedef enum HB_P_TRUE, /* 120 pushes true on the virtual machine stack */ HB_P_ZERO, /* 121 places a ZERO on the virtual machine stack */ HB_P_ONE, /* 122 places a ONE on the virtual machine stack */ - HB_P_MACROLIST, /* 122 HB_P_MACROPUSHLIST enevelope start. */ - HB_P_MACROLISTEND, /* 123 HB_P_MACROPUSHLIST enevelope end. */ + HB_P_MACROLIST, /* 122 HB_P_MACROPUSHLIST envelope start. */ + HB_P_MACROLISTEND, /* 123 HB_P_MACROPUSHLIST envelope end. */ /* NOTE: This have to be the last definition */ HB_P_LAST_PCODE /* 123 this defines the number of defined pcodes */ } HB_PCODE;