FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Error al compilar Label.prg
Posts: 464
Joined: Tue Mar 21, 2006 07:30 PM
Error al compilar Label.prg
Posted: Mon Sep 06, 2010 05:40 PM
Hola a todos
Hace ya bastante tiempo construí un pequeño programa para hacer etiquetas con el ejemplo que viene en FWH\SAMPLES\LABELS y no he tenido ningún problema hasta ahora, que he tenido que hacer unos cambios y al compilar me llevo la sorpresa de los errores siguientes :
Code (fw): Select all Collapse
Compiling 'C:\PROYEC~1\Direcc\SOURCE\label.prg'...                                                                                
C:\PROYEC~1\Direcc\SOURCE\label.prg(981) Error E0030  Syntax error: "syntax                                                       
error at 'STARTLINE'"                                                                                                             
C:\PROYEC~1\Direcc\SOURCE\label.prg(983) Error E0004  STATIC declaration                                                          
follows executable statement                                                                                                      
C:\PROYEC~1\Direcc\SOURCE\label.prg(1001) Error E0030  Syntax error: "syntax                                                      
error at 'ENDLINE'"                                                                                                               
C:\PROYEC~1\Direcc\SOURCE\label.prg(1003) Error E0004  STATIC declaration                                                         
follows executable statement                                                                                                      
C:\PROYEC~1\Direcc\SOURCE\label.prg(1126) Error E0030  Syntax error: "syntax                                                      
error at 'SETPENCOLOR'"

He vuelto a mirar el LABEL.PRG que viene con la versión que estoy utilizando FWH 9.04, por si el mío no estuviera correcto
y es el mismo.
¿Alguien usa este ejemplo para etiquetas y le ha pasado lo mismo?, Si es así, ¿me podría indicar cual ha sido la solución?
No sé si el resto de fuentes, del ejemplo, tendrá problemas, cuando llegue a ellos lo sabré.
Un saludo
Pedro
gahetesoft@gmail.com
FWH12.06 BCC582, Xverce CW, Pelles C 6.00.4,PSPAD 4.54
y ahora con ADO
Posts: 464
Joined: Tue Mar 21, 2006 07:30 PM
Re: Error al compilar Label.prg
Posted: Wed Sep 08, 2010 04:18 PM

Hola a todos

ninguna respuesta?

Un saludo
Pedro
gahetesoft@gmail.com
FWH12.06 BCC582, Xverce CW, Pelles C 6.00.4,PSPAD 4.54
y ahora con ADO
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Error al compilar Label.prg
Posted: Thu Sep 09, 2010 08:26 AM
Pedro,

Aqui ha compilado bien despues de cambiar tres "CLASS TReport" erróneos por "CLASS TLabel":
Code (fw): Select all Collapse
c:\soporte\soporte6>c:\harbour\bin\harbour label.prg /n /ic:\harbour\include /ic
:\fwh\include
Harbour 2.1.0beta1 (Rev. 14694)
Copyright (c) 1999-2010, http://harbour-project.org/
Compiling 'label.prg'...
label.prg(980) Error E0019  #error 'Method <StartLine(nHeight)> not declared or
declaration mismatch in class <TReport>'
label.prg(1000) Error E0019  #error 'Method <EndLine(nHeight, nItem)> not declar
ed or declaration mismatch in class <TReport>'
label.prg(1125) Error E0019  #error 'Method <SetPenColor(nColor)> not declared o
r declaration mismatch in class <TReport>'
3 errors

Tras cambiar CLASS TReport por CLASS TLabel en esas líneas:
Code (fw): Select all Collapse
c:\soporte\soporte6>c:\harbour\bin\harbour label.prg /n /ic:\harbour\include /ic
:\fwh\include
Harbour 2.1.0beta1 (Rev. 14694)
Copyright (c) 1999-2010, http://harbour-project.org/
Compiling 'label.prg'...
Lines 5037, Functions/Procedures 24
Generating C source output to 'label.c'... Done.
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 464
Joined: Tue Mar 21, 2006 07:30 PM
Re: Error al compilar Label.prg
Posted: Thu Sep 09, 2010 09:05 AM
Hola Antonio

