User Tools

Site Tools


resetfromask_reset_browse_after_update_.htm
Navigation:  ABC Library Reference > BrowseClass > BrowseClass Methods >====== ResetFromAsk (reset browse after update) C6H0009.jpg ====== Previous pageReturn to chapter overviewNext page

ResetFromAsk( request, response ), VIRTUAL, PROTECTED

blk2blue.jpg

ResetFromAsk Resets the BrowseClass object following an update.
request A BYTE variable that indicates the type of update requested. Valid updates are insert (1), change (2), and delete (3).
response A BYTE variable that indicates whether the requested update was completed (1) or cancelled (2).

The ResetFromAsk method resets the BrowseClass object following an Ask or AskRecord update to a browse item.

Implementation:

The Ask and AskRecord methods call ResetFromAsk as needed to reset the BrowseClass object.

ResetFromAsk FLUSHes the BrowseClass object's VIEW if needed, calls the appropriate “reset” method (ResetQueue, ResetFromFile, or ResetFromView) to refill the QUEUE, then carries out any pending scroll request made concurrently with the update. See WindowManager.VCRRequest.

EQUATEs for the request parameter are declared in \LIBSRC\ABFILE.EQU as follows:

InsertRecord  EQUATE (1)  !Add a record to table

ChangeRecord  EQUATE (2)  !Change the current record

DeleteRecord  EQUATE (3)  !Delete the current record

EQUATEs for the response parameter are declared in \LIBSRC\ABFILE.EQU as follows:

RequestCompleted  EQUATE (1)  !Update Completed

RequestCancelled  EQUATE (2)  !Update Aborted

Example:

BrowseClass.Ask PROCEDURE(BYTE Req)

Response BYTE

 CODE

 LOOP

  SELF.Window.VCRRequest = VCR:None

  IF KEYCODE() = MouseRightUp

   SETKEYCODE(0)

  END

  IF SELF.AskProcedure

   IF Req=InsertRecord THEN

    IF SELF.PrimeRecord()

     RETURN RequestCancelled

    END

   END

   Response = SELF.Window.Run(SELF.AskProcedure,Req)

   SELF.ResetFromAsk(Req,Response) !reset the browse after update

  ELSE

   Response = SELF.AskRecord(Req)

  END

 UNTIL SELF.Window.VCRRequest = VCR:None

 RETURN Response

See Also:     Ask, AskRecord, ResetQueue, ResetFromFile, ResetFromView, WindowManager.VCRRequest

resetfromask_reset_browse_after_update_.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1