Harbour Differences

Differences between Harbour and other compatible compilers ( xHarbour, Clipper, xBase++, CLIP, FlagShip )

 

Compile time support for merging multiple .prg modules
New language statements
FOR EACH
WITH OBJECT / END[WITH]
SWITCH / [ CASE / [EXIT] / … ] OTHERWISE / END[SWITCH]
BEGIN SEQUENCE [ WITH <ERRBLOCK> ] … END SEQUENCE
Extended codeblocks
Hash arrays
References to variables stored in arrays
Passing array and hash items by reference
Passing object variables by reference
Detached locals and references
Declaration and initialization of variables
Functions with variable number of parameters
Hb_ArrayToParams() function
Macros with declared symbols
Macro messages
Multivalue macros
Using [] operator for string items
Negative indexes in [] operator used to access items from tail
Using one character length string as numeric value
New bit operators
IN, HAS, LIKE operators
Pre/post incrementation/decrementation and <op>= operators
Global / global external (global_extern)
DATETIME/TIMESTAMP values
Literal date and TIMESTAMP values
Extended literal string in compiler and macrocompiler
Symbol items and function references
OOP scopes
OOP and multiinheritance
OOP and private/hidden datas
OOP and class object/class messages
Typed object variables
Object destructors
Scalar classes
Runtime class modification
Array and string preallocation
DIVERT statement
Namespaces
Multi window GTs and runtime GT switching
Multi thread support
Thread local work areas and concurrent work area access
Harbour tasks and MT support in DOS
Background task
Codeblock serialization / deserialization
Native RDDs
Regular expressions
INET sockets
I18N (internationalization) support
ZLIB (compression/decompression)
Serial port support
Macro compiler
Compiler library
PP library
Lexer
Contrib libraries
Portability
C level compatibility
HBRUN / XBSCRIPT
HBMK2
Performance and resource usage

This list borrowed from Harbour github documentation; please look at there for details.

 

SP_SLS_BQUERY

SLS_BQUERY()

  Short:
  ------
 SLS_BQUERY() Sets SuperLib global query block

 Returns
 <bSetting> => Current value of the setting

 Syntax
 SLS_BQUERY([bNew])

 Function                   Setting                     Default
 --------------------------------------------------------------
 SLS_BQUERY([bNew])         Query codeblock            {||.t.}
                            set by QUERY()

 [bNew] sets the setting to a new setting
 If [bNew] is passed, the setting is changed and the
 new setting is returned.

 THIS IS MAINLY FOR INTERNAL USE BY SUPERLIB

 Examples

  SLS_BQUERY({||"R"$lname})

 Source: S_GLOBAL.PRG

 

SP_SLOTUSMENU

SLOTUSMENU()

  Short:
  ------
  SLOTUSMENU() 1-2-3 style menu

  Returns:
  --------
  <expReturn> => depends on several factors

  Syntax:
  -------
  SLOTUSMENU(nTop,nLeft,nBottom,nRight,aOptions,[lBox],;
        [lSaveRest],[lReset])

  Description:
  ------------
  Draws a 1-2-3 style menu from <nTop>,<nLeft> to
  <nTop+1>,<nRight>.

  <nTop> is the menu option line. <nTop+1> is the
  message line.

  <aOptions> is an array of arrays in the format:

  {  {cOption,cMessage,expAction},
  {cOption,cMessage,expAction},... }

  where <cOption> is the option prompt, <cMessage> is
  the option message, and <expAction> is the option action.

  <expAction> may be of three types:

      1.    a codeblock, in which case it is executed on
            ENTER

      2.    a submenu array of the form:

         {  {cOption,cMessage,expAction},  ;
             {cOption,cMessage,expAction},... }
            which is displayed on ENTER. Pressing ESCAPE
            from the submenu returns to the prior menu.

            The submenu <expaction> may be a codeblock,
            another subarray, or any other value, etc.
            Thus nesting can go as deep as you like.

      3.    any other value, which is returned to the
            calling program on ENTER.

  Pressing ESCAPE from the main menu returns 0

  [lBox]  If True, the menu is drawn inside of a popup
  box. Actual dimensions of the menu area then become
  <nTop>+1,<nLeft>+1 to <nTop>+2,<nRight>-1. Default is False - no box.

  [lSaveRest] If True, the underlying screen is saved
  and restored on entrance/exit. Default is False - no restore.

  [lReset] If True, the menu is reset to first option
  on exit. Default is False - menu remembers where it was.

  SLOTUSCLEAR() resets the menu.

  Examples:
  ---------

   proc test
   local nReturn := 0
   local aMain := {}
   local aSub1 := {{"Pizza",     "Eat Pizza", {||pizza()}},;
                   {"Spaghetti", "Eat Spaghetti", {||spagett()}},;
                   {"Tortellini","Eat Tortellini", {||tortellini()}} }

   local aSub2 := {{"Steak",     "Eat Steak", {||steak()}},;
                   {"Hamburger", "Eat Hamburger",  {||burgers()}},;
                   {"Chili Dog", "Eat Chili Dog",  {||burntwice()}}  }

   aadd(aMain,{"Italian","Eat Italian food",aSub1})
   aadd(aMain,{"American","Eat American food",aSub2})
   aadd(aMain,{"Quit","Just not hungry - Quit",0})
   aadd(aMain,{"Relief","Already ate - need Alka Seltzer",{||alka()} })

   SLOTUSMENU(0,0,0,79,aMain,.t.,.t.,.t.)

   SLOTUSCLEAR()  // !! always use this to clear the menu

  Notes:
  -------

  Always use SLOTUSCLEAR() after calling SLOTUSMENU()

  Source:
  -------
  S_LOTMEN.PRG

 