Eso mismo he hecho yo, cambiar los Treport por Tlabel en LABEL.PRG y los que también están mal en LITEM.PRG.
Ahora compila bien, pero al ejecutar me da el siguiente error:
Code (fw): Select all Collapse
Application
===========
   Path and name: C:\Proyectos\Direcc\EPUBLI.Exe (32 bits)
   Size:   602,112 bytes
   Time from start: 0 hours 0 mins 54 secs 
   Error occurred at: 09-09-2010, 10:13:16
   Error description: Error BASE/1605  Invalid self: NEW
   Args:
     [   1] = O   Object
     [   2] = U   

Stack Calls
===========
   Called from: C:\PROYEC~1\Direcc\SOURCE\label.prg => TLABEL:NEW(302)
   Called from: C:\PROYEC~1\Direcc\SOURCE\pdlabel.prg => LBLBEGIN(50)
   Called from: C:\PROYEC~1\Direcc\SOURCE\gesh0320.prg => ETIQCOMUN(49)
   Called from: C:\PROYEC~1\Direcc\SOURCE\gesh0200.prg => LISTETI(37)
   Called from: C:\PROYEC~1\Direcc\SOURCE\geshinic.prg => (b)MAIN(103)
   Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:CLICK(443)
   Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:LBUTTONUP(629)
   Called from:  => TWINDOW:HANDLEEVENT(0)
   Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT(1453)
   Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:HANDLEEVENT(1270)
   Called from: .\source\classes\WINDOW.PRG => _FWH(3333)
   Called from:  => WINRUN(0)
   Called from: .\source\classes\WINDOW.PRG => TMDIFRAME:ACTIVATE(952)
   Called from: C:\PROYEC~1\Direcc\SOURCE\geshinic.prg => MAIN(116)



Variables in use
================
   Procedure     Type   Value
   ==========================
   TLABEL:NEW
     Param   1:    N    70
     Param   2:    N    37
     Param   3:    N    1
     Param   4:    N    1
     Param   5:    N    3
     Param   6:    A    Len:    1
     Param   7:    A    Len:    1
     Param   8:    C    "LABEL.PRN"
     Param   9:    C    ""
     Param  10:    L    .F.
     Param  11:    L    .T.
     Param  12:    C    "LABEL.TXT"
     Param  13:    U    
     Param  14:    C    "ETIQUETAS DE COMUNIDADES"
     Local   1:    O    Class: TLABEL
     Local   2:    U    
     Local   3:    L    .T.
     Local   4:    L    .F.
     Local   5:    U    
     Local   6:    U    
     Local   7:    U    
   LBLBEGIN
     Param   1:    N    70
     Param   2:    N    37
     Param   3:    N    1
     Param   4:    N    1
     Param   5:    N    3
     Param   6:    A    Len:    1
     Param   7:    A    Len:    1
     Param   8:    C    "LABEL.PRN"
     Param   9:    U    
     Param  10:    L    .F.
     Param  11:    L    .T.
     Param  12:    C    "LABEL.TXT"
     Param  13:    U    
     Param  14:    C    "ETIQUETAS DE COMUNIDADES"
     Local   1:    U    
     Local   2:    U    
     Local   3:    A    Len:    0
   ETIQCOMUN
     Local   1:    C    "COMUNIDAD"
     Local   2:    U    
     Local   3:    U    
     Local   4:    O    Class: TDATABASE
     Local   5:    O    Class: TFONT
   LISTETI
     Param   1:    N    2
     Local   1:    N    2
   (b)MAIN
     Param   1:    O    Class: TBTNBMP
   TBTNBMP:CLICK
     Local   1:    O    Class: TBTNBMP
   TBTNBMP:LBUTTONUP
     Param   1:    N    45
     Param   2:    N    47
     Param   3:    O    Class: TBTNBMP
     Local   1:    U    
     Local   2:    L    .T.
   TWINDOW:HANDLEEVENT
     Param   1:    N    514
     Param   2:    N    0
     Param   3:    N    2949167
   TCONTROL:HANDLEEVENT
     Param   1:    N    514
     Param   2:    N    0
     Param   3:    N    2949167
     Local   1:    O    Class: TBTNBMP
     Local   2:    U    
   TBTNBMP:HANDLEEVENT
     Param   1:    N    514
     Param   2:    N    0
     Param   3:    N    2949167
     Local   1:    O    Class: TBTNBMP
   _FWH
     Param   1:    N    2949167
     Param   2:    N    514
     Param   3:    N    0
     Param   4:    N    2949167
     Param   5:    N    9
     Local   1:    O    Class: TBTNBMP
   WINRUN
     Param   1:    N    721546
   TMDIFRAME:ACTIVATE
     Param   1:    C    "MAXIMIZED"
     Param   2:    U    
     Param   3:    U    
     Param   4:    U    
     Param   5:    U    
     Param   6:    U    
     Param   7:    U    
     Param   8:    U    
     Param   9:    U    
     Param  10:    U    
     Param  11:    U    
     Param  12:    U    
     Param  13:    U    
     Param  14:    U    
     Param  15:    U    
     Param  16:    U    
     Param  17:    B    {|| ... }
     Param  18:    U    
     Param  19:    U    
     Local   1:    O    Class: TMDIFRAME
     Local   2:    U    
     Local   3:    U    
   MAIN
     Local   1:    O    Class: TBITMAP
     Local   2:    A    Len:    6
     Local   3:    A    Len:    6
     Local   4:    C    "C:\Proyectos\Direcc"
     Local   5:    A    Len:    2
     Local   6:    N    16056320

