home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c160 / 1.ddi / EXAMPLES / E4INDEX.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-06-22  |  945 b   |  39 lines

  1.  
  2. /*  e4index.c (c)Copyright Sequiter Software Inc., 1987, 1988, 1989. All rights reserved. 
  3.  
  4.     This is the example from routine 'n4pull_down' in the manual.
  5. */
  6.  
  7. #include "d4base.h"
  8. #include "w4.h"
  9.  
  10.  
  11. main( int argc, char **argv )
  12. {
  13.    d4initialize(1,1,1, 3000, 0 ) ;
  14.    d4buf_init( 3000000L, 32000L, 64000L ) ;
  15.    
  16.    w4clear(-1) ;
  17.  
  18.    if ( argc < 4 )
  19.    {
  20.       w4(0,0, "e4index  database_file_name  new_index_file_name  index_expr" ) ;
  21.       w4exit(1) ;
  22.    }
  23.  
  24.    if ( d4use( argv[1] ) < 0 )  w4exit(1) ;
  25.  
  26.    w4( 0,0,         "Database:   " ) ;  w4out( argv[1] ) ;
  27.    w4( w4row()+1,0, "Index:      " ) ;  w4out( argv[2] ) ;
  28.    w4( w4row()+1,0, "Index Expr: " ) ;  w4out( argv[3] ) ;
  29.    w4( w4row()+1,0, "Working ..." ) ;
  30.  
  31.    if ( i4index( argv[2], argv[3], 0, 0 ) < 0 )
  32.       w4( w4row()+2,0, "INDEX NOT CREATED" ) ;
  33.    else
  34.       w4( w4row()+1,0, "Index Created" ) ;
  35.  
  36.    d4close_all() ;
  37.    w4exit(0) ;
  38. }
  39.