SP_SACHOICE

SACHOICE()

  Short:
  ------
  SACHOICE() Achoice replacement, uses TBROWSE, codeblock

  Returns:
  --------
  <nSelection> => selection, 0 if none

  Syntax:
  -------
  SACHOICE(nTop,nLeft,nBottom,nRight,aOptions,[bKeyBlock],[nStart],[@nRow],;
           [nMRow, nMCol],[bMouse])

  Description:
  ------------
  This semi-replaces ACHOICE() by using TBROWSE
  instead, and by accepting an exception codeblock instead of a user
  defined function.

  <nTop,nLeft,nBottom,nRight> are the dimensions.

  <aOptions> is the array. It need not be of type
  Character.

  First-letter presses go to the next matching letter
  of the next character-type element.
  Up/down/home/end/pageup/pagedown are used to position the
  cursor. ENTER returns the current selection. Escape returns 0.

  The screen is not saved and restored. This is a
  building block function, like ACHOICE(), so save and restore the
  screen, draw a box around it, etc, as you would ACHOICE().

  [bKeyBlock] a codeblock which will be executed if an
  exception key is received (any key not otherwise meaningful). The
  codeblock will be evaluated and will be passed:

           1. current element #
           2. exception key value
           3. the tbrowse object

  as parameters.

  [nStart] is an optional starting element. Default is 1.
  [@nRow] is an optional starting row. Default is 1. Pass by reference
  to retain value between calls.

  [nMRow, nMCol]  (new in 3.5) Directs sachoice() to draw
  the "[.][.]" for mouse up/down at nMrow, nMCol, and to be aware of mouse
  clicks on these buttons. (the screen under the arrows is saved/restored)

  [bMouse] is a codeblock to evaluate mouse clicks other than those
  meaningful to sachoice(). The codeblock is evaluated as follows:
            eval(bMouse,mouserow, mousecolumn)

  Examples:
  ---------
   USE CUSTOMER

   aFlds       := afieldsx()
   bExcept     := {|e,k|msg("You pressed ",str(k))}
   ?SACHOICE(10,10,20,12,aFlds,bExcept)

   //to retain element and position between calls
   nSelect := 1
   nRow    := 1
   aMeals   := {"Pizza","Chicken","Chinese"}
   while nSelect > 0
     nSelect  := sachoice(10,10,20,20,aMeals,nil,nSelect,@nRow)
     // code
   endif

  Notes:
  -------
  This will be a lot easier to mouse-ize than ACHOICE.
  (or is that RAT-ify..)

  Source:
  -------
  S_ACHOI.PRG

 

SP_RESTSETKEYS

RESTSETKEYS()

  Short:
  ------
  RESTSETKEYS() Restores  set keys saved with SAVESETKEYS()

  Returns:
  --------
  Nil

  Syntax:
  -------
  RESTSETKEYS(aSaved)

  Description:
  ------------
  SAVESETKEYS() saves the inkey codes and codeblocks
  associated with all active setkeys to an array. RESTSETKEYS()
  takes the saved array and restores the setkeys back.

  Examples:
  ---------
   aSaved := SAVESETKEYS(.t.)

   * do stuff

   RESTSETKEYS(aSaved)

  Source:
  -------
  S_SETKEY.PRG

See also : SAVESETKEYS()

 

 

SP_RAT_MENU2

RAT_MENU2()

  Short:
  ------
  RAT_MENU2() Mouseable MENU TO emulation

  Returns:
  --------
  <nSelected> => selected menu option, 0 for none

  Syntax:
  -------
  RAT_MENU2(aOptions,[nStart],[lImmediate],[bMouse])

  Description:
  ------------
  You must pass an array of arrays, with each element
  being an array in the form {nRow,nColumn,cPrompt} which
  correspond to      [ @nRow,nCol PROMPT cPrompt. ]

  [nStart] is an optional starting prompt, with the
  default being 1

  [lImmediate] refers to the action taken when a first
  letter or a mouse click changes options. The default is to have
  immediate action - select and return. By passing False, it
  becomes a 2 step  process, requiring click-click or
  firstletter-firstletter to select and return.

  [bMouse] is an optional codeblock for mouse clicks. If the
  mouse click does not satisfy RAT_MENU2(), and there is a
  [bMouse] codeblock, it will be evaluated as follows:

               eval(bMouse,mouserow, mousecol)

  Examples:
  ---------
   local aOptions := { ;
                      {23,2 ,  'Add'},;
                      {23,9 ,  'Open'},;
                      {23,17 , 'Delete'},;
                      {23,27 , 'Change Date'},;
                      {23,42 , 'Output list'},;
                      {23,57 , 'Purge '},;
                      {23,74 , 'Quit'}}

   nSelected := RAT_MENU2(aOptions,4,.f.,{|r,c| checkmouse(r,c) })

  Source:
  -------
  S_RMENU2.PRG

See Also : RAT_ELBHD(), RAT_EQMCOL(), RAT_EQMROW(), RAT_ERBHD(), RAT_EVENT(), 
           RAT_ISMOUSE(), RAT_LASTEV(), RAT_READ()