; FAS_Random2DArray ; ----------------- ; Creates/returns a 2D array of random data ; FAS_Random2DArray( _ ; $iRows, _ ; Number of rows in the array ; $aColumns, _ ; Number of columns in the array and data types, see 1) in docu ; $sSource = "", _ ; Character source for string columns, random strings are created from these characters ; $bRetArray = 1, _ ; True to return array, else the array is stored as a global variable in compiled code ; $bProgress = 0 ) ; True to calculate progress info while creation of the array is performed ; 1) $aColumns parameter ; Five data types are supported: string, integer, float (double), date and time. Strings are created from the ; $sSource character source. Date and time types are created as proper date and time values and are stored as ; 8 and 6 digit integers. ; ; In addition, a "row/col" data type showing row/col index in array elements is supported: A string data type ; on the format "row/col". This data type is valuable during testing and debugging. And it's very fast to cre- ; ate the data. Especially in AutoIt code. ; ; The data types can be specified in this way: ; Strings, String, str, s ; Integers, Integer, int, i ; Floats, Float, flo, flt, f ; Dates, Date, dat, dte, d ; Times, Time, tim, tme, t ; Rows/Cols, RowsCols, Row/Col, RowCol, r/c, rc, r, c ; ; $aColumns can be specified in three ways: ; 1. As a string: "sifdtr", only one letter abbreviations for the data types can be used ; Examples: "sifdtr", 6 columns of strings, integers, floats, dates, times and row/col ; "dtsss", 2 columns of dates and times and 3 columns of strings ; "ffffff", 6 columns of floats ; ; 2. As a 1D array: [ "s", "i", "f", "d", "t", "r" ], [ "str", "int", "f" ], [ "date", "string" ] ; Purpose of the array is to avoid one letter abbreviations. ; ; 3. As a 2D array: ; Local $aColumns = [ _ ; [ "Strings", min, max, duplpct ], _ ; min ( 0, default 16), max ( 1024, default 32) is length of the strings ; [ "Integers", min, max, duplpct ], _ ; min (-2147483646, default 0), max (2147483646, default $iRows - 1) is size of integers ; [ "Floats", min, max, duplpct ], _ ; min (-2147483646, default 0), max (2147483646, default $iRows - 1) is size of floats ; [ "Dates", min, max, duplpct ], _ ; min ( 0, default 2010), max ( 9999, default 2020) is year of dates ; [ "Times", min, max, duplpct ], _ ; min ( 0, default 0), max ( 23, default 23) is hour of times ; [ "Rows/cols", 0, 0, 0 ] ] ; min, max and duplpct cannot be specified for row/col columns ; ; Duplpct is the minimum number of duplicates as a percentage. Default is 0% duplicates. However, in the code, ; there is no guarantee that duplicates are not generated. Except for row/col columns that are unique. ; ; Examples: ; Local $aColumns = [ _ ; [ "String", 20, 35, 30 ], _ ; 30% duplicates ; [ "Integer", 0, $iRows - 1, 20 ], _ ; 20% duplicates ; [ "Float", 0, $iRows - 1, 10 ], _ ; 10% duplicates ; [ "Date", 2000, 2017 ], _ ; [ "Time", 0, 23 ], _ ; [ "Row/col" ] ] ; ; Local $aColumns = [ _ ; [ "str", 24 ], _ ; Minimum length of strings is 24 characters instead of default 16 ; [ "int" ] ]