*- AnalyseContent.Prg >Clear >cAlias = Alias() > >iMaxNameLen = 0 >For iField = 1 To FCount() > cField = Field( iField ) > iMaxNameLen = Max( iMaxNameLen, Len( cField )) >Next iField > >_ClipText = "<" + "pre>Statistics for " + cAlias ; > + Chr(13) + Chr(10) ; > + "Total Rows = " + Transform( RecCount( cAlias )) ; > + Chr(13) + Chr(10) ; > + Chr(13) + Chr(10) ; > + Space( iMaxNameLen - 1 ) ; > + "Type Len Min Max Avg Empty %" ; > + Chr(13) + Chr(10) ; > + Replicate( "-", iMaxNameLen ) ; > + "--------------------------------------------------------------" > >For iField = 1 To FCount() > cField = Field( iField ) > ? cField > cType = Type( cField ) > _ClipText = _ClipText ; > + Chr(13) + Chr(10) ; > + PadL( cField, iMaxNameLen ) + " " ; > + cType + " " ; > + PadL( iif( cType == "C", Len( Evaluate( cField )), "" ), 4 ) + " " > Do Case > Case cType $ "MLG" > *- Ignore > > Case cType == "C" > Select Min( Len( AllTrim( &cField. ))) As iMinLen ; > , Max( Len( AllTrim( &cField. ))) As iMaxLen ; > , Avg( Len( AllTrim( &cField. ))) As iAvgLen ; > , Sum( iif( Empty( &cField. ), 1, 0 )) As iEmpty ; > From (cAlias) ; > Into Array aStatistics > > Case cType $ "NY" > Select Min( &cField. ) As iMinLen ; > , Max( &cField. ) As iMaxLen ; > , Avg( &cField. ) As iAvgLen ; > , Sum( iif( Empty( &cField. ), 1, 0 )) As iEmpty ; > From (cAlias) ; > Into Array aStatistics > > Case cType $ "DT" > Select Min( &cField. ) As iMinLen ; > , Max( &cField. ) As iMaxLen ; > , -1 As iAvgLen ; > , Sum( iif( Empty( &cField. ), 1, 0 )) As iEmpty ; > From (cAlias) ; > Into Array aStatistics > EndCase > If _Tally > 0 Then > If Type( "aStatistics[ 1 ]" ) == "D" Then > _ClipText = _ClipText ; > + PadL( TransForm( aStatistics[ 1 ]), 11 ) + " " ; > + PadL( TransForm( aStatistics[ 2 ]), 11 ) + " " ; > + PadL( TransForm( aStatistics[ 3 ]), 11 ) + " " ; > + PadL( TransForm( aStatistics[ 4 ]), 11 ) + " " ; > + PadL( TransForm( Int( 100 * (aStatistics[ 4 ] / RecCount( cAlias )))), 6 ) > Else > _ClipText = _ClipText ; > + TransForm( Int( aStatistics[ 1 ]), "999,999,999" ) + " " ; > + TransForm( Int( aStatistics[ 2 ]), "999,999,999" ) + " " ; > + TransForm( Int( aStatistics[ 3 ]), "999,999,999" ) + " " ; > + TransForm( Int( aStatistics[ 4 ]), "999,999,999" ) ; > + PadL( TransForm( Int( 100 * (aStatistics[ 4 ] / RecCount( cAlias )))), 7 ) > Endif > Endif >Next iField >_ClipText = _ClipText + "<" + "/pre>" >? "Done." >Return .T.