στις 21/03/2010 20:31, O/H Przemysław Czerpak έγραψε:
On Sun, 21 Mar 2010, Alexandr Okhotnikov wrote:
Hi
Example!
FUNC MAIN()
DBCREATE( "aa.dbf", { { "DACC", "C", 10, 0 } } )
use aa.dbf alias aa new
DBAPPEND()
aa->DACC := "hello"
? "aa->DACC :", aa->DACC
? 'aa->&("DACC") :', aa->&("DACC")
RETURN 0
Have you tested it?
druzus:/tmp# hbrun tst.prg
aa->DACC : hello
aa->&("DACC") : hello
druzus:/tmp#
druzus:/tmp# harbour -n -gh tst.prg
Harbour 2.1.0dev (Rev. 14184)
Copyright (c) 1999-2010, http://www.harbour-project.org/
Compiling 'tst.prg'...
Lines 11, Functions/Procedures 1
Generating Harbour Portable Object source output to 'tst.hrb'... Done.
druzus:/tmp# hbrun tst.hrb
aa->DACC : hello
aa->&("DACC") : hello
druzus:/tmp#
So it _confirms_ that you information about different in compiler when
HRB files are generated was completely wrong !!!
BTW technically such difference is impossible because compiler internally
generates _ONLY_ .HRB files which is native raw format for Harbour and
when -gc[N] switch is used then generated code is translated to .c code
as PCODE encapsulated in C functions (-gc[0-2]) or as C code directly
calling HVM functions (-gc3)
best regards,
Przemek
Hbrun tst.prg does work.
Compiled version does NOT!
(please see below tests)
WORKING -------------------------------------
C:\DEV\Harbour\Mytests>hbrun tst.prg
aa->DACC : hello
aa->&("DACC") : hello
Press any key to continue...
C:\DEV\Harbour\Mytests>
NOT WORKING -------------------------------------
C:\DEV\Harbour\Mytests>hbmk2 tst.prg
hbmk2: Processing configuration: C:\Harbour\bin\hbmk.cfg
Harbour 2.1.0dev (Rev. 14220)
Copyright (c) 1999-2010, http://www.harbour-project.org/
Compiling 'tst.prg'...
Lines 13, Functions/Procedures 1
Generating C source output to 'E:\WIN_TEMP\tst.c'... Done.
C:\DEV\Harbour\Mytests>tst
aa->DACC : hello
Error BASE/1449 Syntax error: &
Called from MAIN(9)
C:\DEV\Harbour\Mytests>
----------------------------------------------------------------------
Exactly the same error generates the line:
Public &mVar. := Len(_HMG_SYSDATA [ 66 ]) + 1
regards,
---
Pete
_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour