Home | Contact Us | Buy
Time and Attendance made easy  

 

Functions

Function Description
Abs(e) Returns the absolute value of the expression e.  This is the positive value - and minus signs are ignored.
AccessClocking() Returns a 1 if it is a access clocking, else a 0.
All(Character,Number) Repeats the Character, number times, and returns the result.
BeginsWith(‘x’,’xyz’) If the second string (‘xyz’) begins with the first string (‘x’) then this function returns 1 otherwise it returns 0.  The function is not case sensitive. 
CalcLeaveLeft(Date,Leavetype) Returns the amount of leave left to an employee as at a specific date. Type is 1 (Paid) or 2 (Sick).
Centre(Value,Length) Adds spaces to the left of the value until the Value is centered in the Length.
Changed (‘x’) x is any variable. If x has changed since the last call to Changed (‘x’) then this function returns 1. Otherwise it returns 0.  This is most useful in determining the conditions under which to print a detail in a report. The Changed function returns 0 the first time it’s called for a variable.  Use the Header function, which is exactly the same if you want it to return a 1 the first time it’s called for a variable.
Chr(c) Returns the ASCII character of a particular number. For Example CHR(65) returns "A".
Clip(x) x is a String variable. Clip shortens it, for concatenation purposes, by removing trailing spaces.
Clock() Returns the current PC time. The answer is returned as a standard TNA 2000 time field, i.e. the number of 100ths of a second since midnight.  Use one of the Time pictures (@Tn) to convert it to a more readable format.
Contains(‘x’,’abcxyz’) If the second string (‘abcxyz’) contains the first string (‘x’) then this function returns 1 otherwise it returns 0.  The function is not case sensitive.
CountClockings(Site,Empno,Startdate,
Enddate,Starttime,Endtime,Options,Device)
Counts the number of clockings for an employee in a specific time period. Options are DTC where D is Direction (I,O,B) T is Type (M,B,C).  Leave it blank to count all the clockings. 
CountPayrollHours(Site,Empno,FromDate,
ToDate,Rate,FromCategory,ToCategory,Step)
 
