Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Circumventing 2GB Limit?
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00856128
Message ID:
00856344
Views:
14
Handy piece of code - you'll probably want to update it so it handles the newer data types (it hung up on a DateTime data type when I ran it on one of my tables, but I think it'll handle my client's data file fine).

Thanks very much for sharing it!

>>So my question is: Is it possible to create a VIEW greater than 2GB in VFP?
>
>Probably not, but why restrict your options? Can you run the following code (Fox 6 & later) and paste the results?
*- 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.
Kogo Michael Hogan

"Pinky, are you pondering what I'm pondering?"
I think so Brain, but "Snowball for Windows"?

Ideate Web Site
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform