Page 1 of 1
parse error at '@' ?
Posted: Sat May 24, 2008 9:36 pm
by Ramón J.
Hola, foro:
Tras mucho tiempo alejado de esto, he retomado el tema de pasar una aplicación de 16 bits hecha con Fivewin a otra de 32 bits utilizando Fivewin Harbour, pero, de entrada, me salen una serie de errores que no acabo de entender.
Por ejemplo: al compilar el código (utilizo Verce 4.3), me sale el siguiente error:
E:\WINCAP(CODIGO32)\creandx.prg(965) Error E0030 Syntax error: "parse error at '@'"
E:\WINCAP(CODIGO32)\creandx.prg(975) Error E0030 Syntax error: "parse error at '@'"
Las líneas en cuestión son las siguientes:
@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)
¿Dónde está el fallo si con Fivewin 2.0 no me daba error?
He buscado en el foro, pero no aparece nada ( además, la página de búsqueda caduca enseguida)
FWH/FWHX 2.7 March/2006, Verce 4.3
Posted: Sun May 25, 2008 3:01 am
by Armando Picon
1) Verifica si tienes el siguiente texto:
#include "fivewin.ch"
Posted: Sun May 25, 2008 8:27 am
by Ramón J.
Armando, gracias por contestar.
Y sí, sí que tiene #include FiveWin.ch"
Posted: Sun May 25, 2008 8:30 am
by Ramón J.
En la respuesta a Armando, me he comido las comillas. Quería decir
#include "FiveWin.ch"
Posted: Sun May 25, 2008 8:31 am
by Manuel Valdenebro
Comprueba si el error está en las líneas inmediatamente anterior (la 964 y 974 respectivamente). Tal vez has dejado un punto y coma (;) al final.
Posted: Sun May 25, 2008 8:56 am
by Ramón J.
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
Re: parse error at '@' ?
Posted: Sun May 25, 2008 3:37 pm
by Manuel Valdenebro
Ramón J. wrote:@70,10 SAY " Seleccionar impresora" of oDlg SIZE 80,10 FONT oFont1 ACTION printersetup()
La fila 70 es "demasiado". ¿No le faltará la claúsula PIXEL?
Posted: Sun May 25, 2008 5:26 pm
by Antonio Linares
Ramón,
Los SAYs nunca han soportado la claúsula ACTION ...
Quítales el ACTION ... y verás como tu código compila bien
Por ejemplo:
@70,10 SAY " Seleccionar impresora" of oDlg SIZE 80,10 FONT oFont1
Posted: Sun May 25, 2008 7:36 pm
by Ramón J.
Gracias, Antonio. Tenías razón. Antes, el código en FW 2.0 era el siguiente:
@ 70, 10 SENSITIVE SAY Chr(149)+OemToAnsi (" Seleccionar impresora") SIZE 80,10 PIXEL OF oDlg;
FONT oFont1 COLOR CLR_BLUE COLOROVER CLR_RED;
TRANSPARENT;
ACTION printersetup()
Y, como verás, funcionaba porque utilizaba la clase Ssay de Ramón Avendaño, creo recordar. Realmente las dos únicas clases que he utilizado en toda la programación en FW 20 han sido ésa de Avendaño y la de Btnget, de Ricardo Ramirez, clases de las que estoy teniendo problemas no para conseguirlas, sino para hacerlas funcionar.
Por eso, al ver que no funcionaban con FWH he ído quitando las claúsulas que daban error, pero no he caido en la cuenta que la SAY nunca ha tenido propiedad ACTION.
Gracias
Posted: Mon May 26, 2008 8:25 am
by Ricardo Ramirez E.
Ramon...
Solo para complementar.. puedes usar SAY de FHW y hacer "algo" cuando le das click al mismo.
Code: Select all
REDEFINE SAY oSay PROMPT "Entidade" ID 1001 OF oDlg ;
COLOR RGB(230,139,44)
oSay:WantClick = .t.
oSay:bLClicked = { || ""} // aqui el bloque de codigo
oSay:oCursor = oHand //y aqui pones un cursor definido antes que l puntero del rato se vea mas bonito :)
Saludos[/code]
Posted: Mon May 26, 2008 7:34 pm
by Ramón J.
Gracias, Ricardo, también funciona.
Por cierto, no sé si procede hacerlo aquí o abrir una nuevo tema, pero estoy ahora probando la clase Btnget, que, si no me equivoco, es tuya y estoy encontrando bastantes dificultades en hacela funcionar. Me he bajado el archivo:
http://www.box.net/shared/lck9effuyn#2:6315754
Pero he observado que es para xHarbour y además incopora librerías de las que no dispongo, ya que al compilarlo con Verce 4.3 me reporta el error:
Fatal: Unable to open file 'C5CALEN.LIB'
¿No hay otro ejemplo que funcione sin necesidad de tener esas librerías?
Uso FWH/FWHX 2.7 March/2006 y Verce 4.3
Posted: Mon May 26, 2008 8:45 pm
by Ramón J.
Creo que he metido la pata preguntando sobre una cosa que requería abrir un nueva consulta en el foro, ya que no tiene nada que ver con el que he abierto este tema y que ya está solucionado.
En fin, lo hecho hecho está.