Codeblock, function and macro

129 views
Skip to first unread message

Itamar Lins

unread,
Jun 19, 2024, 2:13:05 PM (14 days ago) Jun 19
to Harbour Users
Hi!
This code works fine.
Function xFunc(oDLG)
ON CLICK {|| MyFunction(&nPDV) } 
This not works, return error:
ON CLICK {|| MyFunction(&nPDV,oDLG) } //Error E0047  Code block contains both macro and declared symbol references 'ODLG'
...
Function xFunc
PARAMETERS oDlg
This while PARAMETERS works fine
ON CLICK {|| MyFunction(&nPDV,oDLG) }

Best regards,
Itamar M. Lins Jr.

roberto....@gmail.com

unread,
Jun 20, 2024, 5:01:44 AM (13 days ago) Jun 20
to Harbour Users
Itamar,
as far I know the "PARAMETERS oDlg" statement declares params as private variables while the syntactic form
"Function xFunc(oDLG)" declares oDlg as a local one.
So, the issue seems relative to visibility of the variable oDlg

Roberto

Maurizio la Cecilia

unread,
Jun 20, 2024, 6:32:39 AM (13 days ago) Jun 20
to Harbour User Group
Hi Itamar,
Roberto is right. 

If you hate as me private variables a better way is:

Function xFunc(oDLG)
ON CLICK {|oDlg| MyFunction(&nPDV,oDlg) } 

Best regards. 
--
Maurizio 

--
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: https://groups.google.com/group/harbour-users
---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/d8dd69f9-495d-4284-a707-df1c69a25664n%40googlegroups.com.

trepao2...@gmail.com

unread,
Jun 20, 2024, 6:41:19 AM (13 days ago) Jun 20
to Harbour Users
Please, show us preprocessed code
Reply all
Reply to author
Forward
0 new messages