compilacion en harbour

compilacion en harbour

Postby wilsongamboa » Mon May 03, 2021 5:11 pm

Companeros buenos dias
tengo el siguiente fuente ( es antiguo )
Code: Select all  Expand view
function main()

            ?SPU_9 ( '1600167793' )

        return nil

        /***********************************************

        ***********************************************/

        FUNCTION SPU_9 ( AV_RUC_NUE )
        LOCAL LV_RUC_NUE    := AV_RUC_NUE
        LOCAL LL_UNO        := VAL(SUBSTR(LV_RUC_NUE, 1, 1))
        LOCAL LL_DOS        := VAL(SUBSTR(LV_RUC_NUE, 2, 1))
        LOCAL LL_TRE        := VAL(SUBSTR(LV_RUC_NUE, 3, 1))
        LOCAL LL_CUA        := VAL(SUBSTR(LV_RUC_NUE, 4, 1))
        LOCAL LL_CIN        := VAL(SUBSTR(LV_RUC_NUE, 5, 1))
        LOCAL LL_SEI        := VAL(SUBSTR(LV_RUC_NUE, 6, 1))
        LOCAL LL_SIE        := VAL(SUBSTR(LV_RUC_NUE, 7, 1))
        LOCAL LL_OCH        := VAL(SUBSTR(LV_RUC_NUE, 8, 1))
        LOCAL LL_NUE        := VAL(SUBSTR(LV_RUC_NUE, 9, 1))
        LOCAL LL_DIE        := VAL(SUBSTR(LV_RUC_NUE, 10, 1))
        LOCAL nSum          := LL_UNO*4+LL_DOS*3+LL_TRE*2+LL_CUA*7+LL_CIN*6+LL_SEI*5+LL_SIE*4+LL_OCH*3+LL_NUE*2
        LOCAL LL_DVERR2

            DO WHILE nSum>11
                nSum = nSum-11
            ENDDO
            LL_DVERR2 = 11-nSum
            IF ( LL_DVERR2 == 10 )
                LL_DVERR2 = 0
                RETURN .F.
            ELSE
                IF (LL_DVERR2<>LL_DIE)
                    RETURN .F.
                ELSE
                    RETURN .T.
                ENDIF
            ENDIF

        RETURN .T.

al compilar con hbmk2 asi
hbmk2 p.prg -w3 -es2 -l
me salen este error
Code: Select all  Expand view
Harbour 3.2.0dev (r2002101434)
Copyright (c) 1999-2020, https://harbour.github.io/
Compiling 'p.prg'...
p.prg(41) Warning W0032  Variable 'LL_DVERR2' is assigned but not used in functi
on 'SPU_9(0)'

No code generated.
hbmk2: Error: Running Harbour compiler (built-in). 1
(c:\hb32\bin\harbour.exe) -n2 p.prg -w3 -es2 -l -oC:\Users\wilson\AppData\Local\
Temp\hbmk_pc1zqw.dir\ -ic:\hb32\include
 

necesito compilar con esa severidad estoy incluyendo funciones en HBNETIO alguien me puede sacar de esta duda porque la variable LL_DVERR2 me dice que no la uso pero si interviene en el codigo
gracias por adelantado
Wilson 'W' Gamboa A
Wilson.josenet@gmail.com
User avatar
wilsongamboa
 
Posts: 548
Joined: Wed Oct 19, 2005 6:41 pm
Location: Quito - Ecuador

Re: compilacion en harbour

Postby hmpaquito » Mon May 03, 2021 5:21 pm

A mi modo de ver es un error de Harbour.

Ponselo mas facil al compilador poniendo como operador de asignacion := en
Code: Select all  Expand view
LL_DVERR2:= 11-nSum
hmpaquito
 
Posts: 1482
Joined: Thu Oct 30, 2008 2:37 pm

Re: compilacion en harbour

Postby karinha » Mon May 03, 2021 5:25 pm

LL_DVERR2, LOCAL, MEMVAR, PRIVATE ó PUBLIC?
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7215
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: compilacion en harbour

Postby wilsongamboa » Mon May 03, 2021 5:25 pm

muchas gracias por responder le pongo := y me da el mismo error , es mas le inclui
HB_SYMBOL_UNUSED( LL_DVERR2 )
y me sigue dando el mismo error
que hago ?
gracias
Wilson 'W' Gamboa A
Wilson.josenet@gmail.com
User avatar
wilsongamboa
 
Posts: 548
Joined: Wed Oct 19, 2005 6:41 pm
Location: Quito - Ecuador

Re: compilacion en harbour

Postby wilsongamboa » Mon May 03, 2021 5:37 pm

es local la variable esta declarada cono local
bueno lo acabo de solucionar con
hb_default( @LL_DVERR2, 0 )
no entro mas a revisión por falta de tiempo muchas gracias
a todos por tratar de ayudar dice mucho eso
GRACIAS
Wilson 'W' Gamboa A
Wilson.josenet@gmail.com
User avatar
wilsongamboa
 
Posts: 548
Joined: Wed Oct 19, 2005 6:41 pm
Location: Quito - Ecuador

