Navigation:  Reference > Functions >

CreateBtrv()

Print this Topic Previous pageReturn to chapter overviewNext page

CREATE_Btrv(1,2,3)

 

PURPOSE

This function will create a standard Pervasive /btreive database file based on entries in the data dictionary.

 

PARTS

 

1 f/c/eRequired - The file to create.  This is the name of the file as currently in FILELOC (locations).

 

2 f/c/eThe company code, if any.  If you don't include a value here the program will use the default company code of 'B  ' (B+2 spaces).  You may either include the complete company code (B+company code) or just the last two characters.

 

       NOTE:  If you specify a company code here there must be a record in FILELOC for this file name and company code.  This is where the program will get the path for the file.

 

3 f/c/eIf the file you are trying to create already exists you may want to alert the user to that before it is initialized.  If so, make this value 'Y' or .T.  The default value is .F. which means the user won't be notified if the file exists.

 

RETURN TYPE - L

Returns .T. if the file was created properly, .F. if not.

 

COMMENTS

This function will do all that is necessary to create a Pervasive btrieve file at the proper location.  The appropriate record must already exist in FILELOC before this process will work properly.

 

NOTE: Warning to use this function you can not have the file you are trying to create open make sure you close the file first.

 

Also see

command inifle This command was used in TAS 5.x and we now recommend this function as it is much like the old tas 3.0 command and very easy to use.

co() Company code

EXAMPLE

define dummy_l type L

 
btn_init.click:

dummy_l = Create_btrv(loc_file_name,loc_comp_code,.t.)

if .not. dummy_l

    msg 'The Btreive file format file was not created'

else

    msg 'The Btrieve file format format file was created properly.'

endif

ret

Example 2

define table type a size 20

define dummy_l type L 

table = 'myfile'

    dummy_l = Create_Btrv(table,'B'*co(),.f.)

    if .n. dummy_l

      msg 'Error Creating new '+ table*'  Table'

    endif

 


Page url: http://www.cassoftware.com/tas/manual/createbtrv().htm