To Antonio - hb_HrbRun()

To Antonio - hb_HrbRun()

Postby Rimantas » Sun Feb 05, 2012 8: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: Select all  Expand view

#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.
User avatar
Rimantas
 
Posts: 437
Joined: Fri Oct 07, 2005 12:56 pm
Location: Utena , Lithuania

Re: To Antonio - hb_HrbRun()

Postby Antonio Linares » Mon Feb 06, 2012 1:30 am

In your code add:

REQUEST XBROWSENEW
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41406
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: To Antonio - hb_HrbRun()

Postby Rimantas » Thu Feb 09, 2012 7: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: Select all  Expand view

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.
User avatar
Rimantas
 
Posts: 437
Joined: Fri Oct 07, 2005 12:56 pm
Location: Utena , Lithuania

Re: To Antonio - hb_HrbRun()

Postby Antonio Linares » Thu Feb 09, 2012 8: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
User avatar
Antonio Linares
Site Admin
 
Posts: 41406
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: To Antonio - hb_HrbRun()

Postby Rimantas » Wed Feb 15, 2012 7: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.
User avatar
Rimantas
 
Posts: 437
Joined: Fri Oct 07, 2005 12:56 pm
Location: Utena , Lithuania

Re: To Antonio - hb_HrbRun()

Postby Antonio Linares » 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: Select all  Expand view

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
User avatar
Antonio Linares
Site Admin
 
Posts: 41406
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: To Antonio - hb_HrbRun()

Postby Rimantas » Fri Feb 17, 2012 8: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.
User avatar
Rimantas
 
Posts: 437
Joined: Fri Oct 07, 2005 12:56 pm
Location: Utena , Lithuania


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 24 guests