guides:programming:programmers_reference_manual:list2array_method_system

LIST2ARRAY method (System)

Utility method to convert data stored in an EDITTABLE LIST property structure (Row/Column) to an EDITTABLE ARRAY property structure (Column)/Row.

Array = Exec_Method( "SYSTEM",      
                     "LIST2ARRAY",  
                     List,          
                     RowSize,       
                     ColSize,       
                     PrimaryDelim,  
                     SecondaryDelim )
NameRequiredDescription
ListYesData to convert. This should be in the same format as the data used with the EDITTABLE LIST property, i.e. rows are delimited by @Fm, and columns are delimited by @Vm within each row.
RowSizeNoNumber of rows to convert. If not specified the system determines the number of rows itself. Defaults to 0.
ColSizeNoNumber of columns to convert. If not specified the system determines the number of columns itself. Defaults to 0.
PrimaryDelimNoDelimiter to use when parsing the List for rows, and when delimiting columns in the returned Array. Defaults to @Fm.
SecondaryDelimNoDelimiter to use when parsing the List for columns, and when delimiting rows in the returned Array. Defaults to @Vm.

Converted data structured as per the EDITTABLE ARRAY property, i.e. columns are delimited by the PrimaryDelim (@fm) and rows are delimited by SecondaryDelim (@vm) in each column.

ColSize and RowSize are optional. They do not limit the actual number of columns and rows processed by this method – they are simply used as a guideline to help with some internal memory optimization, which may help performance when processing very large arrays.

N/A

 
// Get the contents of an EDITTABLE control in LIST format and convert

   // it to the ARRAY format  (Yes, you could just get the ARRAY property

   // but this is for demo purposes).

   

   ObjxArray =        @Window : ".EDT_MYDATA"

   PropArray =        "LIST"

   

   ObjxArray := @Rm : @Window : ".EDT_MYDATA"

   PropArray := @Rm : "LIMIT"

   

   DataArray        = Get_Property( ObjxArray, PropArray )

   

   EdtList          = DataArray[1,@Rm]

   EdtDims          = DataArray[Col2()+1,@Rm]

   

   // Convert the format

   EdtArray = Exec_Method( "SYSTEM", "LIST2ARRAY", 

                           EdtList,                

                           EdtDims<2>              

                           EdtDims<1> )
 
 
  • guides/programming/programmers_reference_manual/list2array_method_system.txt
  • Last modified: 2023/10/25 10:49
  • by 127.0.0.1