FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour To Antonio - hb_HrbRun()
Posts: 437
Joined: Fri Oct 07, 2005 12:56 PM
To Antonio - hb_HrbRun()
Posted: Sun Feb 05, 2012 08:56 PM
Hi,

I wanted to did script with hb_hrbRun() , in which exist xbrowse . Sorry , but I'm getting error : "Unknow or unregistered symbol XBROWSENEW" . As I can understand , this one exist in xbrowse.ch . This include is directed in my prg file .

Prg script :
Code (fw): Select all Collapse
#include "FiveWin.ch"
#include "xbrowse.ch"

function uzsak_brw()
local oWnd, oBrw

MsgInfo( "Start of script ..." )
dBUseArea( .t., "sqlmix", "SELECT * FROM uzsakym", "uzsakym", .T., .F. )
DEFINE WINDOW oWnd MDICHILD OF WndMain() TITLE "Uzsakymai"

@ 0, 0 XBROWSE oBrw OF oWnd ALIAS "uzsakym"

oBrw:GoBottom()
oBrw:CreateFromCode()
oWnd:oClient := oBrw

ACTIVATE WINDOW oWnd ON INIT oBrw:SetFocus() VALID ( UZSAKYM->( dbclosearea() ), .t. )
return( NIL )


It not reach - MsgInfo( "Start of script ..." ) .

How to solve this problem ?

With best regards !
Rimantas U.
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: To Antonio - hb_HrbRun()
Posted: Mon Feb 06, 2012 01:30 AM

In your code add:

REQUEST XBROWSENEW

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 437
Joined: Fri Oct 07, 2005 12:56 PM
Re: To Antonio - hb_HrbRun()
Posted: Thu Feb 09, 2012 07:36 PM
Antonio Linares wrote:In your code add:

REQUEST XBROWSENEW


Thanks ! That worked ! :-)

Antonio , can you advise to mine with another question ? viewtopic.php?f=3&t=23402 .

I did some search and found that :

Code (fw): Select all Collapse
proc main
   local CONTENT, HANDLE_HRB, PRG, HRBCODE
   PRG := ;
      "proc p()" + EOL + ;
      "   ? 'Hello World'" + EOL + ;
      "   alert( 'Hello World' )" + EOL + ;
      "return"
   HRBCODE := hb_compileFromBuf( PRG, "harbour", "-n", "-w3", "-es2", "-q0" )
   memowrit( "myhrb.hrb", sx_encrypt( HRBCODE, "myPaswdKey" ) )

   CONTENT := sx_decrypt( memoread( "myhrb.hrb" ), "myPaswdKey" )
   HANDLE_HRB := hb_hrbload( CONTENT )
   hb_hrbDo( HANDLE_HRB )
   hb_hrbunload( HANDLE_HRB )
   WAIT
return


Which version is better of running and manage scripts ? In mine question or in this sample ? Or other way ? I have in mind and first question - maybe scripts are doing some memory leaks ?

Many thanks in advance ! With best regards !
Rimantas U.
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: To Antonio - hb_HrbRun()
Posted: Thu Feb 09, 2012 08:19 PM

Rimantas,

This seems to be missing in your code:

hb_hrbunload( HANDLE_HRB ) // oRun for you

Try it :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 437
Joined: Fri Oct 07, 2005 12:56 PM
Re: To Antonio - hb_HrbRun()
Posted: Wed Feb 15, 2012 07:06 PM
Antonio Linares wrote:Rimantas,
This seems to be missing in your code:
hb_hrbunload( HANDLE_HRB ) // oRun for you
Try it :-)


Hello Antonio !

I tried this and it seems that all is working OK . One moment - what is the difference between "HB_compilebuf" and "HB_compileFrombuf" ? Of course , description of harbour functions exist in sources . But in sources I can't find such too ...

With best regards !
Rimantas U.
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: To Antonio - hb_HrbRun()
Posted: Wed Feb 15, 2012 10:00 PM
Rimantas,

With HB_COMPILEFROMBUF() the source code is loaded from a variable. function HB_COMPILEBUF() get the source from a file:

Code (fw): Select all Collapse
HB_FUNC( HB_COMPILEFROMBUF )
{
   ...
   const char * szSource;
   ...

   szSource = hb_parc( 1 );
   if( szSource )
   ...

http://harbour-project.svn.sourceforge.net/viewvc/harbour-project/trunk/harbour/src/compiler/hbcmplib.c?revision=17084&view=markup
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 437
Joined: Fri Oct 07, 2005 12:56 PM
Re: To Antonio - hb_HrbRun()
Posted: Fri Feb 17, 2012 08:35 AM
Antonio Linares wrote:Rimantas,

With HB_COMPILEFROMBUF() the source code is loaded from a variable. function HB_COMPILEBUF() get the source from a file:



Thanks , Antonio ! :-)

With best regards !
Rimantas U.

Continue the discussion