The global section of the Code Module can contain functions visible throughout the module and to any subreports below the current report.

To declare such functions, right-click on the Code Explorer and select Module. The treeview will change to display the global section.

Click on the Programs node – the listview will display any extant functions. If you have not declared any, the listview will be empty.

Right-click on an empty space in the listview – note that the first two menu items are New Function and New Procedure. Selecting either of these items will create a declaration and an implementation stub.

If you select New Function, a new function named GlobalFunction1 will be added to the listview and the following implementation will be added to the Code Editor:

function GlobalFunction1: Variant;  
begin  
 
  Result :=   
 
end;  

Likewise, if you select New Procedure, a new procedure named GlobalProcedure1 will be added to the listview and the following implementation will be added to the Code Editor:


procedure GlobalProcedure1;  
begin  
 
end;