Posts

Showing posts from February, 2018

Convert real number to time string

While I was developing a report for payroll module, We had done some customization for storing employee's total working hours in a separate table and I had to develop a report for employee's time sheet to show his/her time in and time out. As I was getting total time in hour [Real number] so I had to change real hour to time and then calculate employee's time in and time out for each day of the month. Here is the code to convert real hour to time. static void realHour2Time(Args _args) {     int     hours, minutes;     real    fractionalPart, hourInReal = 7.3555;     str     minStr, timeStr;     if (hourInReal != 0)     {         hours = trunc(hourInReal );         fractionalPart = hourInReal - hours;         minutes = fractionalPart*60;         if (strLen(strFmt("%1", minutes)) == 1)     ...

Extract DAX License codes to Text File

static void OutputLicenseToText(Args _args) {     #define.licenseVersion(2)     #define.KeywordLen(20)     #define.keywordLicense('License')     #define.keywordProperties('Properties')     #define.keywordCodes('Codes')     #define.keywordCodeLine('CodeLine')     #define.keywordDate('Date')     #define.keywordSerial('Serial')     #define.keywordValue('Value')     #define.blank('')     #define.space1(' ')     #define.space2('  ')     #define.space3('   ')     #define.spaceHash(' #')     #define.OutputFilename(@'C:\OutputLicenseKeys.txt')     #define.keywordInfo(1)     #define.keywordWarning(2)     SysConfig           sysConfig;     SysLicenseCodeSort  sysLicenseCodeSort;     container         ...