FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour ERROR compiled with FW , NOT without FW
Posts: 167
Joined: Thu Mar 22, 2007 11:24 AM
ERROR compiled with FW , NOT without FW
Posted: Tue Jul 01, 2008 05:51 PM
Antonio,

Trying to work out the code from thread 'checking changes in folder' (28 juni , using 'HB_DBG_VMSTKLLIST()' , i have no error when compiled without FW , probably a GPF with FW


# ifdef FIVEWIN
  #include "FiveWin.ch" 
# endif
#include "common.ch"

function Main() 

Test( "one", "two", "three" ) 

return nil 
***************************************************************************************************************
function Test( x, y, z ) 
************************	

local local1 := "first", local2 := {"SecondFirst","secondSecond"}
local aBegin
local aEnd
// your code... 
aBegin := aClone(ReadLocals(HB_DBG_VMSTKLLIST(),4,5))
local2[2] := "changed!" // we change a local value 
aEnd := Readlocals(HB_DBG_VMSTKLLIST(),4,5)

CompLocals(aBegin , aEnd)
return nil 

****************************************************************************************************************
FUNC ReadLocals(...)
********************
LOCAL aParam := HB_aParams()
LOCAL nFrom , nTo
LOCAL aLocals// := HB_DBG_VMSTKLLIST()
LOCAL Arr[0] , el
aLocals := aParam[1]
aDel(aParam,1,.T.)
aDel(aLocals,1,.T.)
aDel(aLocals,1,.T.)
IF LEN(aParam) == 0
  Arr := aLocals
ELSEIF LEN(aParam) <= 2
  nTo := nFrom := aParam[1]
  IF LEN(aParam) = 2
    nTO   := aParam[2]
  END
  Arr := {}
  AEVAL(aLocals , {|el| AADD(Arr,el) } , nFrom , Nto - nFrom + 1)
ELSE
  AEVAL(aParam , {|el| AADD(Arr , aLocals[el]) } )		
ENDIF
RETURN Arr
*************************************************************
FUNC CompLocals(aBegin , aEnd)
*********************************
LOCAL el , elem , lOk := .T. , i
FOR i := 1 TO LEN(aBegin)
  el   := aBegin[i]
  elem := aEnd[i]
  IF VALTYPE(el) <> VALTYPE(elem)
    lOk := .F.
    EXIT
  END
  IF IsArray(el) .AND. IsArray(elem)
    IF LEN(el) <> LEN(elem)
      lOk := .F.
      EXIT
     END
     IF ! CompLocals(el , elem )
       lOk := .F.
       EXIT
    END
ELSE
    IF el <> elem
      lOk := .F.
      EXIT
    END		 
  END
NEXT
IF ! lOk
  ? i , aBegin[i] , aEnd[i] , lOk
  # ifndef FIVEWIN
  WAIT
  # endif
END
RETURN lOk
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
ERROR compiled with FW , NOT without FW
Posted: Tue Jul 01, 2008 07:35 PM
Frank,

With Harbour we get this error with your code and FWH:
   Error description: Error BASE/1003  Variable does not exist: ALOCAL

Stack Calls
===========
   Called from: F:\tmp43\test.prg => (b)READLOCALS(48)
   Called from:  => AEVAL(0)
   Called from: F:\tmp43\test.prg => READLOCALS(48)
   Called from: F:\tmp43\test.prg => TEST(20)
   Called from: F:\tmp43\test.prg => MAIN(9)

Quite curiously, with xHarbour there is no error :-)

but it should be there because aLocal is not defined
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
ERROR compiled with FW , NOT without FW
Posted: Tue Jul 01, 2008 07:36 PM

Also you have many ambiguous references in your code that you should fix (undeclared variables).

But no GPFs here :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
ERROR compiled with FW , NOT without FW
Posted: Tue Jul 01, 2008 07:46 PM
Antonio Linares wrote:Frank,

With Harbour we get this error with your code and FWH:
   Error description: Error BASE/1003  Variable does not exist: ALOCAL

Stack Calls
===========
   Called from: F:\tmp43\test.prg => (b)READLOCALS(48)
   Called from:  => AEVAL(0)
   Called from: F:\tmp43\test.prg => READLOCALS(48)
   Called from: F:\tmp43\test.prg => TEST(20)
   Called from: F:\tmp43\test.prg => MAIN(9)

Quite curiously, with xHarbour there is no error :-)

but it should be there because aLocal is not defined


Which compiler switches are you using? I get exactly the same warnings with both Harbour or xHarbour:

Harbour 1.0.0RC1 Intl. (Rev. 8863)
Copyright (c) 1999-2008, http://www.harbour-project.org/
FRANK.prg(47) Warning W0001 Ambiguous reference: 'ALOCAL'
FRANK.prg(54) Warning W0001 Ambiguous reference: 'I'
FRANK.prg(55) Warning W0001 Ambiguous reference: 'I'
FRANK.prg(56) Warning W0001 Ambiguous reference: 'I'
FRANK.prg(66) Warning W0001 Ambiguous reference: 'J'
FRANK.prg(67) Warning W0001 Ambiguous reference: 'J'
FRANK.prg(67) Warning W0001 Ambiguous reference: 'J'
FRANK.prg(71) Warning W0001 Ambiguous reference: 'J'
FRANK.prg(71) Warning W0001 Ambiguous reference: 'J'
FRANK.prg(78) Warning W0001 Ambiguous reference: 'I'
FRANK.prg(78) Warning W0001 Ambiguous reference: 'I'
FRANK.prg(80) Warning W0001 Ambiguous reference: 'I'
FRANK.prg(80) Warning W0001 Ambiguous reference: 'I'
FRANK.prg(80) Warning W0001 Ambiguous reference: 'I'

No code generated.


xHarbour Compiler build 1.1.0 (SimpLex) (Rev. 6159)
Copyright 1999-2008, http://www.xharbour.org http://www.harbour-project.org/
FRANK.prg(47) Warning W0002 Ambiguous reference, assuming memvar: 'ALOCAL'
FRANK.prg(54) Warning W0001 Ambiguous reference: 'I'
FRANK.prg(54) Warning W0001 Ambiguous reference: 'I'
FRANK.prg(55) Warning W0001 Ambiguous reference: 'I'
FRANK.prg(56) Warning W0001 Ambiguous reference: 'I'
FRANK.prg(66) Warning W0001 Ambiguous reference: 'J'
FRANK.prg(66) Warning W0001 Ambiguous reference: 'J'
FRANK.prg(67) Warning W0001 Ambiguous reference: 'J'
FRANK.prg(67) Warning W0001 Ambiguous reference: 'J'
FRANK.prg(71) Warning W0001 Ambiguous reference: 'J'
FRANK.prg(71) Warning W0001 Ambiguous reference: 'J'
FRANK.prg(78) Warning W0001 Ambiguous reference: 'I'
FRANK.prg(78) Warning W0001 Ambiguous reference: 'I'
FRANK.prg(80) Warning W0001 Ambiguous reference: 'I'
FRANK.prg(80) Warning W0001 Ambiguous reference: 'I'
FRANK.prg(80) Warning W0001 Ambiguous reference: 'I'

No code generated.


EMG
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
ERROR compiled with FW , NOT without FW
Posted: Tue Jul 01, 2008 08:24 PM

Enrico,

The ambiguous references are the same in both compilers.

The difference is that Harbour generates an error in runtime, thats seems ok, and xHarbour ignores it.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
ERROR compiled with FW , NOT without FW
Posted: Tue Jul 01, 2008 08:41 PM
Harbour doesn't generate any error here. At least using the following compiler switches:

SET HARBOURCMD=/a /es2 /gc0 /m /n /q /w


EMG
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
ERROR compiled with FW , NOT without FW
Posted: Tue Jul 01, 2008 08:55 PM

Enrico,

See this line:

AEVAL(aParam , {|el| AADD(Arr , aLocal[el]) } )

aLocal is not defined anywhere, and more over, is used as an array, so it should generate an error. Don't know if those compiler switches may make a difference, but I can't find a aLocal variable declaration anywhere in the code :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
ERROR compiled with FW , NOT without FW
Posted: Tue Jul 01, 2008 09:16 PM
AEVAL(aParam , {|el| AADD(Arr , aLocal[el]) } )


Judging from the rest of the code, it appears that aLocal is a typo--it should be aLocals (with an s). aLocals is defined and used.

James
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 167
Joined: Thu Mar 22, 2007 11:24 AM
ERROR compiled with FW , NOT without FW
Posted: Wed Jul 02, 2008 06:13 AM

Sorry guys , i was mixting old xhb with recent fw code

I have changed the example , now it works , also when arrays are used .

I am wondering why i have to use

aBegin := aClone(ReadLocals(..))

If not , aBegin is changed with the next line , and aBegin is the same as aEnd

Frank

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
ERROR compiled with FW , NOT without FW
Posted: Wed Jul 02, 2008 06:32 AM

Frank,

>
I am wondering why i have to use

aBegin := aClone(ReadLocals(..))
>

Probably because it is pointing to the original array, so when you modify it, then you are modifying the original. AClone() creates a copy of it, but kept on a different variable.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
ERROR compiled with FW , NOT without FW
Posted: Wed Jul 02, 2008 09:25 AM
Antonio Linares wrote:Enrico,

See this line:

AEVAL(aParam , {|el| AADD(Arr , aLocal[el]) } )

aLocal is not defined anywhere, and more over, is used as an array, so it should generate an error. Don't know if those compiler switches may make a difference, but I can't find a aLocal variable declaration anywhere in the code :-)


Yes, and this has been considered a warning from Clipper on:

FUNCTION MAIN()

    ? n

    RETURN NIL


Harbour 1.0.0RC2 Intl. (Rev. 8874)
Copyright (c) 1999-2008, http://www.harbour-project.org/
NODECL.prg(3) Warning W0001 Ambiguous reference: 'N'

No code generated.


EMG

Continue the discussion