Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.clipper.visual-objects > #4062
| Path | csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!nuzba.szn.dk!pnx.dk!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail |
|---|---|
| From | "Wolfgang Riedmann" <wriedmann@gmail.com> |
| Newsgroups | comp.lang.clipper.visual-objects |
| Subject | Re: Resolving macro |
| Date | 5 Sep 2012 06:28:27 GMT |
| Lines | 43 |
| Message-ID | <aao9oaF2mmU1@mid.individual.net> (permalink) |
| References | <e7c3ec46-c217-496a-999a-7d7bf5182cf0@googlegroups.com> <92d66259-b70b-4dda-8fcd-df94472fea23@googlegroups.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=utf-8 |
| X-Trace | individual.net 6kukFSS0GMnmQXyiUyMSBQ75pgeeLknOlI2acF6FePe/S4rTKTWalZsYyFukbmd3I= |
| Cancel-Lock | sha1:MyW2MzrRyv1fCLss+Z/OMbJDMhY= |
| User-Agent | XanaNews/1.18.1.6 |
| Xref | csiph.com comp.lang.clipper.visual-objects:4062 |
Show key headers only | View raw
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