fieldWBlock

fieldWBlock

Postby Silvio.Falconi » Tue Nov 17, 2020 12:57 pm

I not understood how work fieldWBlock
before run ok and now not run

I wish print a field using fieldWBlock

Code: Select all  Expand view

#include "fivewin.ch"

REQUEST DBFCDX


Function test()
 local acampi :=   {"FIRST"   ,;
                      "LAST"    ,;
                      "STREET"  ,;
                      "CITY"    ,;
                      "STATE"   ,;
                      "ZIP"     ,;
                      "HIREDATE",;
                      "MARRIED" ,;
                      "AGE"     ,;
                      "SALARY"  ,;
                      "NOTES"    }

local nFor:=1// first
 local oPrn
local oFont
local oBold

 USE CUSTOMER NEW alias cust SHARED VIA "DBFCDX"


PRINT oPrn PREVIEW

   DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14 OF oPrn
   DEFINE FONT oBold NAME "VERDANA" SIZE 0,-25 BOLD OF oPrn

   PAGE

    @ 10, 10 PRINT TO oPrn TEXT bCampo( aCampi, nFor,1 ) ;
                SIZE 100, 100 CM ALIGN "T" FONT oFont

      ENDPAGE
       ENDPRINT

   RELEASE FONT oFont, oBold


return nil

function bCampo( aCampi, nFor,nArea )
   return (fieldWBlock(aCampi[nFor],nArea ))

 


I tried also with fieldWBlock( "FIRST",1 )
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: 6772
Joined: Thu Oct 18, 2012 7:17 pm

Re: fieldWBlock

Postby ADutheil » Tue Nov 17, 2020 2:10 pm

Try
eval(fieldWBlock(aCampi[nFor],nArea ))
Regards,

André Dutheil
FWH 13.04 + HB 3.2 + MSVS 10
ADutheil
 
Posts: 368
Joined: Sun May 31, 2009 6:25 pm
Location: Salvador - Bahia - Brazil

Re: fieldWBlock

Postby Silvio.Falconi » Tue Nov 17, 2020 5:07 pm

perhaps fieldget(n)
but I need to have the naArea
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: 6772
Joined: Thu Oct 18, 2012 7:17 pm

Re: fieldWBlock

Postby karinha » Tue Nov 17, 2020 8:53 pm

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7214
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: fieldWBlock

Postby Silvio.Falconi » Wed Nov 18, 2020 2:53 pm



nCampo:= 2
aFields := {"FIRST" ,;
"LAST" ,;
"STREET" ,;
"CITY" ,;
"STATE" ,;
"ZIP" ,;
"HIREDATE",;
"MARRIED" ,;
"AGE" ,;
"SALARY" ,;
"NOTES" }



this Run ok if I wish print a barcode

Code: Select all  Expand view
nCampo:= 2
FIELDWBLOCK( ncampo, SELECT( "CUST" ) )


sample :

@ nRiga, nColonna PRINT TO oPrn TEXT FIELDWBLOCK( ncampo, SELECT( "CUST" ) ) ;
AS BARCODE TYPE "EAN8" ;
SIZE nWid-nCo, nHei CM BARSIZE nWid


If I wish print a text run with

Code: Select all  Expand view

 FIELDWBLOCK( aFields[nCampo], SELECT( "CUST" ) )


sample :

@ nRiga, nColonna PRINT TO oPrn TEXT FIELDWBLOCK( aFields[ncampo], SELECT( "CUST" ) );
SIZE nWid, nHei CM ALIGN "T" FONT oFnt


it's very strange because I call allways the field number 2 ( Last)
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: 6772
Joined: Thu Oct 18, 2012 7:17 pm

Re: fieldWBlock

Postby ADutheil » Wed Nov 18, 2020 4:58 pm

FIELDWBLOCK("FName", 1) is the same as &( "{ |setVal| IF( setVal == NIL, 1->FName, 1->FName := setVal ) }" )

If you don't eval the block you'll not retrieve the content of the field.

@ nRiga, nColonna PRINT TO oPrn TEXT eval( FIELDWBLOCK( aFields[ncampo], SELECT( "CUST" ) ) );
SIZE nWid, nHei CM ALIGN "T" FONT oFnt
Regards,

André Dutheil
FWH 13.04 + HB 3.2 + MSVS 10
ADutheil
 
Posts: 368
Joined: Sun May 31, 2009 6:25 pm
Location: Salvador - Bahia - Brazil

Re: fieldWBlock

Postby Silvio.Falconi » Wed Nov 18, 2020 6:24 pm

ADutheil wrote:FIELDWBLOCK("FName", 1) is the same as &( "{ |setVal| IF( setVal == NIL, 1->FName, 1->FName := setVal ) }" )

If you don't eval the block you'll not retrieve the content of the field.

@ nRiga, nColonna PRINT TO oPrn TEXT eval( FIELDWBLOCK( aFields[ncampo], SELECT( "CUST" ) ) );
SIZE nWid, nHei CM ALIGN "T" FONT oFnt


I tried with eval make error
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: 6772
Joined: Thu Oct 18, 2012 7:17 pm

Re: fieldWBlock

Postby ADutheil » Wed Nov 18, 2020 8:27 pm

I took your initial example and rewrote a little:
Code: Select all  Expand view
#include "fivewin.ch"

REQUEST DBFCDX


