Olá Itamar,
Itamar M. Lins Jr. escreveu:Então não é fix do Przemek ?
Na minha opinião não. É apenas uma sugestão do Franček Prijatelj pedindo uma correção na função FieldName(). Porém, acho que a função FieldName() reconhece a constante:
#define HB_SYMBOL_NAME_LEN <n>, veja o fonte da função FieldName():
HB_FUNC( FIELDNAME )
{
char * szName;
AREAP pArea = ( AREAP ) hb_rddGetCurrentWorkAreaPointer();
USHORT uiFields, uiIndex = hb_parni( 1 );
if( pArea && uiIndex )
{
if( SELF_FIELDCOUNT( pArea, &uiFields ) == SUCCESS &&
uiIndex <= uiFields )
{
szName = ( char * ) hb_xgrab( pArea->uiMaxFieldNameLength + 1 );
szName[ 0 ] = '\0';
SELF_FIELDNAME( pArea, uiIndex, szName );
hb_retc_buffer( szName );
return;
}
/* This is not Clipper compatible! - David G. Holm
*
hb_errRT_DBCMD( EG_ARG, EDBCMD_FIELDNAME_BADPARAMETER, NULL, HB_ERR_FUNCNAME );
*/
}
hb_retc( NULL );
}
Observe a linha 12:
szName = ( char * ) hb_xgrab( pArea->uiMaxFieldNameLength + 1 )Itamar M. Lins Jr. escreveu:Chamar fcount() toda hora em uma tabela muito grande cai a performance.
Sim! Sempre que uma função a usar num laço pode retornar um valor fixo, também coloco numa variável.