Write a Block

Write a Block

Postby Silvio.Falconi » Wed Jun 26, 2019 6:52 am

I need to return from a function a codeBlock type

{|| oCustomer:First }

but I Know the oDbf ( tdatabase ) and I have an array where are the fields of this archive

so I have :
Function bCampo( aCampos, nFor,oDbf)
return oDbf:fieldWBlock(aCampos[nFor] )


but this expression oDbf:fieldWBlock(aCampos[nFor] ) not run ok

it not make error and then on Report I have a white list
Image

I have this problem using Tdatabase with normal Use it run ok

how I can resolve ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7075
Joined: Thu Oct 18, 2012 7:17 pm

Re: Write a Block

Postby nageswaragunupudi » Wed Jun 26, 2019 2:16 pm

We suggest this approach for making reports using TDatabase.
Code: Select all  Expand view  RUN

   local oRep, oStates

   oStates  := TDatabase():Open( nil, "STATES", "DBFCDX", .T. )

   oStates:GoTop()

   REPORT oRep PREVIEW

   COLUMN TITLE "CODE" DATA oStates:Code
   COLUMN TITLE "NAME" DATA oStates:name

   ENDREPORT

   oRep:bSkip  := { || oStates:Skip( 1 ) }

   ACTIVATE REPORT oRep WHILE !oStates:Eof()

   oStates:End()
 


If you do not want a simple, straightforward and reliable approach and you insist on complicating your programs it is up to you.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10654
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Write a Block

Postby nageswaragunupudi » Wed Jun 26, 2019 3:07 pm

FieldWBlock( cFieldName, oDbf:nArea )
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10654
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Write a Block

Postby Silvio.Falconi » Thu Jun 27, 2019 10:16 am

I made


function bCampo2( aFields, nFor,oDbf)
return oDbf:fieldWBlock(aField[nFor] )

and seem run , it's wrong ?

>If you do not want a simple, straightforward and reliable approach and you insist on complicating your programs it is up to you.

I don't complicate my life, it's just that for years I've used functions to fend off prints, for example, and now in my head it's saved somewhere in the memory that I have to use those commands to make prints, it's as if it came automatically and if I do something that my memory refuses it creates problems and as you say I complicate my life ... and I do all kinds of mess !! but you, I know you love me, you are patient with me,allways!!!
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7075
Joined: Thu Oct 18, 2012 7:17 pm

Re: Write a Block

Postby nageswaragunupudi » Thu Jun 27, 2019 11:52 am

Code: Select all  Expand view  RUN
function bCampo2( aFields, nFor,oDbf)
return fieldWBlock( aField[nFor], oDbf:nArea )
 


I still advise you to use the sample I posted and please change your habit.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10654
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], nageswaragunupudi and 59 guests