Marco,
If you use FWH Class TDataBase then you could easily "translate" long fieldnames into shortfield names in a similar way as Windows generates short filenames from long filenames.
This is an example to review the way Windows does it:
- Code: Select all Expand view
function Main()
lMkDir( "This is a long fieldname 1" )
lMkDir( "This is a long fieldname 2" )
MsgInfo( LFN2SFN( "This is a long fieldname 1" ) )
MsgInfo( LFN2SFN( "This is a long fieldname 2" ) )
return nil
You could create a function to make a similar conversion. Once you have it, then you could inherit from FWH Class TDataBase or modify it, so when a long fieldname is used, the TDataBase object translates it into its equivalent short fieldname:
MsgInfo( oDbf:ALongFieldName ) // the object class will translate it into a search for "ALONG~1", etc
To improve the search speed you could use hashes:
- Code: Select all Expand view
function Main()
local hValue := {=>}
hValue[ "LONGFIELDNAME1" ] := "LONGF~1"
hValue[ "LONGFIELDNAME2" ] := "LONGF~2"
MsgInfo( hValue[ "LONGFIELDNAME1" ] )
MsgInfo( hValue[ "LONGFIELDNAME2" ] )
return nil