| 4D v14.4FORM LOAD | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 
 | 
    4D v14.4
 FORM LOAD 
         | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| FORM LOAD ( {aTable ;} form {; *} ) | ||||||||
| Parameter | Type | Description | ||||||
| aTable | Table |   | Table form to load (if omitted, load a project form) | |||||
| form | String |   | Name of form (project or table) to open | |||||
| * | Operator |   | If passed = command applies to host database when it is executed from a component (parameter ignored outside of this context) | |||||
The FORM LOAD command is used to load the form (project or table) in memory in the current process in order to print its data or parse its contents. There can only be one current form per process.
In order to be able to execute this command, a print job must be opened beforehand using the OPEN PRINTING JOB command. The OPEN PRINTING JOB command makes an implicit call to the FORM UNLOAD command, so in this context it is necessary to execute FORM LOAD. Once loaded, this form becomes the current printing form. All the object management commands, and in particular the Print object command, work with this form.
If a printing form has already been loaded beforehand (via a previous call to the FORM LOAD command), it is closed and replaced by form. You can open and close several project forms in the same print session. Changing the printing form via the FORM LOAD command does not generate page breaks. It is up to the developer to manage page breaks.
Only the On Load form event is executed during the opening of the project form, as well as any object methods of the form. Other form events are ignored. The On Unload form event is executed at the end of printing.
To preserve the graphic consistency of forms, it is recommended to apply the "Printing" appearance property regardless of the platform.
The current printing form is automatically closed when the CLOSE PRINTING JOB command is called.
Compatibility note: In versions of 4D prior to v14, the FORM LOAD command (named OPEN PRINTING FORM) accepted an empty string in the form parameter to close the current project form. This syntax is no longer supported and returns an error. You must use the FORM UNLOAD command or the CLOSE PRINTING JOB command in order to close the form.
This consists in loading an off-screen form for parsing purposes. To do this, just call FORM LOAD outside the context of a print job. In this case, form events are not executed.
FORM LOAD can be used with the FORM GET OBJECTS and OBJECT Get type commands in order to perform any type of processing on the form contents. You must then call the FORM UNLOAD command in order to release the form from memory.
Note that in all cases, the form on screen remains loaded (it is not affected by the FORM LOAD command) so it is not necessary to reload it after calling FORM UNLOAD.
When the command is executed from a component, it loads the component forms by default. If you pass the * parameter, the method loads the host database forms.
Reminder: In the off-screen context, do not forget to call FORM UNLOAD to avoid any risk of memory overflow.
Calling a project form in a print job:
 OPEN PRINTING JOB
 FORM LOAD("print_form")
  // execution of events and object methodsCalling a table form in a print job:
 OPEN PRINTING JOB
 FORM LOAD([People];"print_form")
  // execution of events and object methodsParsing of form contents to carry out processing on text input areas:
 FORM LOAD([People];"my_form")
  // selection of form without execution of events or methods
 FORM GET OBJECTS(arrObjNames;arrObjPtrs;arrPages;*)
 For($i;1;Size of array(arrObjNames))
    If(OBJECT Get type(*;arrObjNames{$i})=Object type text input)
  //… processing
    End if
 End for
 FORM UNLOAD //do not forget to unload the form
									
									
									Current form name
									
									FORM UNLOAD
									
									LISTBOX GET OBJECTS
									
									OBJECT Get type
									
									Print object
									
	Product:  4D
	Theme:  Forms
	Number:  
        1103
        
        
        
	

	Created:  4D v12
	Modified:  4D v14
	Renamed: 4D v14
	
	
	
	
	4D Language Reference ( 4D v15)
	4D Language Reference ( 4D v14.4)
	
	
	4D Language Reference ( 4D v15.4)
	
	
	
	
	4D Language Reference ( 4D v15.3)
	
	
 Add a comment
Add a comment