Jose,
I also looked at xBrowse and wonder how our code can adapt. TWBrowes accepts a bunch of parameters while XBrowse needs only one. We built many user interfaces around Wbrowse in our 16 bit version and to rewrite them in 32 bit looks like a big chalenge.
Generally xBrowse requires much less code than TWBrowse. The fact that TWBrowse accepts a lot of parameters and xBrowse doesn't, doesn't mean that xBrowse cannot be used. I'm sure most or all of the parameters can be used in xBrowse just by direct assignment.
Code: Select all
METHOD New( nRow, nCol, nWidth, nHeight, bLine, aHeaders, aColSizes, oWnd,;
cField, uVal1, uVal2, bChange, bLDblClick, bRClick,;
oFont, oCursor, nClrFore, nClrBack, cMsg, lUpdate, cAlias,;
lPixel, bWhen, lDesign, bValid, bLClick, aActions ) CLASS TWBrowse
You could even create a function to do this. Something like:
Code: Select all
function setupXBrowse(nRow, nCol, nWidth, nHeight, bLine, aHeaders, aColSizes, oWnd,;
cField, uVal1, uVal2, bChange, bLDblClick, bRClick,;
oFont, oCursor, nClrFore, nClrBack, cMsg, lUpdate, cAlias,;
lPixel, bWhen, lDesign, bValid, bLClick, aActions, oBrw )
oBrw:nRow := nRow
oBrw:nCol := nCol
oBrw:nHeight := nHeight
...
return nil
Note that I added oBrw as the last parameter. Now you can convert your wBrowse code even more easily.
Perhaps it just seems like a lot of work because you are not familiar with xBrowse. I suggest trying to convert a simple example of one of the TWBrowses in your code to see how it goes.
One more question about the twbrowse, I can't determine which statement at line 152 access an array that triggers the error?
There are only two arrays in the line, ::aColSizes and ::aJustify. However it is probably :bLogiclen which is defined like this in the setArray() method:
Code: Select all
::bLogicLen = { || ::nLen := Len( aArray ) }
However, as I said in a previous message, it really should be up to the programmer to make sure that bLogicLen is eval'd when the array length is changed. It would require way too much code in the TWBrowse source to check the array len each time bLogicLen was called. This would also slow down the browse itself.
Regards,
James