FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour parse error at '@' ?
Posts: 152
Joined: Mon Feb 13, 2006 08:23 PM

parse error at '@' ?

Posted: Sat May 24, 2008 09:36 PM

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

FWH 20.12 BCC7
Posts: 446
Joined: Mon Dec 26, 2005 09:11 PM

parse error at '@' ?

Posted: Sun May 25, 2008 03:01 AM

1) Verifica si tienes el siguiente texto:

include "fivewin.ch"

FWH + BCC582 + WorkShop 4.5 + Resource Hacker + Mingw
Mis nuevas herramientas
Comunicacion via WhatsApp (+51) 957549 665
Comunicaci贸n via Correo: apic1002002 at yahoo dot es; apic1002002@gmail.com
Posts: 152
Joined: Mon Feb 13, 2006 08:23 PM

parse error at '@' ?

Posted: Sun May 25, 2008 08:27 AM

Armando, gracias por contestar.

Y s铆, s铆 que tiene #include FiveWin.ch"

FWH 20.12 BCC7
Posts: 152
Joined: Mon Feb 13, 2006 08:23 PM

parse error at '@' ?

Posted: Sun May 25, 2008 08:30 AM

En la respuesta a Armando, me he comido las comillas. Quer铆a decir

include "FiveWin.ch"

FWH 20.12 BCC7
Posts: 711
Joined: Thu Oct 06, 2005 09:57 PM

parse error at '@' ?

Posted: Sun May 25, 2008 08:31 AM

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.

Un saludo



Manuel
Posts: 152
Joined: Mon Feb 13, 2006 08:23 PM

parse error at '@' ?

Posted: Sun May 25, 2008 08: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
FWH 20.12 BCC7
Posts: 711
Joined: Thu Oct 06, 2005 09:57 PM

Re: parse error at '@' ?

Posted: Sun May 25, 2008 03:37 PM
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?
Un saludo



Manuel
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM

parse error at '@' ?

Posted: Sun May 25, 2008 05:26 PM

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

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 152
Joined: Mon Feb 13, 2006 08:23 PM

parse error at '@' ?

Posted: Sun May 25, 2008 07:36 PM

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

FWH 20.12 BCC7
Posts: 161
Joined: Wed Jan 25, 2006 10:45 AM

parse error at '@' ?

Posted: Mon May 26, 2008 08:25 AM
Ramon...

Solo para complementar.. puedes usar SAY de FHW y hacer "algo" cuando le das click al mismo.
  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]
Saludos

Ricardo R.

xHarbour 1.1.0 Simplex , Microsoft Visual Studio 2008, Bcc55, Fwh Build. 9.01
Posts: 152
Joined: Mon Feb 13, 2006 08:23 PM

parse error at '@' ?

Posted: Mon May 26, 2008 07:34 PM

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

FWH 20.12 BCC7
Posts: 152
Joined: Mon Feb 13, 2006 08:23 PM

parse error at '@' ?

Posted: Mon May 26, 2008 08:45 PM

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谩.

FWH 20.12 BCC7

Continue the discussion