| 4D v18VP SET VALUE | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 
 | 
    4D v18
 VP SET VALUE 
         | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| VP SET VALUE ( rangeObj ; valueObj ) | ||||||||
| Parameter | Type | Description | ||||||
| rangeObj | Object |   | Range object | |||||
| valueObj | Object |   | Cell values and format options | |||||
The VP SET VALUE command assigns a specified value to a designated cell range.
The command allows you to use a generic code to set and format the types of values in rangeObj, whereas other commands, such as VP SET TEXT VALUE and VP SET NUM VALUE, reduce the values to specific types.
In rangeObj, pass a range of the cell(s) (created for example with VP Cell or VP Column) whose value you want to specify. If rangeObj includes multiple cells, the value specified will be repeated in each cell.
The parameter valueObj is an object that includes properties for the value and the format to assign to rangeObj. It can include the following properties :
| Property | Type | Description | 
| value | Longint, Real, Boolean, Text, Date, Null | Value to assign to rangeObj (except- time). Pass null to erase the content of the cell. | 
| time | Real | Time value (in seconds) to assign to rangeObj | 
| format | Text | Pattern for value/time property. For information on patterns and formatting characters, please refer to the 4D View Pro Cell Format section. | 
  //Set the cell value as False
 VP SET VALUE(VP Cell("ViewProArea";3;2);New object("value";False))
 
  //Set the cell value as 2
 VP SET VALUE(VP Cell("ViewProArea";3;2);New object("value";2))
 
  //Set the cell value as $125,571.35
 VP SET VALUE(VP Cell("ViewProArea";3;2);New object("value";125571.35;"format";"_($* #,##0.00_)"))
 
  //Set the cell value as Hello World!
 VP SET VALUE(VP Cell("ViewProArea";3;2);New object("value";"Hello World!"))
 
  //Set the cell value as current date
 VP SET VALUE(VP Cell("ViewProArea";4;2);New object("value";Current date))
 
  //Set the cell value as current hour
 VP SET VALUE(VP Cell("ViewProArea";5;2);New object("time";Current hour))
 
  //Set the cell value as specific date and time
 VP SET VALUE(VP Cell("ViewProArea";3;9);New object("value";!2024-12-18!);"time";?14:30:10?;"format";vk pattern full date time))
 
  //Erase cell content
 VP SET VALUE(VP Cell("ViewProArea";3;9);New object("value";Null))
									 4D View Pro Cell Format
									
									VP Get value
									
									VP SET BOOLEAN VALUE
									
									VP SET DATE TIME VALUE
									
									VP SET DATE VALUE
									
									VP SET FIELD
									
									VP SET FORMULA
									
									VP SET NUM VALUE
									
									VP SET TEXT VALUE
									
									VP SET TIME VALUE
									
									VP SET VALUES
									
	Product:  4D
	Theme:  4D View Pro Language
	Number:  
        9573
        
        
        
	
	Created:  4D v17 R4
	
	
	
	4D View Pro Reference ( 4D v18)
	
	
	
 Add a comment
Add a comment