To Nages Understand XBrowse tree with dbf

To Nages Understand XBrowse tree with dbf

Postby Silvio.Falconi » Tue Mar 19, 2013 8:56 pm

I have this database

Image


codazie character 5
Densoc character 30

I have a pricipal level 00 with this description

CodAzi Densoc
----------------------------------------------------------
00 "Indirizzi utili per regioni "

this level has 4 levels
10
20
30
40

each sublevel with has another level sample 101 or 202 or 402

and each another level sample 10101 or 10102 or 10103


On oldest fwh(16 bit) I used a listbox with tree class but now I cannot compile it
because not run ok ( perhaps there is something changed from otree listbox 16 bit version)

Now I wish create it with xbrowse


When I create the otree I used this function


Code: Select all  Expand view


Function BuildTree( oTree, oLbxTree )

       oTree:= TreeBegin( "Folder1","Folder2","Folder3")

   DO WHILE ! PROVVE->(Eof())
      _TreeItem (AllTrim (PROVVE->CODAZI)+"."+PROVVE->DENSOC, "DBFs",,,, .F.)
      TreeBegin(,)
      PROVVE->(dbSkip())

     DO WHILE LEN(AllTrim(PROVVE->CODAZI)) == 2 .AND. ! PROVVE->(Eof())
        _TreeItem (AllTrim (PROVVE->CODAZI)+"."+PROVVE->DENSOC, "DBFs",,,, .F.)
        *_TreeItem (PROVVE->DENSOC, "DBFs",,,, .F.)
         TreeBegin(, )
         PROVVE->(dbSkip())

         DO WHILE LEN(AllTrim(PROVVE->CODAZI)) == 3 .AND. ! PROVVE->(Eof())
            _TreeItem (AllTrim (PROVVE->CODAZI)+"."+PROVVE->DENSOC, "LIB",,,, .F.)
            *_TreeItem (PROVVE->DENSOC, "LIB",,,, .F.)
             TreeBegin(, )
             PROVVE->(dbSkip())


         DO WHILE LEN(AllTrim(PROVVE->CODAZI)) >= 4 .AND. ! PROVVE->(Eof())
         * IF LEN(AllTrim(PROVVE->CODAZI)) >= 4
              _TreeItem (AllTrim (PROVVE->CODAZI)+"."+PROVVE->DENSOC, "LOB",,,, .F.)
              *_TreeItem (PROVVE->DENSOC, "LOB",,,, .F.)
        *   ENDIF

           PROVVE->(dbSkip())

          ENDDO
          TreeEnd()
     ENDDO
   TreeEnd()
   ENDDO
 TreeEnd()
    ENDDO
    TreeEnd()


    oTree:Expand()
      oLbxTree:SetTree( oTree )
      return nil

 





I made this test but not run ok


Code: Select all  Expand view
#include "FiveWin.ch"
#include "xBrowse.ch"

REQUEST DBFCDX
REQUEST DBFFPT

EXTERNAL  ordkeyno, ordkeycount,ordcreate,ordkeygoto



//---------------------//
Function Main()

    Local oBrw,oWnd
    RddSetDefault( "DBFCDX" )

    DEFINE WINDOW oWnd TITLE "Provve test"
    @0,0 XBROWSE oBrw OF oWnd
   
    WITH OBJECT oBrw
      :SetTree(BuildTree())
      :oTree:OpenAll()
      :CreateFromCode()
    END
   
    oWnd:oClient:=oBrw
    ACTIVATE WINDOW oWnd
Return NIL

//---------------------//
Function BuildTree()

    Local oTree,nTreeCount,nPrevLevel,nCurLevel,nLevelDiff
    Local i,j
           
Local aItems := {}

 
USE PROVVE ALIAS PROVVE NEW  SHARED
INDEX ON PROVVE->CODAZI TAG  PROVVE TO PROVVE
GO TOP

