Esto puede ser un BUG?

Esto puede ser un BUG?

Postby thefull » Fri Dec 01, 2006 10:44 am

Es curioso lo que me esta pasando....
Teniendo este codigo...

#include "fivewin.ch"

Function Main()
Local aValues := {0,0,0,0}
Loca g, n := 1

DEFINE DIALOG oDlg TITLE "Its Bug ?" SIZE 300,300

FOR g := 1 TO LEN( aValues )
@ 1+n,1 GET aValues[ g ] PICTURE "9999.99" OF oDlg PIXEL
n += 15
NEXT

ACTIVATE DIALOG oDlg

RETURN NIL

Se produce este error:
Application
===========
Path and name: C:\FWH27\SAMPLES\testbug.exe (32 bits)
Size: 1,346,048 bytes
Time from start: 0 hours 0 mins 0 secs
Error occurred at: 12/01/06, 11:35:05
Error description: Error BASE/1132 Bound error: array access
Args:
[ 1] = A { ... }
[ 2] = N 5

Stack Calls
===========
Called from: testbug.prg => (b)MAIN(12)
Called from: tget.prg => TCLIPGET:VARGET(737)
Called from: tget.prg => TCLIPGET:SETFOCUS(610)
Called from: TGET.PRG => TGET:INITIATE(0)
Called from: => __OBJSENDMSG(0)
Called from: HARBOUR.PRG => OSEND(0)
Called from: HARBOUR.PRG => ASEND(0)
Called from: DIALOG.PRG => TDIALOG:INITIATE(0)
Called from: DIALOG.PRG => TDIALOG:HANDLEEVENT(0)
Called from: => DIALOGBOXINDIRECT(0)
Called from: DIALOG.PRG => TDIALOG:ACTIVATE(0)
Called from: testbug.prg => MAIN(16)

Vamos haber, ¿ DE DONDE SALE EL 5 ?

En fin, lo que vamos hacer ahora es AUMENTAR EL ARRAY a un nuevo elemento..., para seguir con el test:
Local aValues := {0,0,0,0,0}
y el FOR para a 1 TO 4 // De lo contrario siempre necesita UN BUENO elemento.

BIen, si se ejecuta este codigo, si en el primer get ponemos un valor, ESTE SE TRASLADA a los otros GETS, como si fuese la misma variable.

Yo creo que xHarbour se le va la olla....¿ Podeis confirmar que se debe a xharbour , y no de Fivewin ? ( 100% que no es de Fivewin ... )

El xHarbour es que viene con la distribucion de Fwh 2.7, suministrada por Fivetech.

xHarbour Compiler build 0.99.61 (SimpLex)
Copyright 1999-2006, http://www.xharbour.org http://www.harbour-project.org/

Harbour Build Info
---------------------------
Version: xHarbour build 0.99.61 Intl. (SimpLex)
PCode Version: 7
Compiler: Borland C++ 5.5.1
Platform: Windows XP Professional 5.01.2600 Service Pack 2

Built on: May 19 2006 12:37:05
Last ChangeLog entry: 2006-02-06 17:52 UTC-0800 Ron Pinkas <Ron in xHarbour.com>

ChangeLog CVS version: ChangeLog,v 1.4807

Harbour extensions: Yes
CA-Clipper 5.2e undocumented: Yes
CA-Clipper 5.2e strict compatibility: No
CA-Clipper 5.3x compatible extensions: Yes
Alaska Xbase++ compatible extensions: Yes
CA-Visual Objects compatible extensions: No
Multisoft Flagship compatible extensions: Yes
Microsoft FoxPro compatible extensions: No
dBase compatible extensions: No
Object file generation support: No
ANSI C usage: Non strict
C++ mode: Off
Compiler YACC debug mode: Off
Memory tracing and statistics: Off
Maximum symbol name length: 63
---------------------------
Saludos
Rafa Carmona ( rafa.thefullARROBAgmail.com___quitalineas__)
User avatar
thefull
 
Posts: 731
Joined: Fri Oct 07, 2005 7:42 am
Location: Barcelona

Re: Esto puede ser un BUG?

Postby thefull » Fri Dec 01, 2006 12:14 pm

Resulta que hay que usar los detached local.... ummm.... eso
pasa por querer seguir usando codigo viejo de clipper....

Porque esto funciona perfectamente en clipper DOS:
@ n,1 get aHurdle[g] picture "9999.99"

pero no con Fivewin/Harbour.

Saludos
Rafa Carmona
Saludos
Rafa Carmona ( rafa.thefullARROBAgmail.com___quitalineas__)
User avatar
thefull
 
Posts: 731
Joined: Fri Oct 07, 2005 7:42 am
Location: Barcelona

Postby Antonio Linares » Fri Dec 01, 2006 1:00 pm

Rafa,

En realidad lo que hace Clipper es crear automaticamente las "detached locals", pero eso tiene su punto de riesgo de no saber exactamente lo que está ocurriendo :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41937
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Hola

Postby Susy » Mon Dec 04, 2006 9:56 pm

Hola corazon , tal vez estes definidiendo mal la variable y sus elementos, le podrias indicar de esta manera si deseas sumarizar o totalizar x cantidad. ejemplo

aSum := {0,0,0,0}

do while !eof()
aSum[1,1] += IMPORTE
aSum[1,2] += CANTIDAD
aSum[1,3] += IVA
aSum[1,4] += TOTAL
enddo

Definir sus 4 arreglos de elementos, espero que me haya explicado , a mi me funciona en fivewin

Su amiga Susy
Susy
 
Posts: 35
Joined: Wed Nov 15, 2006 4:04 pm


Return to FiveWin para Harbour/xHarbour

Who is online

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