[Harbour-users] Re: how to ?

Antonio Martinez alcisoft at arrakis.es
Tue Jan 26 10:21:56 EST 2010


Itamar,

The trick is detached locals: A function returns a codeblock for each n

FOR n:= 1 TO 100

      @ x, y ......... ON CLICK FunDetached(oOwB, oHora, n)

NEXT
*
FUNCTION FunDetached(oOwB, oHora, n)
RETURN {|| MyFunc(oOwB, oHora, n) }
*
*
FUNCTION MyFunc(oOwB, oHora, n)
RETURN Mesa(oOwB, oHora, n)


Regards


Itamar Lins escribió en mensaje ...
>No, because oOwB change N times and Myfunc2 will return only the last.
>For example
>
>For n = 1 to 100
>...
>          @ x,y OwnerButton &oMesa of oDlgMesas Text cAtende+'
>'+strzero(nCount,3) Coordinates 00,45,20,15 Size 60,60 ;
>          ON CLICK {||mesa(&oOwB , oHora)} FLAT BITMAP cMesa TRANSPARENT
>COORDINATES 0,0,41,41
>...
>{||mesa(&oOwB)} //so it works well
>{||mesa(&oOwB,oHora)} //so it not works
>
>Next
>
>it should be changed at runtime!
>
>Regards,
>Itamar M. Lins Jr.
>
>"Antonio Martinez" <alcisoft at arrakis.es>
>escreveu na mensagem news:hjm87k$bhu$1 at ger.gmane.org...
>> Itamar,
>>
>> do you like a  workaround ?
>>
>> {|| MyFunc(oOwB, oObj) }
>>
>> FUNCTION MyFun(oOwB, oObj)
>> RETURN MyFunc2(&oOwB, oObj)
>>
>> Regards
>>
>>
>>
>> Itamar Lins escribió en mensaje ...
>>>Hi!
>>>how to resolve this is question?
>>>
>>>{||MyFunc(&oOwB , oObj)}
>>>
>>> Error E0047  Code block contains both macro and declared symbol
>> references.
>>>
>>>Best regards,
>>>Itamar M. Lins Jr.





More information about the Harbour-users mailing list