Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- SIx Driver RDD v3.00 - Reference Guide - <b>sx_rollback():</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  Sx_Rollback():

  Syntax:         Sx_Rollback( [nArea] )

                  nArea = Workarea number.

  Returns:   <logical> .T. if rollback was successful.
                  .F. if an error occurred.

  Description:    This function allows you to force Clipper to re-read a
                  record from disk prior to a write, thereby allowing you
                  to edit directly into a field without concern for the
                  automatic write that is performed at the conclusion of a
                  READ.

                  If you specify the workarea (nArea) as 0, then the current
                  record and all child-related records (that are currently
                  being pointed to) will also be refreshed from the data on
                  disk.  Note that this does not imply that all child
                  records that may have been changed will be rolled back, but
                  only the ones that the record pointers for each child
                  workarea are currently on.

  Example:

    #include "INKEY.CH"
    #include "SIXCDX.CH"

    USE test VIA "SIXCDX"
    GO TOP

    CLEAR
    @ 11,25 SAY "First Name:" GET test->FIRST
    @ 12,25 SAY "Last Name :" GET test->LAST
    @ 13,25 SAY "Age       :" GET test->AGE
    @ 14,25 SAY "Married   :" GET test->MARRIED
    READ

    // If the user pressed <Escape>, restore all of the old field values
    IF LastKey() == K_ESC
      IF Alert( "Abort Edits?", {"Yes","No"} ) == 1
        Sx_RollBack()
      ENDIF
    ENDIF


  NOTE:  See the ROLLBACK.PRG program for a more detailed, practical example.



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