home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c160 / 1.ddi / UPDATE / UPDATE.DOC < prev   
Encoding:
Text File  |  1990-07-25  |  5.4 KB  |  128 lines

  1.  
  2. Converting from Code Base 4.0x to Code Base 4.2
  3.  
  4.    There have been some minor changes to some routine definitions.  In
  5. order to upgrade existing programs using Code Base 4.xx to Code Base 4.2,
  6. make the following changes:
  7.  
  8.    Change calls to 'd4go' to 'd4go2' and calls to 'd4write' to
  9.    'd4write2'.  Then link in the code in file 'u4update.c'.
  10.  
  11.    The routines in file 'u4update.c' are 'd4write2', 'd4go2', 
  12.    'c4dt_dbf', 'c4dt_index' and 'b4key'.   Routines 'd4write2' 
  13.    and 'd4go2' act the same as routines
  14.    'd4write' and 'd4go' of Code Base 4.0x.  In addition, routine
  15.    'c4dt_dbf', 'c4dt_index' and 'b4key' are mapped to the new 
  16.    Code Base 4.2 routines 'c4dt_str', 'c4dt_julian' and 'i4key' respectively.
  17.  
  18.    If any of your index file key expressions use "CTOD" or "DTOC", change
  19.    them to use "STOD" and "DTOS" instead.
  20.  
  21.    Following is an itemized list of changes to Code Base 4.2 which
  22. may affect current Code Base 4.0x programs.
  23.  
  24.    1.  Routine 'd4go' once checked to make sure the record
  25.        number parameter was less than or equal to the number
  26.        of records in the database.  For performance reasons,
  27.        it no longer does.
  28.  
  29.    2.  The internal order in which Code Base 4.2 locks and unlocks
  30.        data and index files has changed slightly.  Code Base 4.2
  31.        operates on the principle that data files and records are
  32.        locked before index files are locked.  Consequently, 
  33.        if routines 'd4skip' or 'd4seek' need to lock a database
  34.        record, they will unlock any locked index files first.  This
  35.        avoids deadlock.
  36.  
  37.        Alternately, Code Base 4.2 lets you turn off automatic
  38.        database locking altogether.  This effectively implements
  39.        'dirty reads'.  A 'dirty read' is reading a database record
  40.        even though another user has it locked.
  41.  
  42.        It is safest to recompile and link Code Base 4.xx programs using 
  43.        Code Base 4.2 before using them with new Code Base 4.2 applications
  44.        on a network.
  45.  
  46.    3.  The default parameters for expression function 'STR'
  47.        were changed starting with Code Base 4.04.  They are now 
  48.        the same as dBASE and Clipper.
  49.  
  50.    4.  Low level routine 'b4key' is now named 'i4key'.
  51.  
  52.    5.  'd4write' does not 're-write' the record count bytes every time
  53.        a record is appended.  Consequently, it is critical to call
  54.        'd4close' to maintain dBASE compatibility.  Note that Code Base 4.2
  55.        determines the number of records from the length of the file.
  56.  
  57.    6.  Some low level Code Base 4.2 routines are now prototyped in file
  58.        "d4all.h" rather than "d4base.h".  These are uncommonly used
  59.        routines documented in an appendix.
  60.  
  61.    7.  To append records, call 'd4append' or 'd4write(0L)' rather than 
  62.        'd4write'.  Do not use 'd4write' to write to records which do not exist.
  63.  
  64.    8.  d4skip has an extra error 'rc' of -3.  This error occurs if
  65.        the current record does not have an index file key entry.
  66.        In general, this situation should not occur.
  67.  
  68.   10.  The default for 'v4unique_error' is true (non-zero).  Consequently,
  69.        the Code Base 4.2 default makes Code Base 4.2 perform as dBASE does.
  70.  
  71.   11.  The prototype for 'd4init_memory' has been removed.  Any existing
  72.        program will still work.  However, a missing prototype warning
  73.        may appear.
  74.  
  75.        Routine 'd4initialize' has been created to replace 'd4init_memory'.
  76.        It has one extra parameter.  Note that 'd4init_memory' still exists
  77.        so that you do not have to change existing programs.
  78.  
  79.   12.  Routine 'c4dt_dbf' has been renamed to 'c4dt_str' and routine
  80.        'c4dt_index' has been renamed to 'c4dt_julian'.
  81.  
  82.   13.  Routine 'i4check' has a different meaning for return code '(int) -2'.
  83.  
  84.   14.  The meaning of return code '(int) -2' has changed for routine
  85.        'd4write'. 
  86.  
  87.   15.  'x4replace' has been removed from Code Base.  This routine was 
  88.        effectively an example on how to read a record, modify the record,
  89.        and then re-write the record.  If you need this routine,
  90.        you can get the source from file 'x4.c' of the previous release.
  91.  
  92.   16.  The expression evaluation functions "DTOC" and
  93.        "CTOD" have been changed.  They are now consistent with
  94.        the default action of dBASE.  This means they use the
  95.        "MM/DD/YY" picture format.  The action of function "DTOS" has not 
  96.        been changed.  In addition "STOD" has been introduced.  "STOD"
  97.        does what "CTOD" used to do.
  98.  
  99.   17.  Routine 'f4ref' now displays an error message if it is passed
  100.        an illegal field name.  If you do not want this error message,
  101.        remove the call to 'u4error' in file 'f4ref.c'.
  102.  
  103.  
  104. Converting from Code Base 4.1 to Code Base 4.2
  105.  
  106.    The main change to Code Base 4.2 is that it is more portable.  
  107. So that Code Base 4.2, and programs using Code Base 4.2, can compile 
  108. using C++ compilers, the following routine definitions have been changed:
  109.  
  110.    n4action
  111.    n4reaction
  112.    n4activate
  113.  
  114. In addition, the following routines have been added:
  115.  
  116.    n4sub_menu
  117.    n4ptr_save
  118.    n4ptr_get
  119.    n4int_save
  120.    n4int_get
  121.  
  122. The parameters to routines 'n4action' and 'n4reaction' have now
  123. been strictly defined as an integer.  Consequently, it is necessary
  124. to use the new menuing routines to pass data to and from action
  125. and reaction routines.  Routine 'n4activate' now takes the 
  126. window reference number as a parameter rather than a pointer
  127. to a window reference number.
  128.