User Tools

Site Tools


ask_update_selected_browse_item_.htm
Navigation:  ABC Library Reference > BrowseClass > BrowseClass Methods >====== Ask (update selected browse item) C6H0009.jpg ====== Previous pageReturn to chapter overviewNext page

Ask( request ), VIRTUAL, PROC

blk2blue.jpg

Ask Updates the selected browse record.
request A numeric constant, variable, EQUATE, or expression that indicates the requested update action. Valid actions are Insert, Change, and Delete.

The Ask method updates the selected browse record and returns a value indicating whether the requested update was completed or cancelled.

Implementation:

Depending on the value of the AskProcedure property, the Ask method either calls the WindowManager.Run method to execute a specific update procedure, or it calls the AskRecord method to do an edit-in-place update.

The TakeEvent method calls the Ask method. The Ask method assumes the UpdateViewRecord method has been called to ensure correct record buffer contents.

Return value EQUATEs are declared in \LIBSRC\ABFILE.EQU:

RequestCompleted   EQUATE (1)     !Update Completed

RequestCancelled   EQUATE (2)     !Update Aborted

EQUATEs for request are declared in \LIBSRC\ABFILE.EQU:

InsertRecord       EQUATE (1)     !Add a record to table

ChangeRecord       EQUATE (2)     !Change the current record

DeleteRecord       EQUATE (3)     !Delete the current record

Return Data Type:     BYTE

Example:

BrowseClass.TakeEvent PROCEDURE

!procedure data

 CODE

!procedure code

CASE ACCEPTED()

OF SELF.DeleteControl

 SELF.Window.Update()

 SELF.Ask(DeleteRecord)           !delete a browse item

OF SELF.ChangeControl

 SELF.Window.Update()

 SELF.Ask(ChangeRecord)           !change a browse item

OF SELF.InsertControl

 SELF.Window.Update()

 SELF.Ask(InsertRecord)           !insert a browse item

OF SELF.SelectControl

 SELF.Window.Response = RequestCompleted

 POST(EVENT:CloseWindow)

ELSE

 SELF.TakeAcceptedLocator

END

See Also:     AskProcedure, AskRecord, TakeEvent

ask_update_selected_browse_item_.htm.txt · Last modified: 2021/04/15 15:56 by 127.0.0.1