Category : Miscellaneous Language Source Code
Archive   : E!518.ZIP
Filename : EXAMPLE.PAS

 
Output of file : EXAMPLE.PAS contained in archive : E!518.ZIP

Program Example;

{ This a very simple example of an E! API program }
{ changing the current text line for a new one }

USES API;

TYPE sptr = ^string; { for type casting }

VAR s:pointer; { to receive address returned by Request_E_Address }

BEGIN
(* E!PRESENT (environment variable) should normally be tested *)

s:=Request_E_Address(EDITBUFF_REQUEST);
{ Retrieve Editbuffer address }
sptr(s)^:='Here I am. I replaced the original text line!';
{ Modify it }
Request_E_Service(STORE_SERVICE);
{ Store it }
Request_E_Service(DISPLINE_SERVICE);
{ Display it }
Request_E_Service(CHANGE_SERVICE);
{ Notify the change }
END.