Hello Valtecom,
Maybe you can use 'This.Name' in the action function, like ONCLICK ButtonClick(This.Name) and in the function ButtonClick use the variable This.Name to detect which button is clicked.
Kind regards,
René Koot
Uberaba MG Brazil --
Visit our website on https://www.hmgextended.com/ or https://www.hmgextended.org/
---
You received this message because you are subscribed to the Google Groups "Harbour Minigui" group.
To unsubscribe from this group and stop receiving emails from it, send an email to minigui-foru...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/minigui-forum/ab02e83e-adf7-4d55-bdc9-a0e10ec1d281n%40googlegroups.com.
There exists a detail about code blocks and variable:
if you create codeblock on this way:
FOR nCont = 1 TO 10
bCode := { || DoClick( nCont ) }
NEXT
result will be 11 on each click.
It is because codeblock will use variable value on execution, and it will be 11
You need to isolate the value, or using a function to create a codeblock, or a FOR/EACH that does the same thing.
FOR nCont = 1 TO 10
bCode := CreateCodeblock( nCont )
NEXT
...
FUNCTION CreateCodeblock( xValue ) // this xvalue have a unique
value
LOCAL bCode
bCode := { || DoClick( xValue ) }
RETURN bCode
Another not common way is to use this feature on FOR/EACH, only to isolate the variable.
FOR nCont = 1 TO 10 // ncont change value
FOR EACH xValue IN { nCont } // here xvalue will use ncont, but xvalue will have a unique value
bCode := { || DoClick( xValue ) }
NEXT
NEXT
Make a single test, on a single module, can be console.
Don't confuse STRING/CAPTION with codeblock
FOR nCont = 1 TO 10
bCode := { || nCont }
NEXT
FOR nCont = 1 TO 10
? Eval( bCode )
NEXT
Test the 3 routines posted here, and you will see the difference.
José M. C. Quintas
--
Visit our website on https://www.hmgextended.com/ or https://www.hmgextended.org/
---
You received this message because you are subscribed to the Google Groups "Harbour Minigui" group.
To unsubscribe from this group and stop receiving emails from it, send an email to minigui-foru...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/minigui-forum/918cea7f-596b-409d-bd64-d264b835d2f0n%40googlegroups.com.