do while ! provve->(eof())
   aadd(aItems,{ (provve->codazi),1 ,(provve->densoc)} )
   provve->(dbskip())
   enddo


                 
                   
    TREE oTree  
    nLevel:=aItems[1][2]
    nTreeCount:=0            
    For i:=1 to Len(aItems)
        if aItems[i][2] > nLevel
            TREE
            nTreeCount++
        Elseif aItems[i][2] < nLevel
            nPrevLevel:=nLevel
            nCurLevel:=aItems[i][2]
            nLevelDiff:=nPrevLevel-nCurLevel
            For j:=1 to nLevelDiff
                ENDTREE
                nTreeCount--
            Next
        Endif
        TREEITEM aItems[i][3] CARGO { aItems[i][1] }  // Item Code
        nLevel:=aItems[i][2]
    Next
    if nTreeCount > 0
       For i:=nTreeCount To 1 Step -1
          ENDTREE
       Next
    Endif
    ENDTREE
Return oTree
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: 7004
Joined: Thu Oct 18, 2012 7:17 pm

Re: To Nages Understand XBrowse tree with dbf

Postby nageswaragunupudi » Wed Mar 20, 2013 4:36 am

Please try this:
Code: Select all  Expand view
#include "FiveWin.Ch"
#include "xbrowse.ch"

//----------------------------------------------------------------------------//

REQUEST DBFCDX

//----------------------------------------------------------------------------//

function Main()

   FIELD CODAZI

   local oWnd, oBrw
   local oTree

   SET DELETED ON

   USE PROVVE NEW SHARED READONLY VIA "DBFCDX"
   INDEX ON CODAZI TAG CODAZI TEMPORARY TO TMP
   GO TOP
   oTree    := PROVVE->( BuildTree() )
   CLOSE PROVVE
   //

   oTree:Expand( 2 )

   DEFINE WINDOW oWnd
   @ 0,0 XBROWSE oBrw OF oWnd DATASOURCE oTree CELL LINES NOBORDER

   ADD TO oBrw DATA oBrw:oTreeItem:Cargo[ 1 ] HEADER "INDIRI"
   ADD TO oBrw DATA oBrw:oTreeItem:Cargo[ 2 ] HEADER "LOCALI"

   WITH OBJECT oBrw
      WITH OBJECT :aCols[ 1 ]
         :cHeader    := "CODAZI : DENSOC"
         :AddBitmap( { "c:\fwh\bitmaps\16fld2.bmp", ;
                       "c:\fwh\bitmaps\16fld.bmp",  ;
                       "c:\fwh\bitmaps\16info.bmp"  } )
      END
      :CreateFromCode()
   END
   oWnd:oClient      := oBrw

   ACTIVATE WINDOW oWnd MAXIMIZED

return (0)

//----------------------------------------------------------------------------//

static function BuildTree()

   field CODAZI, DENSOC, INDIRI, LOCALI

   local oTree
   local c1, c2, c3

   GO TOP
   TREE oTree
      TREEITEM CODAZI + ' : ' + DENSOC CARGO { INDIRI, LOCALI }
      TREE
      SKIP
      do while ! eof()
         TREEITEM CODAZI + ' : ' + DENSOC CARGO { INDIRI, LOCALI }
         c1       := LEFT( CODAZI, 1 )
         TREE
         SKIP
         do while Left( CODAZI, 1 ) == c1 .and. ! eof()
            TREEITEM CODAZI + ' : ' + DENSOC CARGO { INDIRI, LOCALI }
            TREE
            c2    := LEFT( CODAZI, 3 )
            SKIP
            do while Left( CODAZI, 3 ) == c2 .and. ! eof()
               TREEITEM CODAZI + ' : ' + DENSOC CARGO { INDIRI, LOCALI }

               SKIP
            enddo
            ENDTREE
         enddo
         ENDTREE
      enddo
      ENDTREE
   ENDTREE

return oTree

//----------------------------------------------------------------------------//
 
Regards

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

Re: To Nages Understand XBrowse tree with dbf

