Again about scripting ... HB_CompileBuf

User avatar
Rimantas
Posts: 437
Joined: Fri Oct 07, 2005 12:56 pm
Location: Utena , Lithuania

Re: Again about scripting ... HB_CompileBuf

Post by Rimantas »

Antonio Linares wrote:
All this outside functions ( mod_pas, newRec, delRec and excRec ) are "Undefined ..."
Have you declared them as extern ?
After this you sugestion I tried that :

#include "fivewin.ch"
#include "xbrowse.ch"
#include "tdolphin.ch"
#include "dtpicker.ch"

external mod_pas
external newRec
external delRec
external excRec

FUNCTION uzsak()
...

Sorry , the same result ...

Antonio , can you direct where I can insert direction for minGw build ( \samples\buildg.bat ) ? Daniels TDolphin require that setting : -ldflag=-Wl,--allow-multiple-definition . I'll try that with your buildg.bat and only needs to add dolphins libs . It will be clear if this is a problem of settings for build ...
Rimantas U.
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Again about scripting ... HB_CompileBuf

Post by Antonio Linares »

In buildg.bat there are only two places where gcc is called. Those flags should be provided there.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Daniel Garcia-Gil
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita
Contact:

Re: Again about scripting ... HB_CompileBuf

Post by Daniel Garcia-Gil »

Antonio Linares wrote:Rimantas,
Please ty to provide me a simple example like this one that reproduces your error, thanks
+1

you could use a tdolphin server to make a sample that we can build
our best documentation is the source code
Isla de Margarita Venezuela.
danielgarciagil@gmail.com
http://tdolphin.blogspot.com/
https://www.dropbox.com/referrals/NTI5N ... rc=global9
User avatar
Rimantas
Posts: 437
Joined: Fri Oct 07, 2005 12:56 pm
Location: Utena , Lithuania

Re: Again about scripting ... HB_CompileBuf

Post by Rimantas »

Antonio Linares wrote:In buildg.bat there are only two places where gcc is called. Those flags should be provided there.
Antonio, excuse , but can you simple to point where I can to add this and how ? Yes, gcc is in 2 lines ( with or without .rc ) . At this moment I don't know how to let gcc listen to this commands . .hbp contains like that :
-ldflag=-Wl,--allow-multiple-definition .

Buildg.bat
if not exist %1.rc %mingw%\bin\gcc -o%1.exe %1.o -ldflag=-Wl --allow-multiple-definition -Wall -s -mwindows -L%mingw%\lib -L%hlibs% -L%fwh%\lib -mno-cygwin -Wl,--start-group -lfivehg -lfivehgc -llibmysqlm -ldolphin -lgtgui -luser32 -lwinspool -lkernel32 -lcomctl32 -lcomdlg32 -lgdi32 -lgdiplus -lole32 -loleaut32 -lpsapi -loledlg -lmfcuia32 -lmsimg32 -lwin32k -lstdc++ -lversion -luuid -lwinmm -lvfw32 -lwsock32 -lhbcommon -lhbcpage -lhbcplr -lhbct -lhbhsx -lhblang -lhbmacro -lhbmainstd -lhbmzip -lodbc32 -lhbpcre -lhbpp -lhbrdd -lhbrtl -lhbsix -lhbsqlit3 -lhbtip -lhbusrrdd -lhbvm -lhbwin -lhbzlib -lrddcdx -lrddfpt -lrddntx -lxhb -lpng -Wl,--end-group

then I get an error : unrecognized option --allow-multiple-definition . If let with comma : -ldflag=-Wl,--allow-multiple-definition , then return : can't find -ldflag=-Wl,--allow-multiple-definition ... :(

ADDED : Ok, after some search found that it's need only -Wl,--allow-multiple-definition . Now it's linking ... :)
Rimantas U.
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Again about scripting ... HB_CompileBuf

Post by Antonio Linares »

Rimantas,

-Wl is already used by buildg.bat, so just need to add --allow-multiple-definition

Try this:
gcc -o%1.exe %1.o -Wall -s -mwindows -L%mingw%\lib -L%hlibs% -L%fwh%\lib -mno-cygwin -Wl --allow-multiple-definition,--start-group -lfivehg -lfivehgc -lgtgui -luser32 -lwinspool -lkernel32 -lcomctl32 -lcomdlg32 -lgdi32 -lgdiplus -lole32 -loleaut32 -lpsapi -loledlg -lmfcuia32 -lmsimg32 -lwin32k -lstdc++ -lversion -luuid -lwinmm -lvfw32 -lwsock32 -lhbcommon -lhbcpage -lhbcplr -lhbct -lhbdebug -lhbhsx -lhblang -lhbmacro -lhbmainstd -lhbmzip -lodbc32 -lhbpcre -lhbpp -lhbrdd -lhbrtl -lhbsix -lhbsqlit3 -lhbtip -lhbusrrdd -lhbvm -lhbwin -lhbzlib -lrddcdx -lrddfpt -lrddntx -lxhb -lpng -Wl,--end-group
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Rimantas
Posts: 437
Joined: Fri Oct 07, 2005 12:56 pm
Location: Utena , Lithuania

