Viktor Szakáts wrote:
IMO HB_FIELDGET() should return NIL if the name
doesn't exist, just like FIELDGET() returns NIL
if the field position doesn't exist.
I didn't recheck all places, but quick review
shows that my code actually relies on this Clipper
feature, so adding RTE would require to rethink
some lower level functions
Hi,
I do not use any FIELDGET(), FIELDPUT() on fields that do not exists,
so, I also like the idea of RTE, that helps find bug more quick. But I'm
interested in what cases do you use (rely on) the Clippers behavior of
"do nothing" field access/assignment using:
FIELDPUT(FIELDPOS("i_do_not_exist"), value)
Regards,
Mindaugas
P.S. just brain storming... The main difference between
FIELDGET(FIELDPOS("NAME")) and FIELD->NAME is that NAME is "solved" to
symbol at compile time. This do part of the job and also saves some
memory (two bytes of symbol number in PCODE instead of push string).
Some functions do not have possibility to use advantage of solving name
to symbol at compile time. F.e., DBSELECTAREA("alias") accepts a string
only, but theoretically it is possible to compile "alias" to symbol.
Unfortunately there is no way to do: DBSELECTAREA(@alias()). I remember
I've wrote some hacky function in Clipper:
alias->(DBSELECTAREASYMBOL())
that manipulates stack to not restore the original area, thus giving
functionality of area change using symbol.
_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour