Scripting

Scripting

Postby MdaSolution » Wed Jul 28, 2010 11:01 pm

I need to load a prg and run it from an exe

I try with Antonio samples on this forum and also with Runscript function but it not run well ( on the runscript there are some function I not found it )

MENUITEM "Load a prg file" ACTION ( cPrg:=cGetFile( "*.prg","Select a prg ", 1, , .t. ),::RunScrpt( cPrg, cParams, nWd ) )

METHOD RunScrpt( cPrg, cParams, nWd ) CLASS XXXXX
local lRet := .t.
local oRun
local cTxtFile, cLine, nFrom := 1
local cPrgs := "Prgs\"
if File( cPrgs + cPrg + ".prg" )
TRY
if File( "comp.log" )
ferase( "comp.log" )
endif
FReOpen_Stderr( "comp.log", "w" )
oRun := HB_compilebuf( HB_ARGV( 0 ), cPrgs + cPrg + ".prg", "-n", "'-Ic:\work\fwh\include'" )
cTxtFile = MemoRead( "comp.log" )
while nFrom < Len( cTxtFile )
cLine = ExtractLine( cTxtFile, @nFrom )
SysRefresh()
if Upper( StrToken( cLine, 2 ) ) == "ERROR"
lRet := .f.
exit
endif
enddo
if !lRet
MsgInfo( MemoRead( "comp.log" ) )
else
hb_HrbRun( oRun )
endif
CATCH e
lRet := .f.
END
else
MsgInfo( "Can't to find file - " + cPrg + ".prg ...", 2 )
lRet := .f.
endif
return( lRet )


on bold the function I not founded, please help me !!!
FWH .. BC582.. xharbour
User avatar
MdaSolution
 
Posts: 401
Joined: Tue Jan 05, 2010 2:33 pm

Return to FiveWin for Harbour/xHarbour

Who is online

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