Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- RaSQL/B 6.1a for Clipper - <b>n_xsetflags()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
N_XSETFLAGS()
Set Btrieve file definition flags

Syntax
N_XSETFLAGS([<nValue>])

Argument
<nValue> is a file definition flag used when creating a new Btrieve file.  
When setting Btrieve file definition flags, be sure to use only allowable 
values. The table below lists them. See the Btrieve Programmer's Manual for 
more information.

To set more than one flag, add the values together. Notice, for instance, 
that B_30_PERCENT = B_10_PERCENT + B_20_PERCENT

     Value   Constant       Meaning
     1         B_VARIABLE     File contains a variable length field. You do 
                              not need to set this flag. N_XAMAKETBL() sets 
                              the flag based on the file definition 
                              provided.

     2         B_TRUNCATE     To save disk space, Btrieve will remove 
                              trailing blanks from variable length data be.
                              fore storing the record. Btrieve will restore 
                              the trailing blanks when it retrieves the 
                              record. Meaningful only if the file contains 
                              variable length records and the variable 
                              length data is mainly ASCII text.

     4         B_PREALLOCATE  Preallocated file. Do not set this flag. 
                              Instead, use N_XSETALLOC().

     8         B_COMPRESS     Compress records. You must allocate a 
                              compression buffer that is double the size of 
                              the largest record (including any variable 
                              length data) in the file. Set this flag only 
                              if disk space is more important than speed or 
                              memory.

     16        B_KEYONLY      Key only file: record is stored in index 
                              pages. Useful for lookup tables. Data cannot 
                              be modified; only inserted or deleted. Btrieve 
                              permits only one index, although it may be 
                              multisegmented. Record must be under 255 bytes 
                              and must be an even length. A key-only file 
                              cannot contain a Variable length field.
     
     64        B_10_PERCENT   Reserves 10, 20 or 30%, respectively, of each 
     128       B_20_PERCENT   page for variable length data.  If none 
     192       B_30_PERCENT   specified the default is 5%.  Consider higher 
                              values when you expect a large amount of 
                              variable length data. 

You can find the definition of manifest constants  in the file RASQL.CH, 
which we included on the installation diskette.

Returns
N_XSETFLAGS() with no argument returns the current setting of the file 
definition flags.

Remarks
Use this function to set Btrieve file definition flags, if desired, before 
creating a file with N_XMAKETBL(). Values set remain in effect until changed 
by another call to N_XSETFLAGS().

Example
* Set file compression and variable length
* field truncation.
N_XSETFLAGS(8 + 2)


See Also: N_XAMAKETBL() N_XMAKETBL() N_XSETALLOC()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson