The description of the methods and events including typical usage can be found in the help (pop-up menu) of the IntFlash bean. The OnWriteEnd event is not called within EraseSector method. The EraseSector method waits to erase command complete. You are informed about the result of the EraseSector method through the return value of this method.
In the documentation of the bean you could find (page Methods):
EraseSector - Erases the sector to which address Addr belongs.
ANSIC prototype: byte EraseSector(BeanName_TAddress Addr)
Addr:BeanName_TAddress - Address in FLASH.
Version specific information for 56800 derivatives The value of this parameter is address of a 16 bit word location in the selected memory space.
The memory space depends on the selected flash memory device.
Return value:byte - Error code, possible codes: o ERR_OK - OK
o ERR_NOTAVAIL - Desired program/erase operation is not available
o ERR_RANGE - Address is out of range
o ERR_SPEED - This device does not work in the active speed mode
o ERR_BUSY - Device is busy
o ERR_PROTECT - Flash is write protect
o ERR_VALUE - Flash sector erase was not successful