4D View v16

PV CELLS TO ARRAY

Home

 
4D View v16
PV CELLS TO ARRAY

PV CELLS TO ARRAY 


 

PV CELLS TO ARRAY ( area ; direction ; column ; row ; array ; number ) 
Parameter Type   Description
area  Longint in 4D View area
direction  Integer in 0 = Row; 1 = Column
column  Longint in Start column number
row  Longint in Start row number
array  Array in Array name
number  Longint in Number of cells to be used

The PV CELLS TO ARRAY command fills the array with the cell content specified by direction, column, row and number.

direction specifies whether the PV CELLS TO ARRAY command must execute a copy of continuous cells in the horizontal (0) or vertical (1) direction, starting with the cell set by column and row.

Note: Using the direction parameter is different from the direction parameter in the PV GOTO NEXT CELL and PV GET NEXT FREE CELL commands, where the direction can be in any direction. For PV CELLS TO ARRAY, the direction is either to the right (0 = row), or toward the bottom (1=column).

Example  

Take, for example, a 4D View area included in the input screen of the client table: this included area, containing 10 rows maximum, will serve to enter or modify client contacts. The entry area is composed of 10 cells disposed in columns starting from the current cell:

 ARRAY TEXT(ContactsTab;0)&nbsp//Contact name array
 C_LONGINT($Column;$Row)&nbsp//Coordinates of starting cell
 
 PV GET CURRENT CELL(Area;$Column;$Row)
 
  //10 rows maximum from the current cell toward the bottom
 PV CELLS TO ARRAY(Area;1;$Column;$Row;ContactsTab;10)
 
 If(Size of array(ContactsTab)#0) //Was anything recovered?
    RELATE MANY([Clients]Code) //Get linked records
    DELETE SELECTION([Contacts]) //Purge existing ones
  //Update contacts (new, modified or deleted)
    ARRAY TO SELECTION(ContactsTab;[Contacts]ContactName) //Create contacts
    APPLY TO SELECTION([Contacts];[Contacts]CodeClient:=[Clients]Code) //To keep the relation
    QUERY SELECTION([Contacts];[Contacts]ContactName="") //Purge empty contacts
    DELETE SELECTION([Contacts])
 End if



See also 

PV ARRAY TO CELLS
PV FIELD TO CELLS

 
PROPERTIES 

Product: 4D View
Theme: PV Cell value
Number: 15909

 
HISTORY 

Created: 4D View 6.8

 
ARTICLE USAGE

4D View Language ( 4D View v16)