Off Topic: Difference hb_aScan() with value and hb_aScan() with codeblock

58 views
Skip to first unread message

José Quintas

unread,
Aug 29, 2025, 4:15:55 PMAug 29
to Harbour Minigui
Changing one library to OOP, I found this interesting difference.

aList := { 0, "A", { 0,0 }, Nil }

? hb_AScan( aList, "A" )

? hb_AScan( aList, { | e | e == "A" }  )

No error on direct access.
Error when using codeblock.

And on OOP, most common usage is using codeblock
Solution:
hb_AScan( aList, { | e | ValType( e ) == "C" .AND. e == "A" }  )

José M. C. Quintas
Reply all
Reply to author
Forward
0 new messages