print a value from dbf (fieldWBlock)

Post Reply
User avatar
Silvio.Falconi
Posts: 7133
Joined: Thu Oct 18, 2012 7:17 pm
Been thanked: 1 time

print a value from dbf (fieldWBlock)

Post by Silvio.Falconi »

I must return me the value of a field on a dbf


Image


this is a small test

Code: Select all | Expand


#include "FiveWin.ch"


REQUEST DBFCDX
     

Function test()
local odbf,cField,ctxt

     oDbf:=TDatabase():Open( , "Customer", "DBFCDX", .T. )
     oDbf:setorder(1)

     cField ="first"
     cField:=trim(cField)          
     ctxt:=bCampo( cfield,oDbf)  //give me an array

?ctxt

return nil

static function bCampo( cCampo,oDbf)
   return   oDbf:fieldWBlock(cCampo )
 



If I made

xbrowser ctxt


I see this

Image

If I made

?ctxt[1] or ?ctxt[1][1]

make error why ?


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
Antonio Linares
Site Admin
Posts: 42510
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 73 times
Contact:

Re: print a value from dbf (fieldWBlock)

Post by Antonio Linares »

Dear Silvio,

function bCampo() is returning a codeblock and that is what you see (not an array)

Simply evaluate the codeblock providing the parameters
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Silvio.Falconi
Posts: 7133
Joined: Thu Oct 18, 2012 7:17 pm
Been thanked: 1 time

Re: print a value from dbf (fieldWBlock)

Post by Silvio.Falconi »

opps sorry
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
Post Reply