New FTDN January 2013 (FWH 13.01)

New FTDN January 2013 (FWH 13.01)

Postby Antonio Linares » Sat Feb 02, 2013 5:01 pm

January 2013
============

* New: Method SetColor( nClrText, nClrPane ) or SetColor( cColors ) is available
for Class TMsgItem:

viewtopic.php?p=139040#p139040

* Fix: xbrcode.prg: Fix in function cEditConst() and cMarquee()

* Fix: XBrowse.prg. Fixed unlocking problems while editing cells.

* Fix: Image.prg. Function FILoadFromMemory() was not releasing memory properly. Fixed now.
Consequently TXBrowse class while displaying images from databases was fast losing memory. This is resolved now.

* Enhancement to Open Excel Book/Range functions:

(a) GetExcelBook( [cBook], @lOpened ) --> oBook
New second optional parameter lOpened by reference. If the function opens the excel book, lOpened is set to .t. otherwise .f.
If oBook is not nil and lOpened is .f., it means the book is already open by the user and not opened by the function now.
This value can be used to decide whether or not to close the book after usage.

(b) GetExcelRange( [cBook], [cSheet], [cRange], @lOpened )
The new fourth parameter functions exactly like above.

* New: Function FW_ExcelToDbf( [oExelRange], [cFieldList], [lRangeHasHeaders], [bProgress] ) --> lSuccess
Provided in database.prg.
This function is coplementary to the already exisiting FW_DbfToExel function.

Before calling the function, the destination table must be opened and should be the default alias.
Best way is to call the function aliased eg. DEST->( FW_ExcelToDbf( ... ) )

Parameters:

1. oExcelRange (optional): Valid Excel Range Object. GetExcelRange() function in the olefuncs.prg provides any easy way to get the range
object of the required range.
If this parameter is not provided, the function tries to use the UsedRange of any ActiveSheet already opened by the user as default.

2. cFieldList (optional): Example: "FIRST,LAST,CITY". If this list is provided, the values from excel in successive columns ( 1,2,3,...)
are saved in the fields in the order they appear in the cFieldList, if the field name exists in the destination DBF.
Emoty or invalid field names are skipped. For example if the field list provided as "FIRST,CITY,LAST,,,SALARY" then values in the columns
1,2,3,6 of excel sheet are saved to fields FIRST,CITY,LAST and SALARY.
If this parameter is specified, contents of Header Row ( if exists ) in the Excel range ar ignored and not used. (Please see the next parameter)

3. lRangeHasHeaders (Optinal): If this parameter is .t., the function considers the first row of excel range as Headers and 2nd row onwards as data.
If the paramter is .f., first row also is considered as part of data.
If the parameter is nil or not speicifed, the function attempts to decide if the first row is a Header Row. If all values in the first row are
character type and any one value in the second row is a non-character type the function assumes that the first row contains headers.
It is desirable to specifically provide this paramter.
If the range has headers and cFieldList (2nd paramter) is not provided, the values are saved to fields corresponding to the names in the header,
if found, or else skipped.
If cFieldList (2nd paramter) is specified, the contents of the header row are totally ignored and the values from columns 1,2,...n are stored
serially in the fields provided in the field list.

4. bProgress (optional). eg: { |nRow,nTotalRows| <function>( nRow, ntotalrows ) }.
If provided the codeblock is evaluated with 0, nTotalRows first and then for every row is evaluated with row number or total number of rows as
parameters

Type conversion: Where the valtype of the value in excel does not match the field type, simple conversion is attempted. Higher numeric values than
the size of the numeric field result in Runtime Error,

* Enhancement: Classes source code have been modified to make it compatible with the most recent Harbour version, keeping background
compatibility with previous source code:

viewtopic.php?p=139379#p139379

Please remember to replace all your Super calls with ::Super.

http://harbour-project.svn.sourceforge. ... 6&r2=18756
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42098
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Return to WhatsNew / Novedades

Who is online

Users browsing this forum: No registered users and 23 guests