[ Home ] [ Features ] [ Products ] [ FAQ's ] [ Screens ] [ Support ] [ Downloads ] [ About ] [ Discussion ]


the software that grows with you

 

V32Tb2Dbf()

Converts a Browser to a .dbf file.

Syntax

V32Tb2Dbf( <oBrowse>, <cFileDbf> )

Arguments

oBrowse A browser object created with TbrowseNew() or TBrowseDB() classes.. Vouch32 will consider the oColumn:block to retrieve the data. So any kind of browser can be sumitted to this function for convertion into a database file. In addition, oColumn:heading, oColumn:picture and oColumn:width variables are used for .dbf structure. 
cFileDbf A fully qualified file name with drive, path and extension to hold the resulting records.

Returns

Logical whether database has been created or not and also if some records have been appended.

Description

A handy function to convert a browser data into a database. Only the columns which are visible will be considered for .dbf fields. As this function does not take into account the underlying data structure, so every kind of browser becomes eleigible for dbase conversion. The structure of database will be ascertained as:
DBS_NAME Value returned by oColumn:heading instance variable. Spaces and semicolons  will be replaced with underscore. First 10 characters will be considered. 
DBS_TYPE Return value of Valtype( eval( oColumn:block ) ).
DBS_LEN Value returned by oColumn:width instance variable.
DBS_DEC Value returned by occurs( '9', substr( oColumn:picture, at( '.', oColumn:picture ) + 1 ) ).

Please note that the oBrowse:GoTop() will be issued at the completion of the process. So record pointer will not be at the place where it had been prior to issue the command. You can always press <ESC> to abort the process, but then the resulted databse will still retain the records upto the point <ESC> is pressed. 

Usage

lEnd := .f.

While !lEnd
      oBrowse:ForceStable()

       nKey = InKey( 0 )

       do case
       case nKey == K_ESC
            lEnd = .t.

       case nKey == K_ENTER
            lEnd := .t.

       case nKey == K_DOWN
            oBrowse:Down()

       case nKey == K_UP
             oBrowse:Up()

       case nKey == K_F10
              if V32Tb2Dbf( oBrowse,  cFileDbf )
                  //   Take some action 
              endif

       endcase 
End

Tips

 

[ Home ][ Features ] [ Products ][ About Us ][ FAQ's ][ Screen Shots ][ Downloads ][ Support ][ Discussion ]
.

Vouch is a Trademark of Pritpal Bedi
All other Trade Marks are the property of their respective owners.
Copyright 1993-2011 Pritpal Bedi. All rights reserved.
Hit Counter  
You are Visitor # since 14 May 2002