Navigation:  Reference > Functions >

GetFileType()

Print this Topic Previous pageReturn to chapter overviewNext page

GET_FILE_TYPE(1)

PURPOSE

This function will return the type of file, Btrieve, CodeBase, or, in the case of non-TAS files, whatever you specified in the OPENV command.

PARTS

1 f/c/eRequired - The file number/handle to be checked.

 

RETURN TYPE - A

This function will return a single character.

If the file is Btrieve the function will return B.

If CodeBase it will return C.

If this is a non-TAS file it will return the character you specified in the OPENV command.

COMMENTS

 

define filetype type A size 1
filetype = GET_FILE_TYPE()

if filetype = 'B' // Btrv

  save @bkarcust_hndl nocnf

else_if filetype = 'C' // Codebase

  save @bkarcust_hndl nocnf noclr

endif

 

 

In some situations you need to know whether the file is Btrieve or CodeBase.  For example, in a SCAN loop, if you have a SAVE command in the loop that is saving records in the file that is being accessed you must use the NOCLR option if this is a CodeBase file.  However, if this is a Btrieve file, the NOCLR option will slow the loop down considerably.  By determining the type of file in your code you can use different SAVE commands for each type of file.

 


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