Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Odd behavior with AFIELDS function
Message
From
11/06/1997 15:20:09
Jody Cairns
OAO Technology Solutions
Moncton, New Brunswick, Canada
 
 
To
11/06/1997 11:30:57
Jody Cairns
OAO Technology Solutions
Moncton, New Brunswick, Canada
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00035943
Message ID:
00035970
Views:
41
>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
Map
View

Click here to load this message in the networking platform