Function main()
 local acampi :=   {"FIRST"   ,;
                      "LAST"    ,;
                      "STREET"  ,;
                      "CITY"    ,;
                      "STATE"   ,;
                      "ZIP"     ,;
                      "HIREDATE",;
                      "MARRIED" ,;
                      "AGE"     ,;
                      "SALARY"  ,;
                      "NOTES"    }

local nFor:=2

USE CUSTOMER NEW alias cust SHARED VIA "DBFCDX"


alert(  bCampo( aCampi, nFor,1 ) )


return nil

function bCampo( aCampi, nFor,nArea )
   return eval((fieldWBlock(aCampi[nFor],nArea )))
 

I works OK for me. The alert box shows Simpson
Regards,

André Dutheil
FWH 13.04 + HB 3.2 + MSVS 10
ADutheil
 
Posts: 368
Joined: Sun May 31, 2009 6:25 pm
Location: Salvador - Bahia - Brazil

Re: fieldWBlock

Postby ADutheil » Wed Nov 18, 2020 8:34 pm

This works perfectly for me.
Code: Select all  Expand view

#include "fivewin.ch"

REQUEST DBFCDX


Function main()
 local acampi :=   {"FIRST"   ,;
                      "LAST"    ,;
                      "STREET"  ,;
                      "CITY"    ,;
                      "STATE"   ,;
                      "ZIP"     ,;
                      "HIREDATE",;
                      "MARRIED" ,;
                      "AGE"     ,;
                      "SALARY"  ,;
                      "NOTES"    }

local nFor:=2

 local oPrn
local oFont
local oBold

 USE CUSTOMER NEW alias cust SHARED VIA "DBFCDX"


PRINT oPrn PREVIEW

   DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14 OF oPrn
   DEFINE FONT oBold NAME "VERDANA" SIZE 0,-25 BOLD OF oPrn

   PAGE

    @ 10, 10 PRINT TO oPrn TEXT bCampo( aCampi, nFor,1 ) FONT oFont

      ENDPAGE
       ENDPRINT

   RELEASE FONT oFont, oBold


return nil

function bCampo( aCampi, nFor,nArea )
   return eval((fieldWBlock(aCampi[nFor],nArea )))

 
Regards,

André Dutheil
FWH 13.04 + HB 3.2 + MSVS 10
ADutheil
 
Posts: 368
Joined: Sun May 31, 2009 6:25 pm
Location: Salvador - Bahia - Brazil

Re: fieldWBlock

Postby Silvio.Falconi » Fri Nov 20, 2020 7:35 am

ADutheil wrote:This works perfectly for me.
Code: Select all  Expand view

#include "fivewin.ch"

REQUEST DBFCDX


Function main()
 local acampi :=   {"FIRST"   ,;
                      "LAST"    ,;
                      "STREET"  ,;
                      "CITY"    ,;
                      "STATE"   ,;
                      "ZIP"     ,;
                      "HIREDATE",;
                      "MARRIED" ,;
                      "AGE"     ,;
                      "SALARY"  ,;
                      "NOTES"    }

local nFor:=2

 local oPrn
local oFont
local oBold

 USE CUSTOMER NEW alias cust SHARED VIA "DBFCDX"


PRINT oPrn PREVIEW

   DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14 OF oPrn
   DEFINE FONT oBold NAME "VERDANA" SIZE 0,-25 BOLD OF oPrn

   PAGE

    @ 10, 10 PRINT TO oPrn TEXT bCampo( aCampi, nFor,1 ) FONT oFont

      ENDPAGE
       ENDPRINT

   RELEASE FONT oFont, oBold


return nil

function bCampo( aCampi, nFor,nArea )
   return eval((fieldWBlock(aCampi[nFor],nArea )))

 


Also for me !!
When I tried to Print a BARCODE it make error
IT's very STRANGE because Barcode want code as text

sample
Code: Select all  Expand view
nWid:=0.2
@ 10, 10 PRINT TO oPrn TEXT  bCampo( aCampi, nFor,1 );
AS BARCODE TYPE "EAN8" ;
SIZE 3.6, 0.8  CM BARSIZE nWid
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: 6772
Joined: Thu Oct 18, 2012 7:17 pm

Re: fieldWBlock

Postby ADutheil » Sat Nov 21, 2020 8:18 pm

My FWH version is old and I'm not aware of the AS BARCODE command so I can't help you further.
Regards,

André Dutheil
FWH 13.04 + HB 3.2 + MSVS 10
ADutheil
 
Posts: 368
Joined: Sun May 31, 2009 6:25 pm
Location: Salvador - Bahia - Brazil

Re: fieldWBlock

Postby Silvio.Falconi » Mon Nov 23, 2020 8:06 pm

THERE IS SOMEONE CAN HELP ME PLS ?
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: 6772
Joined: Thu Oct 18, 2012 7:17 pm

Re: fieldWBlock

Postby ADutheil » Tue Nov 24, 2020 1:49 pm

As you want to print a barcode the function may be expecting a string of numbers not letters.
Regards,

André Dutheil
FWH 13.04 + HB 3.2 + MSVS 10
ADutheil
 
Posts: 368
Joined: Sun May 31, 2009 6:25 pm
Location: Salvador - Bahia - Brazil

Re: fieldWBlock

Postby Silvio.Falconi » Tue Nov 24, 2020 6:51 pm

ADutheil wrote:As you want to print a barcode the function may be expecting a string of numbers not letters.

I allready tried
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: 6772
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 105 guests