Re: Again about scripting ... HB_CompileBuf

Post by Rimantas »

Antonio , after some search at last I can say some results . Some functions inside one scripts can work if script have only function or dialog . This will not work if script main control will be WINDOW ...

This code works fine :

Code: Select all

#include "FiveWin.ch"
function dlg()
   local oDlg
   Secnd()
   DEFINE DIALOG oDlg TITLE "A dialog" ;
      GRADIENT { { 1, CLR_BLUE, RGB( 120, 100, 200 ) } } ;
      SIZE 500, 300
   @ 7, 18 BTNBMP PROMPT "Ok" SIZE 40, 15 ACTION ( Secnd(), oDlg:End() ) 2007
   ACTIVATE DIALOG oDlg CENTERED
return nil

static function secnd()
MsgInfo( "Second" )
return( NIL )
 
Change some code - instead dialog -> window

Code: Select all

#include "FiveWin.ch"
function dlg()
   local oDlg
   Secnd()
   DEFINE WINDOW oDlg TITLE "A window" FROM 10, 10 TO 400, 200
   @ 7, 18 BTNBMP PROMPT "Ok" SIZE 40, 15 ACTION ( Secnd(), oDlg:End() ) 2007
   ACTIVATE WINDOW oDlg
return nil

static function secnd()
MsgInfo( "Second" )
return( NIL )
 
This alreday will return error , then you will click in button "OK" ... Note that the first time , before window , Secnd() function works . But after window , alreday no ...

So with windows scripts with some function , which call from window control , can't work ?

With best regards !
Rimantas U.
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Again about scripting ... HB_CompileBuf

Post by Antonio Linares »

Rimantas,

windows are non modal, thats why they don't work :-)

The execution continues and the script ends
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Rimantas
Posts: 437
Joined: Fri Oct 07, 2005 12:56 pm
Location: Utena , Lithuania

Re: Again about scripting ... HB_CompileBuf

Post by Rimantas »

Antonio Linares wrote:Rimantas,

windows are non modal, thats why they don't work :-)

The execution continues and the script ends
:-) ... but windows it leaves , not close ... So any solution for that not exist ?
Rimantas U.
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Again about scripting ... HB_CompileBuf

Post by Antonio Linares »

the window remains opened because it belongs to the operating system, not to the PRG :-)

Try this:

local lExit := .F.

...

ACTIVATE WINDOW oWnd

StopUntil( { || lExit } )

From the window, change lExit to .T. to finally exit.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Rimantas
Posts: 437
Joined: Fri Oct 07, 2005 12:56 pm
Location: Utena , Lithuania

Re: Again about scripting ... HB_CompileBuf

Post by Rimantas »

Antonio Linares wrote:the window remains opened because it belongs to the operating system, not to the PRG :-)

Try this:

local lExit := .F.
...
ACTIVATE WINDOW oWnd
StopUntil( { || lExit } )

From the window, change lExit to .T. to finally exit.
Wwoooowwww ! And that is working ! :D Very fine ! So all power of script we can use now with that . Just to ensure - this StopUntil - do not have any hiden surprises ( mem consump as for sample ) ?

Thanks for solution ! :)
Rimantas U.
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Again about scripting ... HB_CompileBuf

Post by Antonio Linares »

Rimantas,

Do you think that I would advise a solution with "hiden surprises" ?

I think I talk very clear always, and if there is a problem, I always warn about it. Lots of users trust me for so many years, and surely is because I have proved to be serious and professional
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Rimantas
Posts: 437
Joined: Fri Oct 07, 2005 12:56 pm
Location: Utena , Lithuania

Re: Again about scripting ... HB_CompileBuf

Post by Rimantas »

Antonio Linares wrote:Rimantas,

Do you think that I would advise a solution with "hiden surprises" ?

I think I talk very clear always, and if there is a problem, I always warn about it. Lots of users trust me for so many years, and surely is because I have proved to be serious and professional
Excuse me , Antonio . I don't have that in mind . Simply I was collided that other solutions , like StopUntil in this situation , are working in other manier - loops and etc and it was eating mem . But that in earliers clipper + vb times . Excuse me if I insulted you . I'm not in doubt about you , that is true .
Rimantas U.
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Again about scripting ... HB_CompileBuf

Post by Antonio Linares »

There should be no problems using that function.

The FWH print preview uses it :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Rimantas
Posts: 437
Joined: Fri Oct 07, 2005 12:56 pm
Location: Utena , Lithuania

Re: Again about scripting ... HB_CompileBuf

Post by Rimantas »

Antonio Linares wrote:There should be no problems using that function.

The FWH print preview uses it :-)
Thank you Antonio ! Now scripts have a full power with that . It's very fine . I can to plan to build core exe , menus with directions prgs . It's really fine !
Rimantas U.
Post Reply