FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour compilacion en harbour
Posts: 670
Joined: Wed Oct 19, 2005 06:41 PM
compilacion en harbour
Posted: Mon May 03, 2021 05:11 PM
Companeros buenos dias
tengo el siguiente fuente ( es antiguo )
Code (fw): Select all Collapse
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 (fw): Select all Collapse
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
Posts: 1515
Joined: Thu Oct 30, 2008 02:37 PM
Re: compilacion en harbour
Posted: Mon May 03, 2021 05:21 PM
A mi modo de ver es un error de Harbour.

Ponselo mas facil al compilador poniendo como operador de asignacion := en
Code (fw): Select all Collapse
LL_DVERR2:= 11-nSum
Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM
Re: compilacion en harbour
Posted: Mon May 03, 2021 05:25 PM

LL_DVERR2, LOCAL, MEMVAR, PRIVATE 贸 PUBLIC?

Jo茫o Santos - S茫o Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 670
Joined: Wed Oct 19, 2005 06:41 PM
Re: compilacion en harbour
Posted: Mon May 03, 2021 05: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
Posts: 670
Joined: Wed Oct 19, 2005 06:41 PM
Re: compilacion en harbour
Posted: Mon May 03, 2021 05: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
Posts: 607
Joined: Mon Mar 04, 2013 04:32 PM
Re: compilacion en harbour
Posted: Mon May 03, 2021 06: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 (fw): Select all Collapse
LOCAL LL_DVERR2 := 0


驴Para que necesitas ese nivel de advertencia?

Saludos

Jose
Fwh 24.07 64 bits + Harbour 64 bits 3.2dev(r2407221137) + MSVC64
Posts: 670
Joined: Wed Oct 19, 2005 06:41 PM
Re: compilacion en harbour
Posted: Mon May 03, 2021 06: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
Posts: 1078
Joined: Thu Sep 27, 2007 03:47 PM
Re: compilacion en harbour
Posted: Tue May 04, 2021 01: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
Posts: 670
Joined: Wed Oct 19, 2005 06:41 PM
Re: compilacion en harbour
Posted: Tue May 04, 2021 01: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
Posts: 670
Joined: Wed Oct 19, 2005 06:41 PM
Re: compilacion en harbour
Posted: Tue May 04, 2021 05:27 PM
para terminal el asunto lo he resuelto asi

Code (fw): Select all Collapse
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

Continue the discussion