by Ramón J. » Sun May 25, 2008 8:56 am
Hola, Manuel:
No hay nada. He copiao el código de la función en un prg aparte, ya que el prg principal es muy extenso, y lo he vuelto a compilarlo. Los errores que da son los siguientes:
E:\WINCAP(CODIGO32)\menucrw.prg(31) Error E0030 Syntax error: "parse error at '@'"
E:\WINCAP(CODIGO32)\menucrw.prg(33) Error E0030 Syntax error: "parse error at '@'"
E:\WINCAP(CODIGO32)\menucrw.prg(36) Error E0030 Syntax error: "parse error at '@'"
El código completo del prg es el siguiente:
#include "FiveWin.ch"
#include "Report.ch"
#include "btnget.ch"
#include "ssay.ch"
//-------------------------------------------------
FUNCTION MenuCrw()
local oBmp
local oFont1, oFont2
LOCAL oDlg, oBtn
LOCAL lSalir := .F.
LOCAL oDlg44, cserver, PathData
local cTitle := OemToAnsi("Justificantes de cuentas")
* wInstalado := "\WINCAP\TEMP\"
PathData := "\WINCAP\TEMP\"
DEFINE BITMAP oBmp FILE "\wincap\bitmaps\just.bmp"
DEFINE FONT oFont1 NAME "Arial" SIZE 0, -13
DEFINE FONT oFont2 NAME "Arial" SIZE 0, -16
DEFINE dialog odlg FROM 1, 1 TO 300, 500 PIXEL ;
COLOR CLR_WHITE, CLR_WHITE ;
TITLE cTitle
oDlg:nStyle:=nAnd(oDlg:nStyle, nNOt(WS_SYSMENU))
@70,10 SAY " Seleccionar impresora" of oDlg SIZE 80,10 FONT oFont1 ACTION printersetup()
@90,10 SAY "Entradas" of oDLG SIZE 50,10 PIXEL FONT oFont1 action finentradas(Pathdata)
@110, 10 SAY Chr(149 )+OemToAnsi("Salidas") SIZE 50,10 PIXEL OF oDlg;
FONT oFont1 action finsalidas(Pathdata)
@ 120, 100 BUTTON OBTn PROMPT "Salir" SIZE 40,10 PIXEL OF oDlg;
FONT oFont1 ACTION (lsalir:=.t., oDlg:End())
ACTIVATE DIALOG oDlg centered;
valid lsalir;
ON PAINT ( oDlg:SayBitmap( 1, 1, ObMP) )
if lsalir
RELEASE BITMAP oBmp
RELEASE FONT oFont1, oFont2
dbCloseAll()
sysrefresh()
endif
RETURN( .T. )
function finentradas(pathdata)
local obtn1, obtn2, oFont
local odlg, ofin, dfin
dfin:=ctod(space(8))
DEFINE FONT oFont NAME "Arial" SIZE 0, -10
DEFINE DIALOG oDlg TITLE "Justificantes de cuentas. Fecha cierre";
FROM 5, 5 TO 15, 40 font oFont
@7, 10 SAY OemToAnsi("Seleccione fecha de cierre")+CRLF+;
oEmToAnsi("para emisi¢n de justicantes:") OF oDlg PIXEL
@30, 40 GET ofin VAR dfin OF oDlg SIZE 40, 10 ;
VALID ! empty(dfin) pixel
@53, 20 BTNBMP oBtn1 FILENAME "\WINCAP\BITMAPS\Btnok.bmp";
OF oDlg SIZE 30, 15;
action (lista(Pathdata, dfin), odlg:end() )
@53, 70 BTNBMP oBtn2 FILENAME "\WINCAP\BITMAPS\Btncanc.bmp";
OF oDlg SIZE 30, 15 ACTION oDlg:End()
ACTIVATE DIALOG OdLG CENTERED
obtn1:end()
obtn2:end()
oFont:end()
return nil
//-------Justificantes de salidas.
function finsalidas(pathdata)
local obtn1, obtn2, oFont
local odlg, ofin, dfin
dfin:=ctod(space(8))
DEFINE FONT oFont NAME "Arial" SIZE 0, -10
DEFINE DIALOG oDlg TITLE "Justificantes de cuentas. Fecha cierre";
FROM 5, 5 TO 15, 40 font oFont
@7, 10 SAY OemToAnsi("Seleccione fecha de cierre")+CRLF+;
oEmToAnsi("para emisi¢n de justicantes:") OF oDlg PIXEL
@30, 40 GET ofin VAR dfin OF oDlg SIZE 40, 10 ;
VALID ! empty(dfin) pixel
@53, 20 BTNBMP oBtn1 FILENAME "\WINCAP\BITMAPS\Btnok.bmp";
OF oDlg SIZE 30, 15;
action (listb(Pathdata, dfin), odlg:end() )
@53, 70 BTNBMP oBtn2 FILENAME "\WINCAP\BITMAPS\Btncanc.bmp";
OF oDlg SIZE 30, 15 ACTION oDlg:End()
ACTIVATE DIALOG OdLG CENTERED
obtn1:end()
obtn2:end()
oFont:end()
return nil
FUNCTION LISTa(PathData, dfin)
LOCAL nCont, oDbf, nsum, i, ntotal, creg, oreg
*local odlg, ofin, dfin
local name:="TEMPENT.DBF"
local cdx:="TEMPENT.cdx"
local rutadbf, rutacdx
rutadbf:=pathdata+"\"+name
rutacdx:=pathdata+"\"+cdx
MsgRun( "Por favor, espere.... Generando justificantes de entrada...")
USE \WINCAP\data\ENTRADA NEW
DATABASE ODBF
COPY TO (rutadbf)
USE (RUTAdbf) NEW
index on tempent->articulo to (rutacdx)
Use (rutadbf) NEW
While !(rutadbf)->(Eof())
nSum = recno()
(rutadbf)->(DbSkip(1))
EndDo
MsgRun("")
DbCloseall()
Use \WINCAP\TEMP\CONTROL NEW
ZAP
APPEND BLANK
REPLACE CONTROL->FECHAJUSTI WITH DFIN
Shellexecute(GetActiveWindow(), 'Open',"\WINCAP\TEMP\justenva.EXE",,,1)
DBcloseall()
sYSREFRESH()
RETURN NIL
FUNCTION LISTb(PathData, dfin)
LOCAL nCont, oDbf, nsum, i, ntotal, creg, oreg
local name:="TEMPSAL.DBF"
local cdx:="TEMPSAL.cdx"
local rutadbf, rutacdx
rutadbf:=pathdata+"\"+name
rutacdx:=pathdata+"\"+cdx
MsgRun( "Por favor, espere.... Generando justificantes de salida...")
USE \WINCAP\data\SALIDA NEW
DATABASE ODBF
COPY TO (rutadbf)
USE (RUTAdbf) NEW
index on tempsal->articulo to (rutacdx)
Use (rutadbf) NEW
While !(rutadbf)->(Eof())
nSum = recno()
(rutadbf)->(DbSkip(1))
EndDo
DbCloseall()
MsgRun("")
Use \WINCAP\TEMP\CONTROL NEW
ZAP
APPEND BLANK
REPLACE CONTROL->FECHAJUSTI WITH DFIN
Shellexecute(GetActiveWindow(), 'Open',"\WINCAP\TEMP\justsava.exe",,,1)
DBcloseall()
sYSREFRESH()
RETURN NIL
Function MsgRun( cCaption, cTitle, bAction )
*-------------------------------------------
Msg_Run( cCaption, cTitle, bAction ) // Evans' function (see below)
Return NIL
Function Msg_Run( cCaption )
*---------------------------
STATIC isOn := .F.
STATIC oDlgWt, nWidth, oFont14
if empty(cCaption)
if !empty(oDlgWt)
isOn := .T.
endif
* msginfo('cCaption is empty. Must close the box')
endif
if isOn
* msginfo('Closing the MSG_RUN')
oDlgWt:End()
oFont14:End()
isOn := .F.
sysrefresh()
Return NIL
endif
DEFAULT cCaption := "Please, wait..."
***oFont14 := TFont():New( "Courier New", 8, -12 ) // was 8, 10
DEFINE FONT oFont14 NAME "Arial" SIZE 8,-12
cCaption := Alltrim(cCaption)
DEFINE DIALOG oDlgWt ;
FROM 0,0 TO 3, Len( cCaption ) + 4 ;
STYLE nOr( DS_MODALFRAME, WS_POPUP ) ;
FONT oFont14 COLOR CLR_YELLOW, CLR_BLUE
// You can use your favorite colors here!
oDlgWt:cMsg := cCaption
nWidth := (oDlgWt:nRight - oDlgWt:nLeft)
ACTIVATE DIALOG oDlgWt CENTERED NOWAIT ;
ON INIT (isOn := .T.) ;
ON PAINT oDlgWt:Say( 1, 2.0, ( oDlgWt:cMsg ) )
syswait(.1)
Return nil