Page 2 of 2
Re: Again about scripting ... HB_CompileBuf
Posted: Tue Mar 12, 2013 8:05 pm
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 ...
Re: Again about scripting ... HB_CompileBuf
Posted: Tue Mar 12, 2013 9:07 pm
by Antonio Linares
In buildg.bat there are only two places where gcc is called. Those flags should be provided there.
Re: Again about scripting ... HB_CompileBuf
Posted: Wed Mar 13, 2013 12:40 am
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
Re: Again about scripting ... HB_CompileBuf
Posted: Wed Mar 13, 2013 5:51 am
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 ...
Re: Again about scripting ... HB_CompileBuf
Posted: Wed Mar 13, 2013 6:01 am
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
Re: Again about scripting ... HB_CompileBuf
Posted: Wed Mar 13, 2013 12:45 pm
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 | Expand
#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 | Expand
#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 !
Re: Again about scripting ... HB_CompileBuf
Posted: Wed Mar 13, 2013 12:51 pm
by Antonio Linares
Rimantas,
windows are non modal, thats why they don't work
The execution continues and the script ends
Re: Again about scripting ... HB_CompileBuf
Posted: Wed Mar 13, 2013 1:57 pm
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 ?
Re: Again about scripting ... HB_CompileBuf
Posted: Wed Mar 13, 2013 3:18 pm
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.
Re: Again about scripting ... HB_CompileBuf
Posted: Wed Mar 13, 2013 4:18 pm
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 !
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 !
Re: Again about scripting ... HB_CompileBuf
Posted: Wed Mar 13, 2013 4:22 pm
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
Re: Again about scripting ... HB_CompileBuf
Posted: Wed Mar 13, 2013 4:49 pm
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 .
Re: Again about scripting ... HB_CompileBuf
Posted: Wed Mar 13, 2013 6:06 pm
by Antonio Linares
There should be no problems using that function.
The FWH print preview uses it
Re: Again about scripting ... HB_CompileBuf
Posted: Wed Mar 13, 2013 6:20 pm
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 !