Postby Silvio.Falconi » Wed Mar 20, 2013 1:18 pm

Why If I add a new record it not run
I add 50 Schools

it's is a second level
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: 7004
Joined: Thu Oct 18, 2012 7:17 pm

Re: To Nages Understand XBrowse tree with dbf

Postby Silvio.Falconi » Thu Mar 28, 2013 9:20 am

Nages I have another strange error
I use two field to draw a MAp

this picture is drawed by me to see what I wish

Image

I made many test and then
I found the problem is on Xbrowse Tree

because I made two test

First with NO TREE and on xbrowse and I can draw all regions of the Map as you can see here

Image



Second with Tree on Xbowse and it not draw any zone into map

Image

If YOU Why ?
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: 7004
Joined: Thu Oct 18, 2012 7:17 pm

Re: To Nages Understand XBrowse tree with dbf

Postby nageswaragunupudi » Thu Mar 28, 2013 10:03 am

Pls send me the dbfs and ur application with details
Regards

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

Re: To Nages Understand XBrowse tree with dbf

Postby Silvio.Falconi » Thu Mar 28, 2013 2:49 pm

Mr Nages I sent it you yesterday

and now I sent you an other explain
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: 7004
Joined: Thu Oct 18, 2012 7:17 pm

Re: To Nages Understand XBrowse tree with dbf

Postby nageswaragunupudi » Thu Mar 28, 2013 4:38 pm

This code works
Code: Select all  Expand view
#include "fivewin.ch"
#include "hbcompat.ch"
#include "xbrowse.ch"

REQUEST DBFCDX

//----------------------------------------------------------------------------//

function Main()

   local oDlg, oFont, oBmp, oBrw
   local oTree

   oTree       := BuildTree()

   DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14
   DEFINE DIALOG oDlg SIZE 900,400 PIXEL FONT oFont

   @ 10, 10 BITMAP oBmp FILENAME "CARTINA.BMP" OF oDlg UPDATE PIXEL SIZE 127, 179 NOBORDER
   @ 00,140 XBROWSE oBrw SIZE -10,-10 PIXEL OF oDlg DATASOURCE oTree LINES NOBORDER

   oBmp:bPainted := { |hDC| If( Empty( oBrw:oTreeItem:Cargo[ 5 ] ), nil, ;
   FloodFill( hDC, oBrw:oTreeItem:Cargo[ 5 ], oBrw:oTreeItem:Cargo[ 6 ], nil, CLR_RED ) ) }

   ADD TO oBrw DATA oBrw:oTreeItem:Cargo[ 1 ] HEADER "INDIRI"

   WITH OBJECT oBrw
      WITH OBJECT :aCols[ 1 ]
          :cHeader    := "DENSOC"
          :AddBitmap( { "c:\fwh\bitmaps\16fld2.bmp", ;
                        "c:\fwh\bitmaps\16fld.bmp",  ;
                        "c:\fwh\bitmaps\16info.bmp"  } )
      END
      :nStretchCol   := 1
      :bChange       := { || oBmp:Refresh() }
      :CreateFromCode()
   END

   ACTIVATE DIALOG oDlg CENTERED ON INIT ( oBrw:SetFocus(), .f. )
   RELEASE FONT oFont

return nil

//----------------------------------------------------------------------------//

