Information générale
Catégorie:
Codage, syntaxe et commandes
>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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement