home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0010 - 0019 / ibm0010-0019 / ibm0010.tar / ibm0010 / CODE4-3.ZIP / TC_LIB.ZIP / QUICK.REF < prev    next >
Encoding:
Text File  |  1989-10-04  |  17.7 KB  |  400 lines

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