static function BuildTree()

   field CODAZI, DENSOC, INDIRI, LOCALI ,CAP, PROV, POSX, POSY

   local oTree
   local c1,c2,c3
   local x := 0, y := 0

   USE UFFICI NEW SHARED READONLY
   INDEX ON CODAZI TAG CODAZITMP TO TMP MEMORY
   GO TOP
   TREE oTree
   TREEITEM DENSOC CARGO { INDIRI, LOCALI ,CAP, PROV, 0, 0 }
      TREE
      SKIP
      do while ! eof()
         TREEITEM DENSOC CARGO { INDIRI, LOCALI ,CAP, PROV, 0, 0 }
         c1       := LEFT( CODAZI, 1 )
         TREE
         SKIP
         do while Left( CODAZI, 1 ) == c1 .and. ! eof()
            TREEITEM DENSOC CARGO { INDIRI, LOCALI ,CAP, PROV, x := POSX, y := POSY }
            TREE
            c2    := LEFT( CODAZI, 3 )
            SKIP
            do while Left( CODAZI, 3 ) == c2 .and. ! eof()
               TREEITEM DENSOC CARGO { INDIRI, LOCALI ,CAP, PROV, x, y }
               SKIP

            enddo
            ENDTREE
         enddo
         ENDTREE
      enddo
      ENDTREE
   ENDTREE
   CLOSE UFFICI
   oTree:Expand( 3 )

return oTree

//-------------------------------------------------//
 
Regards

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

Re: To Nages Understand XBrowse tree with dbf

Postby Silvio.Falconi » Thu Mar 28, 2013 9:03 pm

thanks now run ok and I believed I found a bug on xbrowse....:)
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: 7004
Joined: Thu Oct 18, 2012 7:17 pm

Re: To Nages Understand XBrowse tree with dbf

Postby ukoenig » Fri Mar 29, 2013 4:25 pm

Hello
I would like to create a english sample, using different country maps.
Compiling the sample above, it doesn't work at all.
Maybe it is possible, to sent me a working sample ( Email ) to create a new one ?

Error description: Error BASE/1005 Class: 'NIL' has no property: OPREV
Args:
[ 1] = U
[ 2] = O TTREEITEM

Stack Calls
===========
Called from: => _OPREV( 0 )
Called from: .\source\classes\TREES.PRG => TREEEND( 72 )
Called from: .\Fillarea.PRG => BUILDTREE( 83 )
Called from: .\Fillarea.PRG => MAIN( 20 )

Best regards
Uwe :?:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: To Nages Understand XBrowse tree with dbf

Postby nageswaragunupudi » Fri Mar 29, 2013 6:21 pm

This error occurs when there is an EndTree without a corresponding (begin) TREE.
Please carefully check your code visavis your data.
Regards

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

Re: To Nages Understand XBrowse tree with dbf

Postby ukoenig » Fri Mar 29, 2013 6:49 pm

Mr. Rao,

I used Your original Function without any changes

The error occurs in line endtree from the defined tree

DO WHILE ! eof()
TREEITEM DENSOC CARGO { INDIRI, LOCALI ,CAP, PROV, 0, 0 }
c1 := LEFT( CODAZI, 1 )
TREE

Code: Select all  Expand view

STATIC FUNCTION BUILDTREE()

field CODAZI, DENSOC, INDIRI, LOCALI ,CAP, PROV, POSX, POSY

local oTree
local c1,c2,c3
local x := 0, y := 0

USE UFFICI NEW SHARED READONLY
INDEX ON CODAZI TAG CODAZITMP TO TMP MEMORY
GO TOP
TREE oTree
   TREEITEM DENSOC CARGO { INDIRI, LOCALI ,CAP, PROV, 0, 0 }
   TREE
      SKIP
      DO WHILE ! eof()
         TREEITEM DENSOC CARGO { INDIRI, LOCALI ,CAP, PROV, 0, 0 }
         c1 := LEFT( CODAZI, 1 )
         TREE
            SKIP
            DO WHILE Left( CODAZI, 1 ) == c1 .and. ! eof()
               TREEITEM DENSOC CARGO { INDIRI, LOCALI ,CAP, PROV, x := POSX, y := POSY }
               TREE
                  c2    := LEFT( CODAZI, 3 )
                  SKIP
                  DO WHILE Left( CODAZI, 3 ) == c2 .and. ! eof()
                     TREEITEM DENSOC CARGO { INDIRI, LOCALI ,CAP, PROV, x, y }
                      SKIP
                  ENDDO
               ENDTREE
            ENDDO
         ENDTREE   // ERROR !!!!!
      ENDDO
   ENDTREE
