General information
Category:
Coding, syntax & commands
>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
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only