Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Odd behavior with AFIELDS function
Message
De
11/06/1997 15:20:09
Jody Cairns
OAO Technology Solutions
Moncton, Nouveau-Brunswick, Canada
 
 
À
11/06/1997 11:30:57
Jody Cairns
OAO Technology Solutions
Moncton, Nouveau-Brunswick, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00035943
Message ID:
00035970
Vues:
39
>iIf I open a table that doesn't belong to a database, and issue the command "NumFields = AFIELDS(laField)", the value of NumFields is a string, not the value that AFIELDS is supposed to return!

Here's a small program to illustrate the problem. It creates a table called TMP.
Instead of using "t", try "lnNumFields". In that case, it worked! Go figure.
Anyone come across this?

* Begin
LOCAL i, lcCreate, t

lcCreate = SPACE(0)

FOR i = ASC('a') TO ASC('z')
lcCreate = lcCreate + CHR(i) + ' C(10), '
ENDFOR

lcCreate = LEFT(lcCreate, LEN(lcCreate) - 2)

lcCreate = 'CREATE TABLE tmp (' + lcCreate + ')'

&lcCreate

t = AFIELDS(laField)

* The variable should be a Numeric type, since that's what AFIELDS() should return.
* But for me, it is a Character type.

WAIT WINDOW "TYPE(lcNumFields) = " + TYPE('t')
?t

USE
DELETE FILE tmp.dbf

*End
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform