Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.clipper.visual-objects > #4062
| From | "Wolfgang Riedmann" <wriedmann@gmail.com> |
|---|---|
| Newsgroups | comp.lang.clipper.visual-objects |
| Subject | Re: Resolving macro |
| Date | 2012-09-05 06:28 +0000 |
| Message-ID | <aao9oaF2mmU1@mid.individual.net> (permalink) |
| References | <e7c3ec46-c217-496a-999a-7d7bf5182cf0@googlegroups.com> <92d66259-b70b-4dda-8fcd-df94472fea23@googlegroups.com> |
Hi Krystian,
it is a little bit hard to explain: variables, that are existent at the
time of the codeblock creation are not more reachable when the
codeblock is executed.
Therefore you need a possibility to store variables in the codeblock,
and with a normal codeblock this is not possible.
But instead of a codeblock you can pass also an object with an Eval
method to any function that requires a codeblock. This gives you the
possibility to store any variables you need in the object and retrieve
them at codeblock execution.
So this will work:
class MyDbCounter
export nCount as dword
method Eval() class MyDBCounter
++nCount
return true
function Start()
local oServer as DBServer
local oC as MyDbCounter
oServer := DBServer{ "any valid.dbf" }
oServer:GoTop()
oC := MyDBCounter{}
DebOut( "Count:" + NTrim( oC:nCount ) )
oServer:Eval( oC )
DebOut( "Count:" + NTrim( oC:nCount ) )
oServer:Close()
return
HTH
Wolfgang
Back to comp.lang.clipper.visual-objects | Previous | Next — Previous in thread | Find similar | Unroll thread
Resolving macro Krystian <softb@softb.pl> - 2012-09-02 15:30 -0700
Re: Resolving macro dlzc <dlzc1@cox.net> - 2012-09-02 19:28 -0700
Re: Resolving macro "Wolfgang Riedmann" <wriedmann@gmail.com> - 2012-09-03 06:15 +0000
Re: Resolving macro Krystian <softb@softb.pl> - 2012-09-04 13:35 -0700
Re: Resolving macro "Wolfgang Riedmann" <wriedmann@gmail.com> - 2012-09-05 06:28 +0000
csiph-web