Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
May 10, 2022 3:15:54 PM
Apr 22, 2021 7:02:11 AM
The peek function uses the following syntax :
Peek( field_name [, row_no[, table_name ] ])
Source: Peek - script function
Example:
EmployeeDates: Load * Inline [ EmployeeCode|StartDate|EndDate 101|02/11/2010|23/06/2012 102|01/11/2011|30/11/2013 103|02/01/2012| 104|02/01/2012|31/03/2012 105|01/04/2012|31/01/2013 106|02/11/2013| ] (delimiter is '|');
let test = Peek('EmployeeCode',-2,'EmployeeDates') ; -> Correct, both row_no and table_name are being used at the same time
trace $(test); result = 105
let test1 = Peek('EmployeeCode') ; -> Correct, if no row is stated, -1 is assumed and if no table_name is stated, the current table is assumed.
trace $(test1); result = 106
let test2 = Peek('EmployeeCode',0) ; -> Correct, if no table_name is stated, the current table is assumed.
trace $(test2); result = 101
let test3 = Peek('EmployeeCode','EmployeeDates') ; -> Incorrect, row_no is not being specified in this case.
trace $(test3); result = NULL