Linked RDDs
===========
   DBF
   DBFFPT
   DBFCDX
   DBFNTX
   DBFBLOB

DataBases in use
================

  1: => COMU                               RddName: DBFCDX
     ==============================
     RecNo    RecCount    BOF   EOF
         91          170      .F.   .F.

     Indexes in use                        TagName
        => COMUNIDAD                          COMUNIDAD
           PROPIETAR                          PROPIETAR
           DIRECCION                          DIRECCION
           DISTRITO                           DISTRITO

     Relations in use

Classes in use:
===============
     1 ERROR
     2 HASHENTRY
     3 HBCLASS
     4 HBOBJECT
     5 TFONT
     6 TWINDOW
     7 TCONTROL
     8 TICON
     9 TBRUSH
    10 TBITMAP
    11 TMDIFRAME
    12 TMENU
    13 TMENUITEM
    14 TMDICLIENT
    15 TMSGBAR
    16 TRECT
    17 TMSGITEM
    18 TTIMER
    19 TBAR
    20 TBTNBMP
    21 TDIALOG
    22 TDATABASE
    23 TMDICHILD
    24 TWBROWSE
    25 TSCROLLBAR
    26 TGET
    27 GET
    28 TCLIPGET
    29 TBUTTON
    30 TMULTIGET
    31 TRADMENU
    32 TRADIO
    33 TLABEL
    34 TPRINTER
    35 TPEN
    36 TREG32


La línea 302 es el RETURN NIL del METHODO NEW de LABEL.PRG
Un saludo
Pedro
gahetesoft@gmail.com
FWH12.06 BCC582, Xverce CW, Pelles C 6.00.4,PSPAD 4.54
y ahora con ADO
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Error al compilar Label.prg
Posted: Thu Sep 09, 2010 10:38 AM

Pedro,

Cambia ese return nil por return Self y listo :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 464
Joined: Tue Mar 21, 2006 07:30 PM
Re: Error al compilar Label.prg
Posted: Thu Sep 09, 2010 05:27 PM

Gracias Antonio

Una vez puesto los self necesarios, y arreglados un par de errores más que ha dado, ya está funcionando perfectamente.

Un saludo
Pedro
gahetesoft@gmail.com
FWH12.06 BCC582, Xverce CW, Pelles C 6.00.4,PSPAD 4.54
y ahora con ADO

Continue the discussion