ENDTREE

CLOSE UFFICI
oTree:Expand( 3 )

RETURN OTREE
 


Best Regards
Uwe :?:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: To Nages Understand XBrowse tree with dbf

Postby nageswaragunupudi » Fri Mar 29, 2013 7:54 pm

Are you using the same DBF Silvio sent me? Please check with him. He says it is working for him
Regards

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

Re: To Nages Understand XBrowse tree with dbf

Postby ukoenig » Fri Mar 29, 2013 8:34 pm

NO, I don't have this DBF.
I asked Silvio, but didn't get it.
Maybe I have to create a new sample, starting from the beginning.
I created a DBF with this structure for a test :

cDbf := c_Path + "\UFFICI.DBF"
IF ! File( cDbf )
aCols := { ;
{ "CODAZI", 'C', 5, 0 }, ;
{ "DENSOC", 'C', 30, 0 }, ;
{ "INDIRI", 'C', 20, 0 }, ;
{ "LOCALI", 'C', 20, 0 }, ;
{ "CAP", 'C', 20, 0 }, ;
{ "PROV", 'C', 20, 0 }, ;
{ "POSX", 'N', 3, 0 }, ;
{ "POSY", 'N', 3, 0 } }


Thank You
Uwe :?:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: To Nages Understand XBrowse tree with dbf

Postby Silvio.Falconi » Fri Mar 29, 2013 8:44 pm

yes it is right

but I saw you must insert 3 records to run ok

first record
codazi := 00
densoc:=offices

second record
codazi := 10
densoc:=offices1

third record
codazi := 101
densoc:=region1


only to third record you can insert the coordinates to draw the bmp
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: 7004
Joined: Thu Oct 18, 2012 7:17 pm

Re: To Nages Understand XBrowse tree with dbf

Postby ukoenig » Fri Mar 29, 2013 9:30 pm

Same error, doesn't work
It would be nice, to create a new < english > sample with some country-maps.

Error description: Error BASE/1005 Class: 'NIL' has no property: OPREV
Args:
[ 1] = U
[ 2] = O TTREEITEM


I only want to use it as a working sample
that gives me the basics, to create a new one with country-selection and more.

Code: Select all  Expand view

#include "fivewin.ch"
#include "hbcompat.ch"
#include "xbrowse.ch"
#include "Image.ch"

REQUEST DBFCDX

STATIC c_Path

//----------------------------------------------------------------------------//

FUNCTION MAIN()
local oDlg, oFont, oBmp, oBrw
local oTree

c_path := GETCURDIR()  

CHECKDBF()

oTree   := BuildTree()

DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14
DEFINE DIALOG oDlg SIZE 900,400 PIXEL FONT oFont

@ 10, 10 BITMAP oBmp FILENAME "MAP_EUROPA.PNG" OF oDlg UPDATE PIXEL SIZE 127, 179 NOBORDER
@ 00,140 XBROWSE oBrw SIZE -10,-10 PIXEL OF oDlg DATASOURCE oTree LINES NOBORDER

oBmp:bPainted := { |hDC| If( Empty( oBrw:oTreeItem:Cargo[ 5 ] ), nil, ;
FloodFill( hDC, oBrw:oTreeItem:Cargo[ 5 ], oBrw:oTreeItem:Cargo[ 6 ], nil, CLR_RED ) ) }

ADD TO oBrw DATA oBrw:oTreeItem:Cargo[ 1 ] HEADER "INDIRI"

WITH OBJECT oBrw
    WITH OBJECT :aCols[ 1 ]
        :cHeader    := "DENSOC"
        :AddBitmap( { c_Path + "\fld2.bmp", ;
                       c_Path + "\fld.bmp",  ;
                       c_Path + "\info.bmp"  } )
    END
    :nStretchCol   := 1
    :bChange       := { || oBmp:Refresh() }
    :CreateFromCode()
END

ACTIVATE DIALOG oDlg CENTERED ON INIT ( oBrw:SetFocus(), .f. )
RELEASE FONT oFont

