| HomePushEStack | Function (ROM Call 0x10F)

homescr.h

void HomePushEStack (void);

Creates and draws a new history pair with given contents.

HomePushEStack is a very powerful command which lets you store expressions straight to the history.
The expression (not a multi-expression) which you want to store to the history has to be placed at the top of the expression stack. This function will pop it off of the estack and into the history. It will be used as both entry and answer, but it will not be simplified.
The result of using this call is that memory is allocated, so garbage collection may occur. After your program exits, the allocated memory will remain allocated, which is perfectly normal. However, kernels like DoorsOS, TeOS, and PreOS (but not UniversalOS) have a feature that frees all handles left unfreed by kernel programs. This feature is smart and first checks if a handle is that of a variable, but older kernels do not check if it is a history item.
For kernel-based programs, DoorsOS and TeOS will free the handles for the newly stored item, and when your program exits, the calculator will crash! PreOs 0.62 or higher detects the history handles and handles them correctly.
HomePushEStack calls HS_newFIFONode and HS_pushEmptyFIFONode to create the new history item.
Note: HomePushEStack redraws the home screen if it is the active application, which it most likely is. To circumvent this, use HomeStore.

Uses: HS_countFIFO, HS_freeFIFONode, HS_newFIFONode, HS_pushEmptyFIFONode, HS_pushFIFONode, HeapAllocThrow, HeapFreeIndir, ER_catch, ER_success, ER_throwVar, HToESI, next_expression_index, NG_RPNToText, Parms2D, Parse2DMultiExpr, top_estack, gr_active, memcpy, ST_helpMsg, ST_stack, strlen, XR_stringPtr, EV_currentApp, paint_all_except, WinHeight, WinWidth, ROM Call 0x471, ROM Call 0x5DD, ROM Call 0x5DE
Used by: HomeStore, GT_IncXY, GT_Trace

See also: HomeStore, HomeStorePair, HS_popEStack