Files
harbour-core/harbour/utils/hbmk2/examples/plug_tpl.hbs
Viktor Szakats d87556957e 2010-07-04 15:46 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* COPYING
  * utils/hbmk2/examples/plug_tpl.hbs
  * contrib/hbqt/hbmk2_plugin_qt.hbs
    + Changed to use same license as hbmk2 (pure GPL) 
      also for hbmk2 plugin scripts.

  * utils/hbmk2/hbmk2.prg
    ! Corrected to display any type of return value coming from 
      plugins. (all non-empty return value is considered an error)
s
2010-07-04 13:47:00 +00:00

56 lines
1.5 KiB
Handlebars

/*
* $Id$
*/
/*
* hbmk2 plugin example
*
* Copyright 2010 Viktor Szakats (harbour.01 syenar.hu)
* www - http://harbour-project.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA (or visit
* their web site at http://www.gnu.org/).
*
*/
#pragma warninglevel=3
FUNCTION hbmk2_plugin_tpl( hbmk2 )
LOCAL tmp
IF hbmk2[ "lTRACE" ]
hbmk2_OutStd( hbmk2, "@@ Entered plugin: " + hbmk2[ "cSTATE" ] )
ENDIF
SWITCH hbmk2[ "cSTATE" ]
CASE "pre_all"
FOR EACH tmp IN hbmk2[ "params" ]
hbmk2_OutStd( hbmk2, hb_StrFormat( "Parameter #%1$s: '%2$s'", hb_ntos( tmp:__enumIndex() ), tmp ) )
NEXT
EXIT
CASE "pre_c"
hbmk2[ "vars" ][ "MyVar" ] := "Hello world!"
EXIT
CASE "post_all"
hbmk2_OutStd( hbmk2, "POST_ALL: " + hbmk2[ "vars" ][ "MyVar" ] )
EXIT
ENDSWITCH
RETURN NIL