RETURN NIL

//----------------------------------------------------------------------------//

STATIC FUNCTION BUILDTREE()

field CODAZI, DENSOC, INDIRI, LOCALI ,CAP, PROV, POSX, POSY

local oTree
local c1,c2,c3
local x := 0, y := 0

USE UFFICI NEW SHARED READONLY
INDEX ON CODAZI TAG CODAZITMP TO TMP MEMORY
GO TOP
TREE oTree
    TREEITEM DENSOC CARGO { INDIRI, LOCALI ,CAP, PROV, 0, 0 }
    TREE
        SKIP
        DO WHILE ! eof()
            TREEITEM DENSOC CARGO { INDIRI, LOCALI ,CAP, PROV, 0, 0 }
            c1 := LEFT( CODAZI, 1 )
            TREE
                SKIP
                DO WHILE Left( CODAZI, 1 ) == c1 .and. ! eof()
                    TREEITEM DENSOC CARGO { INDIRI, LOCALI ,CAP, PROV, x := POSX, y := POSY }
                    TREE
                        c2    := LEFT( CODAZI, 3 )
                        SKIP
                        DO WHILE Left( CODAZI, 3 ) == c2 .and. ! eof()
                            TREEITEM DENSOC CARGO { INDIRI, LOCALI ,CAP, PROV, x, y }
                            SKIP
                        ENDDO
                    ENDTREE
                ENDDO
            ENDTREE
         ENDDO
    ENDTREE
ENDTREE

CLOSE UFFICI
oTree:Expand( 3 )

RETURN OTREE

//----------------------------------------------------------------------------//

STATIC FUNCTION CHECKDBF()

local cDbf, aCols, c

//but I saw you must insert 3 records to run ok

//first record
//codazi := 00
//densoc:=offices

//second record
//codazi := 10
//densoc:=offices1

//third record
//codazi := 101
//densoc:=region1


cDbf := c_Path + "\UFFICI.DBF"
IF ! File( cDbf )
    aCols    := { ;
         {  "CODAZI",    'C',  5, 0  }, ;
         {  "DENSOC",    'C',  30, 0  }, ;
         {  "INDIRI",    'C',  20, 0  }, ;
         {  "LOCALI", 'C', 20, 0  }, ;
         {  "CAP", 'C', 20, 0  }, ;
         {  "PROV", 'C', 20, 0  }, ;
         {  "POSX",    'N', 3, 0  }, ;
         {  "POSY",    'N', 3, 0  }  }

    DBCREATE( cDbf, aCols )
    USE ( cDbf ) NEW EXCLUSIVE
    INDEX ON INDIRI TAG INDIRI
    USE
    USE ( cDbf ) NEW EXCLUSIVE
    APPEND BLANK
    FIELD->CODAZI       := "00"
    FIELD->DENSOC   := "offices"
    FIELD->INDIRI       := "Test"
    FIELD->LOCALI       := "Test"
    FIELD->CAP          := "Test"
    FIELD->PROV     := "Test"
    FIELD->POSX     := 100
    FIELD->POSY     := 100
    APPEND BLANK
    FIELD->CODAZI       := "10"
    FIELD->DENSOC   := "offices1"
    FIELD->INDIRI       := "Test"
    FIELD->LOCALI       := "Test"
    FIELD->CAP          := "Test"
    FIELD->PROV     := "Test"
    FIELD->POSX     := 100
    FIELD->POSY     := 100
    APPEND BLANK
    FIELD->CODAZI       := "101"
    FIELD->DENSOC   := "region1"
    FIELD->INDIRI       := "Test"
    FIELD->LOCALI       := "Test"
    FIELD->CAP          := "Test"
    FIELD->PROV     := "Test"
    FIELD->POSX     := 100
    FIELD->POSY     := 100
    CLOSE DATA
ENDIF

RETURN NIL
 


Regards
Uwe :?:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 31 guests