home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c160 / 1.ddi / REF / QUICK.REF
Encoding:
Text File  |  1990-11-21  |  17.8 KB  |  412 lines

  1. Code Base 4 Quick Reference               
  2.  
  3. Note:  Routines which are seldom used are not included in this
  4. Quick Reference information.
  5.  
  6.  
  7. Conversion Routines
  8.  
  9. double  c4atod( char * str, int len_str )  // ASCII to double
  10.  
  11. int     c4atoi( char * str, int len_str )  // ASCII to integer
  12.  
  13. long    c4atol( char * str, int len_str )  // ASCII to long
  14.  
  15. char *  c4dtoa( double doub_value, int len, int dec )    // double to ASCII
  16.  
  17. int     c4dt_julian( char * dbf_date, double * index_date ) // Julian Day to CCYYMMDD
  18.  
  19. char *  c4dt_format( char * dbf_date, char * picture )     // CCYYMMDD to Any Formats
  20.  
  21. void    c4dt_str( char * dbf_date, double * index_date )   // CCYYMMDD to Julian Day
  22.  
  23. char *  c4dt_unformat( char * date_data, char * picture )  // Any Format to CCYYMMDD
  24.  
  25. void    c4encode( char * to, char * from, char * t_to, char * t_from )  // Transpose Characters
  26.  
  27. char *  c4ltoa( long long_value, char * result_ptr, int result_len )  // long to ASCII
  28.  
  29. void    c4trim_n( char * str, int n_ch )  // Trims blanks, 'n_ch' - # of bytes of declared memory
  30.  
  31.  
  32. Database Routines
  33.  
  34. int     d4append()     // Appends a database record
  35.  
  36. int     d4bottom()     // Position to the bottom of the database
  37.  
  38. int     d4close()      // Close the selected database
  39.  
  40. int     d4close_all()  // Close all open database, index and memo files
  41.  
  42. int     d4create( char * name, int n_fields, FIELD * fields, int safety ) // Create a database
  43.  
  44. int     d4delete( long record_number )  // Delete a record
  45.  
  46. int     d4deleted()    // Returns true if the record has been deleted
  47.  
  48. int     d4go( long record_number )  // Go to a database record.  A zero parameter blanks the record
  49.  
  50. int     d4init_memory( int num_base, int num_index, int num_blocks, int eval_space )  // Initialize Code Base 4
  51.  
  52. int     d4lock( long lock_code, int do_wait )  // Lock the selected database
  53.  
  54. int     d4pack()       // Remove deleted records
  55.  
  56. void    d4recall( long record_number )  // Un-delete a record
  57.  
  58. long    d4reccount()   // Returns the number of records in the database
  59.  
  60. long    d4recno()      // Returns the current record number
  61.  
  62. int     d4ref( char * name )  // Returns a database reference number
  63.  
  64. int     d4seek( void * search_string )  // Searches for a particular record
  65.  
  66. int     d4select( int base_ref )  // Select a database
  67.  
  68. int     d4skip( long num_records )  // Skip to a particular record
  69.  
  70. int     d4top()        // Moves to the top of the database
  71.  
  72. int     d4unlock( long lock_code )  // Unlocks a database record
  73.  
  74. int     d4use( char * name )  // Opens and selects a database
  75.  
  76. int     d4use_excl( char * name )  // Opens and selects a database
  77.  
  78. int     d4write( long record_number )  // Writes a record to disk
  79.  
  80. int     d4zap( long start_record, long end_record )  // Removes records from a database
  81.  
  82.  
  83. Expression Evaluation Routines
  84.  
  85. void *  e4eval( char * expr_ptr )  // Evaluates a dBASE expression
  86.  
  87. void *  e4exec( char * compile_ptr )  // Executes pseudo-compiled dBASE expression
  88.  
  89. int     e4parse( char * expr_ptr, char ** &compile_ptr )  // Pseudo-compiles a dBASE expression
  90.  
  91.  
  92. Field Routines
  93.  
  94. int     f4decimals( long field_ref )  // The number of decimals in a numeric field
  95.  
  96. long    f4j_ref( int j_ref )  // The field reference number of field 'j' starting from 1
  97.  
  98. char *  f4name( long field_ref )  // The name of a field
  99.  
  100. int     f4num_fields()  // The number of fields in the selected database
  101.  
  102. char *  f4ptr( long field_ref )  // Returns a pointer into the record buffer
  103.  
  104. void *  f4record()  // Returns a pointer to the start of the record buffer
  105.  
  106. int     f4record_width()  // Returns the number of bytes in the record buffer
  107.  
  108. long    f4ref( char * field_name ) // Returns the field's reference number
  109.  
  110. int     f4replace( long field_ref, void * value )  // Replaces the field's contents
  111.  
  112. char *  f4str( long field_ref )    // Copies a field value into a static memory area and null terminates it
  113.  
  114. int     f4true( long field_ref )   // The value of a logical field
  115.  
  116. char    f4type( long field_ref )   // The type of a field
  117.  
  118. double  f4value( long field_ref )  // The value of a field returned as a double
  119.  
  120. int     f4width( long field_ref )  // The width of a field
  121.  
  122.  
  123. Get Routines
  124.  
  125. void    g4( int row, int column, char * str )  // Get character data
  126.  
  127. long    g4attribute( long attribute )  // The display attribute of the entry area
  128.  
  129. void    g4bell()  // Sound the bell
  130.  
  131. void    g4bell_set( int switch )  // Controls whether 'g4bell' does anything
  132.  
  133. void    g4call( GET_ROUTINE * routine, int call_data )  // Specifies a call routine
  134.  
  135. int     g4char()  // Gets a character value from the keyboard
  136.  
  137. void    g4date( int row, int column, char * date_ptr )  // Gets a date value
  138.  
  139. char *  g4delimeter( char * delimiter )  // Specifies two delimiter characters
  140.  
  141. void    g4display()  // Displays default 'get' values without a read
  142.  
  143. void    g4double( int row, int column, double * double_ptr )  // Gets a double value
  144.  
  145. void    g4field( int row, int column, long field_ref )  // Gets a field's value
  146.  
  147. void    g4int( int row, int column, int * int_ptr )  // Gets an integer
  148.  
  149. void    g4logical( int row, int column, int * logical_ptr )  // Gets a logical value
  150.  
  151. void    g4long( int row, int column, long * long_ptr )  // Gets a long integer
  152.  
  153. int    g4menu( GET * get_ptr, char * buffer, int window_ref )  // Gets a menu item for entry into the entry area
  154.  
  155. int     g4menu_help( GET * get_ptr, char * buffer, int window_ref )  // Gets data from user or from menu item list
  156.  
  157. void    g4message( char * message )  // Specifies a message to entry area created earlier using a Post-Modifier routine
  158.  
  159. void    g4numeric( int row, int column, char * num_str )  // Gets a numeric value as a character string
  160.  
  161. void     g4picture( char * picture)  // Specifies allowable input characters for previous Get Initialize routine's entry area
  162.  
  163. int     g4read()  // Gets data from user using pre-defined entry areas
  164.  
  165. void    g4release( int do_release )  // Specifies whether information from last 'g4read' is released immediately
  166.  
  167. void    g4upper()  // Converts all characters from previous entry area to upper case upon entry
  168.  
  169. void    g4valid( (*routine) () )  // Specifies a validation routine for previous Get Initialize routine
  170.  
  171.  
  172. Index File Routines
  173.  
  174. long    i4check( index_ref)  // Verifies accuracy of an index file
  175.  
  176. int    i4close( int index_ref )  // Closes specified index file
  177.  
  178. int     i4free( int index_ref )  // Frees up memory by writing buffered information for specified index file to disk
  179.  
  180. int     i4index( char * name, char * expr, int unique, int safety )  // Creates, opens and selects an index file
  181.  
  182. int     i4lock( int index_ref, int do_wait )  // Locks index file unless file is previously locked by other user
  183.  
  184. int     i4open( char * file_name )  // Opens and selects specified index file
  185.  
  186. int      i4ref( char * name )  // Returns the index file's reference number
  187.  
  188. int    i4reindex( int index_ref )  // Reindexes the specified index file
  189.  
  190. int     i4select( int index_ref )  // Selects the specified index file
  191.  
  192. int     i4unlock( int index_ref )  // Unlocks the specified index file
  193.  
  194. void    i4unselect()  // Chooses record number ordering for the selected database
  195.  
  196.  
  197. Memo Routines
  198.  
  199. long *    m4check( long field_ref )  // Analyses memo file contents to obtain data storage information
  200.  
  201. int     m4edit( long field_ref, long rec_num, char * editor_name, int max_size )  // Allows memo field modifying from an editor
  202.  
  203. int    m4exist( long field_ref )  // Detects presence of memo field data
  204.  
  205. int    m4read( long field_ref, long rec_num, char * str, int str_len )  // Reads a memo field into a string
  206.  
  207. int     m4write( long field_ref, long rec_num, char * str, int str_len )  // Writes a string to specified memo field
  208.  
  209.  
  210. Menuing Routines
  211.  
  212. int     n4( char * label)  // Defines a single menu item, without specific menu positioning
  213.  
  214. int    n4action( (ACTION *) action_routine )  // Specifies an action routine for menu item created with n4, or n4item
  215.  
  216. int    n4activate( int window_ref )  // Activates a menu
  217.  
  218. void    n4arrow_exit()  // Changes arrow key defaults for the currently selected horizontal or vertical menu
  219.  
  220. void    n4attribute( long attribute, long attribute_prompt )  // Sets default attributes for menu items of selected window
  221.  
  222. void    n4attribute_item( int item_ref, long attribute )  // Assigns an attribute to a specific menu item
  223.  
  224. void    n4calc( int w_ref, int start_row, int start_col )  // Sets the dimensions for a window
  225.  
  226. void    n4char_routine( int (*ptr)(void) ) // Specifies a data input routine for 'n4activate'
  227.  
  228. void    n4get_calc( int w_ref )  // Calculates the dimension and position of a menu used for data entry
  229.  
  230. void    n4horizontal()  // Changes the menu default from vertical to horizontal
  231.  
  232. int     n4int_get( int item_ref )   // Returns an integer saved by 'n4int_save'
  233.  
  234. int     n4int_save( int save_value ) // Saves an integer value for the menu item
  235.  
  236. int     n4item( int row, int column, char * label )  // Defines a single menu item, specifying item position within the window
  237.  
  238. char *    n4item_text( int item_ref )  // Returns a pointer to the text of a menu item
  239.  
  240. void     n4item_width( int width )  // Determines the width of a menu whose items have been defined using 'n4'
  241.  
  242. void     n4key( int chr, int activate, int highlight_pos )  // Allows the activation of a menu item by pressing a character key
  243.  
  244. void     n4key_set( int set_code, int ingnore_case )  // Specifies keyboard input options, applicable to current menu window
  245.  
  246. void    n4key_special( int up_key, int exit_key, int return_start, int return_end )  // Specifies keyboard characters which cause 'n4activate' to do something special
  247.  
  248. void    n4lotus( int window_ref )  // Calculates the window positions and dimensions of a lotus menu
  249.  
  250. void    n4message( char * message )  // Specifies a message that relates to a menu item, which was just created using 'n4' or 'n4item'
  251.  
  252. void    n4message_do( char * message )  // Displays the message strings specified by 'n4message'
  253.  
  254. void    n4parm( int new_parm_data )  // Specifies a parameter for 'n4action' and 'n4reaction'
  255.  
  256. int     n4ptr_get( int item_ref )  // Returns an integer saved by 'n4int_save'
  257.  
  258. int     n4ptr_save( void *save_ptr )  // Saves a pointer for a menu item
  259.  
  260. void    n4pulldown( int window_ref )  // Caluculates the window positions and dimensions of a pulldown menu
  261.  
  262. void    n4reaction( (ACTION *) reaction_routine )  // Specifies a reaction routine for a menu item just defined using 'n4' or 'n4item'
  263.  
  264. void    n4refresh( int window_ref )  // Called by action or reaction routines to change display attributes or menu item labels
  265.  
  266. int    n4search( char * description_ptr )  // Searches in a selected window for a particular menu item description
  267.  
  268. int      n4skip_over( int menu_ref, int flag )  // Specifies whether a menu prompt can move to a particular menu item
  269.  
  270. void    n4start_item( int start_item_ref )  // Starts the menu prompt on a particular menu item
  271.  
  272. int     n4sub_menu( int item_ref )  // An action or reaction routine for sub-menus
  273.  
  274.  
  275. Utility Routines
  276.  
  277. int    u4error( int error_num, char * string 1, char * string 2, ..., char * string n, char * 0 )  // Displays error message when an error occurs
  278.  
  279. int     u4file_first( char * pattern, char * first_match )  // Obtains list of file names which match a DOS wild card file specification
  280.  
  281. int    u4file_next( char * next_match )  // Works with 'u4file_first' to find the next matching file pattern
  282.  
  283. int     u4lock( int dos_file, long offset, long num_bytes, int do_wait )  // Locks a section of any file
  284.  
  285. int    u4name_char( (char) test_char )  // Checks to see if a test character is valid for a file name
  286.  
  287. void    u4name_full( char * result, char * name, char * extension )  // Adds a default file name extension to a file name
  288.  
  289. void    u4name_part( char * result, char * name, int give_dir, int give_ext )  // Removes the directory and/or extension parts of a file name
  290.  
  291. int    u4open( char * file_name, int code )  // Opens a file
  292.  
  293. void    u4sort( void * base, (size_t) num, (size_t) width, int (*compare) (void * e1, void * e2))  // Replaces 'qsort' in Turbo C and Microsoft C
  294.  
  295. int    u4unlock( int dos_file, long offset, long num_bytes )  // Unlocks a section of any file which has been previously locked
  296.  
  297.  
  298. Windowing Routines
  299.  
  300. void    w4( int row, int column, char * str )  // Displays a null terminated string at the specified coordinates
  301.  
  302. void    w4activate( int window_ref )  // Selects and displays a window
  303.  
  304. long    w4attribute( long attribute )  // Sets the attribute character used for the selected window
  305.  
  306. void    w4border( char * box_chars, long attribute )  // Sets the window border of the currently selected window
  307.  
  308. void    w4box( char * box_chars, int start_row, int start_col, int end_row, int end_col )  // Draws a box in selected window
  309.  
  310. void    w4centre( int row, char * str )  // Centres a string within a selected window
  311.  
  312. void    w4clear( int row )  // Clears the selected window starting from the specified row
  313.  
  314. void    w4close( int window_ref )  // Frees all memory associated with the window
  315.  
  316. int    w4col()  // Returns the current column
  317.  
  318. void    w4cursor( int row, int column )  // Positions cursor to the specified coordinates  within the selected window
  319.  
  320. void    w4cursor_size( int start_size, int end_size )  // Sets the cursor size
  321.  
  322. void    w4deactivate( int window_ref )  // Removes a window from the screen, which was previously active and selected
  323.  
  324. int    w4define( int top_row, int left_column, int bottom_row, int right_column )  // Creates a window
  325.  
  326. int     w4display( char * title, char * m1, char * m2, ..., char * 0 )  // Creates popup window & displays message strings in it
  327.  
  328. void    w4double( int row, int column, double double_value, int len, int dec )  // Displays a double value
  329.  
  330. void    w4eject()  // Sends form feed character to current window' output handle and sets current row, column positions to (0,0)
  331.  
  332. void    w4exit( exit_rc )  // Positions the cursor to row 23 and column 0 and then exits using standard 'exit' routine
  333.  
  334. void    w4field( int row, int column, long field_ref )  // Displays the value of a database field
  335.  
  336. int     w4handle( int hand )  // Specifies the handle to be associated with the selected window
  337.  
  338. int    w4height( int new_height )  // Sets and returns the number of rows in the selected window
  339.  
  340. int    w4init( int num_window, int num_get, int num_memu )  // Initializes Code Base 4 sreen management
  341.  
  342. void    w4int( int row, int column, int int_value, int len )  // Displays an integer
  343.  
  344. void    w4long( int row, int column, long long_value, int len )  // Displays a long integer
  345.  
  346. void    w4memory()  // Causes a copy of the currently selected window to be kept in memory for re-activation later
  347.  
  348. void    w4num( int row, int column, char * str, int num )  // Displays a string of specified length
  349.  
  350. void    w4num_att( int row, int col, char * str, int num, long attribute )  // Displays a string of specified length and attribute
  351.  
  352. void    w4out( (char * ) str )  // Displays a string at the current row and column positions
  353.  
  354. void     w4popup()  // Makes the selected window a popup window
  355.  
  356. void    w4position( int row, int column )  // Sets the current row and column position of the selected window
  357.  
  358. void    w4read( int row, int col, char * data_buffer, int len_data )  // Reads information from video memory
  359.  
  360. void    w4read_window( int window_ref, char * ptr )  // Reads character information for entire window from video memory
  361.  
  362. void     w4repeat( int row, int column, (char) chr, int num_repeat )  // Displays a character repeatedly
  363.  
  364. int    w4row()  // Returns the current row position
  365.  
  366. void     w4scroll( int num_lines )  // Scrolls the window up or down
  367.  
  368. int    w4select( int window_ref )  // Causes the specified window to become the currently selected window
  369.  
  370. void    w4title( int row, int col, char * title, int title_attribute )  // Displays a string automatically in a specified window when the window is selected
  371.  
  372. int     w4width( int new_width )  // Sets and returns the number of columns per row for the selected windows
  373.  
  374. void    w4write( int row, int col, char * data_ptr, int len_data )  // Writes information from memory buffer directly to video memory
  375.  
  376. void     w4write_att( int row, int col, char * data_ptr, int len_data, long attribute )  // Writes character data from memory buffer directly to video memory
  377.  
  378. void    w4write_window( window_ref, ptr )  // Displays information read with 'w4read_window'
  379.  
  380.  
  381. Extended Routines
  382.  
  383. int    x4blank()  // Determines if current record of the current database is blank
  384.  
  385. int    x4bottom()  // Same as 'd4bottom' except filtering and relations are used
  386.  
  387. int    x4buffer( long start_record, char * buffer, (unsigned int) len_buffer )  // Sequentially reads as many database records as possible into memory buffer
  388.  
  389. void    x4buffer_copy( int i, char * buffer )  // Copies a database record from a large memory buffer into the internal database record buffer
  390.  
  391. int    x4edit()  // Allows the current database to be edited interactively, one record at a time
  392.  
  393. int    x4filter( (*filter_routine) () )  // Works with 'x4seek', 'x4skip', 'x4top', & 'x4bottom' to make it appear that certain records do not exist
  394.  
  395. int    x4filter_pop()  // Removes last filter routine from the list of filter routines attached to the current database
  396.  
  397. void    x4filter_reset()  // Removes all of the filter routines attached to the current database
  398.  
  399. int    x4filter_do()  // Evaluates all of the filtering routines for the current database to determine if the current database record should be filtered
  400.  
  401. int     x4go( long rec_num )  // Same as 'd4go' except relations are used
  402.  
  403. int    x4insert( long rec_num )  // Causes the record in the record buffer to become 'rec_num'
  404.  
  405. int    x4list()  // Writes contents of the database to the current output device applying filtering by 'x4filter'
  406.  
  407. int    x4relate( char * expr, int base_ref, int index_ref, long miss_code )  // Creates a relation between a controlling database and a related database
  408.  
  409. int    x4relate_do()  // Processes all of the relations for the current database
  410.  
  411. void    x4relate_reset()  // Removes all of the relations for the currently selected database
  412.