Re: compilacion en harbour

Postby jvtecheto » Mon May 03, 2021 6:27 pm

Hola Wilson:

Yo creo que es un bug de Harbour, espero que algun maestro lo mire , ya sabes que sino compilas con ese nivel de advertencia funciona perfecto.
incluso siguiento las indicaciones de este foro http://hmgforum.com/viewtopic.php?t=1756
y en la declaracion haciendo esto, asi lanza 2 advertencias , es por lo que me decanto por el bug.
Code: Select all  Expand view

LOCAL LL_DVERR2 := 0
 


¿Para que necesitas ese nivel de advertencia?

Saludos

Jose
Fwh 19.06 32 bits + Harbour 3.2dev(r2104281802) + Borland 7.4 + FivEdit
User avatar
jvtecheto
 
Posts: 576
Joined: Mon Mar 04, 2013 4:32 pm
Location: Spain

Re: compilacion en harbour

Postby wilsongamboa » Mon May 03, 2021 6:31 pm

José muchas gracias por tu preocupación, estoy aumentando funciones al HBNETIO para poder solventar un trabajo que estoy haciendo, HBNETIO.PRG se compila con ese nivel de severidad
Wilson 'W' Gamboa A
Wilson.josenet@gmail.com
User avatar
wilsongamboa
 
Posts: 548
Joined: Wed Oct 19, 2005 6:41 pm
Location: Quito - Ecuador

Re: compilacion en harbour

Postby ruben Dario » Tue May 04, 2021 1:31 am

wilsongamboa

pero hice la prueba y funciona bien.
Que valor supuestamente deberia de retornar la funcion SPU_9
Ruben Dario Gonzalez
Cali-Colombia
rubendariogd@hotmail.com - rubendariogd@gmail.com
User avatar
ruben Dario
 
Posts: 1061
Joined: Thu Sep 27, 2007 3:47 pm
Location: Colombia

Re: compilacion en harbour

Postby wilsongamboa » Tue May 04, 2021 1:53 am

Ruben buenas noches
La función está ok
Debe retornar t o f
El problema es que me da error al compilar de la forma en que necesito
Ya lo arregle con hb_default
Wilson 'W' Gamboa A
Wilson.josenet@gmail.com
User avatar
wilsongamboa
 
Posts: 548
Joined: Wed Oct 19, 2005 6:41 pm
Location: Quito - Ecuador

Re: compilacion en harbour

Postby wilsongamboa » Tue May 04, 2021 5:27 pm

para terminal el asunto lo he resuelto asi

Code: Select all  Expand view
function main()

            ?SPU_9 ( '1600167793' )

        return nil

        /***********************************************

        ***********************************************/

        FUNCTION SPU_9 ( AV_RUC_NUE )
        LOCAL LV_RUC_NUE    := AV_RUC_NUE
        LOCAL LL_UNO        := VAL(SUBSTR(LV_RUC_NUE, 1, 1))
        LOCAL LL_DOS        := VAL(SUBSTR(LV_RUC_NUE, 2, 1))
        LOCAL LL_TRE        := VAL(SUBSTR(LV_RUC_NUE, 3, 1))
        LOCAL LL_CUA        := VAL(SUBSTR(LV_RUC_NUE, 4, 1))
        LOCAL LL_CIN        := VAL(SUBSTR(LV_RUC_NUE, 5, 1))
        LOCAL LL_SEI        := VAL(SUBSTR(LV_RUC_NUE, 6, 1))
        LOCAL LL_SIE        := VAL(SUBSTR(LV_RUC_NUE, 7, 1))
        LOCAL LL_OCH        := VAL(SUBSTR(LV_RUC_NUE, 8, 1))
        LOCAL LL_NUE        := VAL(SUBSTR(LV_RUC_NUE, 9, 1))
        LOCAL LL_DIE        := VAL(SUBSTR(LV_RUC_NUE, 10, 1))
        LOCAL nSum          := LL_UNO*4+LL_DOS*3+LL_TRE*2+LL_CUA*7+LL_CIN*6+LL_SEI*5+LL_SIE*4+LL_OCH*3+LL_NUE*2
        LOCAL LL_DVERR2
            hb_default( @LL_DVERR2, 0 )

            DO WHILE nSum>11
                nSum = nSum-11
            ENDDO
            LL_DVERR2 = 11-nSum
            IF ( LL_DVERR2 == 10 )
                LL_DVERR2 = 0
                RETURN .F.
            ELSE
                IF (LL_DVERR2<>LL_DIE)
                    RETURN .F.
                ELSE
                    RETURN .T.
                ENDIF
            ENDIF

        RETURN .T.
 

gracias a todos ahora al compilar con hbmk2.exe p.prg -w3 -es2 -l
ya no da errores
GRACIAS a todos !!
Wilson 'W' Gamboa A
Wilson.josenet@gmail.com
User avatar
wilsongamboa
 
Posts: 548
Joined: Wed Oct 19, 2005 6:41 pm
Location: Quito - Ecuador


Return to FiveWin para Harbour/xHarbour

Who is online

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