CountTime(Site,Empno,Startdate,Enddate,
StartTime,EndTime,Options,Device)
Counts actual time in,or out, for an employee. Options are DTC where D is Direction (I,O,B) T is Type (M,B,C) and C is ClockType (P,A,T).
DecHours(t) This function takes a time (t) and returns a formatted string containing the hours in decimal format. I.e. hhhh where no decimal point is included. The last two digits are implied to be decimal. The maximum time this function can return is 9999 - which is 99.99 hours. This means a maximum value for t of 35,996,400.
DOW(Date) Returns the Day of the week, where Sunday returns 1 and Saturday returns 7.
Date(Month,Day,Year) Creates a standard date value from the 3 components.
Day(Date) Returns the Day part of the date.
Deformat(Value,Picture) Opposite of Format. Returns the Human readable form to the original form.
EmpExpected(Site,Empno,Date,Time) Returns the code of the Daily Shift if the employee should be working at this time. Returns nothing if the time is outside the workday.
EmployeeAbsent(Date,Time) This function returns a 0 if the employee was not absent at the time mentioned, or a 1 if they are absent.  This function will attempt to determine absenteeism, based on the employee’s current schedule.  If however the employee is on a variable shift, i.e. he can clock in for more than one shift during the day, and then this function will give the benefit of the doubt to the employee.
EmployeeAreaName(Site,Empno) Returns the Description of the current Employee Access Area.
EmployeeAreaStatus(Site,Empno) Returns the current Employee Access Area.
EmployeeInGroup() If the current employee is in the group picked for this report, then this returns a ‘1' otherwise it returns a ‘0'. This is most useful when determining the range of employees to be printed. If the Employee file is the primary file in a report, then there is no need to use this function as it will be used automatically for you.
EmployeeStatus(Site,Employee) If the employee is currently IN then this returns an ‘I’. If the employee is currently out then this returns an ‘O’.  This function only applies to Pay clockings.
EmployeeAccessStatus(Site,Employee) Same as EmployeeStatus, but for Access clockings only.
EndsWith(‘z’,’xyz’) If the second string (‘xyz’) ends with the first string (‘z’) then this function returns 1 otherwise it returns 0.  The function is not case sensitive.  Also trailing spaces are automatically excluded.
Format(Number,Picture) Format is used to convert a numeric, date or time value into a formatted string which is easier to read. 
GetCategory(Number) Returns the name of a specific Category from the number.
GetClockings(Site,Empno,Date,
Start clocking,End clocking,Podo,
LineUsed,Options)
This function returns a string containing all the clockings for an employee for a date. The list always starts with the first In clocking, if a leading Out clocking exists then it is ignored. The list always ends with a trailing Out clocking if (a) one exists, and (b) if it occurs either on the date being queried, or the following day. Clockings marked as deleted are not included.  The function returns a string of up to 255 characters long containing as many clockings as exist for the employee on that day. However this length can be shortened on a report to allow for space constraints.  This function only returns Pay clockings - for Access clockings use the GetClockingsAccess function.  Options:  I will suppress the I & O characters, M will suppress the M & B characters, J will include Job Clockings and D will include the clocking device.  Getclockings(site,empno,date,1,-1) will return the number of clockings for the day.
GetclockingsAccess(Site,Empno,Date) Same as Getclockings, but for Access clockings.
GetDeviceName(clo:device) Gets the device description where the clocking was made.
GetEmpDailyShift(Site,Empno,Date) Returns the current Employee's Daily Shift.
GetEmpJob(Site,Empno,Date) Returns the current Employee's Job.
GetEmpLeave(Site,Empno,Date) Returns the Leave Type for the employee for that day. 0 if not on leave.
GetEmpPayrollShift(Site,Empno,Date) Returns the current Employee's Payroll Shift.
GetEmpRights(Site,Empno,Device,Flag) Returns the current Employee Rights. Flag : 1=Clock In?, 2=ClockOut?, 3=Lock? 4=OpenDoor? Returns 1 for Yes, 0 for No.
GetEmpTimezone(Site,Empno,Controller,
Device,Date)
Returns the Time Zone code that will be applied to this employee.
GetError(Site,Empno,Date) This function returns a string containing the first error found for an employee on a specific date.  Both Daily and Weekly errors are searched for, but only the first one is returned in the string.  Remember that daily hours records are not made for days containing errors, so using this function in a loop on the daily hours file would be futile.
GetExpectedHours(Site,Empno,Date,Std) Returns the Expected Hours value for an employee.
GetFeature('x') When, for example, making generic job costing reports it would be helpful to determine which classifications are enabled and suppress the others in the report. Will return a 1 if a system feature is enabled and 0 if not.
GetHours(Site,Empno,Date,Category,Rate) Returns a summary (total) of the hours for an employee for a particular day. If Category, or Rate, are left blank then all Categories (or Rates) are included.
GetRate(Number) Returns the name of a specific Rate from the number.
GroupSize(Date,Time,Shift,Company,Branch,
Department,Costcenter,Category,Scale,Type,
Workgroup,Job,Area,Options)
Returns the number of employees in the group selected.
Header(‘x’) Same as the Changed function, but will return a 1 the first time it’s called for a variable.
Hours() The reverse of the DecHours function.
Int(e) Returns the integer part of the value of the expression e.  In other words any fractional part of the value is discarded.
InterpretAudit() Returns a string containing the meaning of the current audit code as stored in Aud:Code.
InterpretError() Returns a string containing the meaning of the current error code as stored in Err:Code.
InterpretWarning() Returns a string containing the meaning of the current warning code as stored in War:Code.
IsSupervised(SubSite,SubEmp,SuperSite,SuperEmp) Returns 1 if SubEmp is supervised by SuperEmp, else returns 0.
IsSupervisor(SuperSite,Super,SubSite,Sub) Returns 1 if SuperEmp supervises SubEmp, else return 0.
IsWarnExcused() This function returns one of '' (empty string) if warning is not excused or Response. Comment if warning is excused or 'excused' if warning is excused and comment is blank.
Left(value) Removes leading spaces from the Value.
LookupEmployee(Site,Empno) Loads an employee record.
Month(Date) Returns the Month part of the date.
PayCat (X) Returns the Payroll Name for the Time Category where x is the time category number.
Right(value,length) Adds spaces to the left of the value until the Length is reached.
TnaClocking() Returns 1 if this is a TNA (Payroll) clocking, 0 otherwise.
Today() Returns the current PC date. The answer is returned as a standard Clarion date field, ie the number of days since December 28th 1800.  Use one of the Date pictures (@Dn) to convert it to a more readable format.
TotalDailyHours(Site,Empno,FromDate,ToDate,
DOW,Category,Rate)
Returns the Total hours for an employee for a particular day (as displayed in the User module.) If rate is left blank then all Rates are included. Dow (Day Of Week) - if -1 it is ignored.
Year(Date) Returns the Year part of the date. (4 digits).

   Terms of Use      Disclaimer 

2007 CapeSoft Software (Pty) Ltd. All rights reserved.
This site is optimized for IE 6+, Firefox 1.0+, and resolution 1024*768 pix