I have released two new product builds this morning. Icetips Utilities build 1.2.2433 and Icetips Previewer build 2.7.392.
The Previewer build fixes a problem with the Page of Pages template which I found out was not working with the Legacy/Clarion template chain. This build also includes the fix to scrolling under Clarion 10.
There are two new features in the Utilities that will come in very handy when dealing with importing comma separated files.
First is a new property, pDelimterStartsLine, to the SplitString method. It allows it to split strings where the delimiter is the beginning of a line, not the end of it. Normally SplitString splits strings based on CR+LF (<13,10>) characters at the end of the line. Recently a customer needed to split a string that had no CR+LF pairs, but each record started with a specific string. By implementing this change he was able to split up his file and read the data correctly.
The second new thing is the ParseCSVLine method. It takes a line of comma separated CSV data and splits it into fields, stored in the CSVFields property of the Icetips String Class. This method can take regular old CSV data and parse it into easily accessible field data. It handles commas in strings without problems so there is no worry about it getting out of sync if the data is otherwise properly formatted. I have made it flexible so that you can specify if strings are quoted or not (if they are, the code will look for and ignore commas inside the string) as well as specify the delimiter to use (up to 4 characters). The pStringsAreQuotes parameter defaults to TRUE and the pDelimiter defaults to a comma (,) Check out the demo code in the help:
ITS ITStringClass S STRING(255) I LONG F LONG X LONG CODE ITS.FileToLines('testcsv.csv') LOOP I = 1 TO Records(ITS.Lines) GET(ITS.Lines,I) F = ITS.ParseCSVLine(ITS.Lines.OL) ITS.ODS('Line: ' & ITS.Lines.OL) IF F ITS.ODS(' ' & Format(F,@n_3) & ' Fields from ' & ITS.Lines.OL) LOOP X = 1 TO F GET(ITS.CSVFields,X) ITS.ODS(' ' & Format(X,@n02) & ' ' & ITS.CSVFields.OL) END END END
There are also some fixes in this Utilities release:
March 10, 2015 | The template could cause classes to export an older version which could cause "xxx is unresolved for export" errors when compiling exporting dlls. Fixed. |
May 24, 2015 | Fixed a potential memory leak in the AddIntoParenthesis method. |
June 27, 2015 | Image Class ResizeImage method did not work correctly on reports. Fixed. |
June 27, 2015 | Image Class ResizeImage did not correctly size images when it was called multiple times for the same image control. Fixed. |
Arnor Baldvinsson