>DECLARE laFieldsX[1] >?aFieldsX(@laFieldsX) > >FUNCTION aFieldsX >*-- same as AFIELDS() but adds another column to the array which >*-- contains the field caption. >LPARAMETERS taArray > >LOCAL lnFields, lnCols, lcDbc, lcLongTableName, lcFieldName, lcCaption > >IF EMPTY(ALIAS()) > RETURN 0 >ENDIF > >lnFields = AFIELDS(laFields) >lnCols = ALEN(laFields, 2) + 1 >DIMENSION taArray[lnFields, lnCols] > >lcDbc = CURSORGETPROP("DATABASE") > >lcLongTableName = laFields[1, 12] > >FOR lnField = 1 TO lnFields > > FOR lnCol = 1 TO lnCols-1 > taArray[lnField, lnCol] = laFields[lnField, lnCol] > ENDFOR > > IF NOT EMPTY(lcDbc) > *-- add caption to array > lcFieldName = lcLongTableName + "." + laFields[lnField, 1] > lcCaption = DBGETPROP(lcFieldName, "FIELD", "CAPTION") > ELSE > lcCaption = "" > ENDIF > taArray[lnField, lnCols] = lcCaption > >ENDFOR > >RETURN lnFields >>