Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
HT Display dbf structure and sample data?
Message
De
14/11/2000 22:25:42
 
 
À
14/11/2000 20:31:39
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00441931
Message ID:
00441961
Vues:
8
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform