Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
HT Display dbf structure and sample data?
Message
From
14/11/2000 22:25:42
 
 
To
14/11/2000 20:31:39
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00441931
Message ID:
00441961
Views:
15
>Is there a clean way to display both a table structure and sample data from one record? TIA.
>For Example:
>Field, FieldName, Type, Width, Field Contents
>1 Name C 30 "Bob Smith"
>2. Address1 C 30 "1818 W. 11th"
>
>etc.

With a small applet, yes:
PROCEDURE PrintStruAndRec
LOCAL nCtr, cFldName
FOR nCtr = 1 TO FCOUNT()
  cFldName = FIELDS(nCtr)
  ? nCtr,cFldName,TYPE(cFldName),FSIZE(cFldName),EVAL(cFldName)
ENDFOR

PROCEDURE BetterStruAndRec
LOCAL aFlds[1,5],nCtr,nFlds, cFont
nFlds = AFIELDS(aFlds)
cFont = _Screen.FontName
_Screen.FontName = 'Courier New'
FOR nCtr = 1 TO nFlds
   ? nCtr, ;
     PADL(aFlds[nCtr,1],12), ;
     aFlds[nCtr,2], ;
     aFlds[nCtr,3], ;
     IIF(aFlds[nCtr,4]>0,aFlds[nCtr,4],' '), ;
     EVAL(aFlds[nCtr,1])
ENDFOR
_Screen.FontName = cFont
AFIELDS() provides a good deal of added information if you want it.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform