Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
APPEND FROM ARRAY problems...
Message
From
26/08/1997 15:59:52
Matt Mc Donnell
Mc Donnell Software Consulting
Boston, Massachusetts, United States
 
 
To
26/08/1997 15:42:41
Matt Mc Donnell
Mc Donnell Software Consulting
Boston, Massachusetts, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00046997
Message ID:
00047011
Views:
30
>>Alex,
>>
>>>Try this :
>>>DIMENSION laTest(3,1)
>>> laTest(1,1) = "1"
>>> laTest(2,1) = "2"
>>> laTest(3,1) = "3"
>>> CREATE CURSOR cTest (TestField C(1))
>>> APPEND FROM ARRAY laTest
>>> BROWSE
>>> USE IN cTest
>>>Alex.
>>
>>
>>It worked! In my application I'm actually doing a SELECT INTO ARRAY, but I'm adding a row using DIMENSION (ALEN() + 1) along with AINS().
>>
>>Do you know why it didn't work the other way?
>
>I'm pretty sure that VFP assumes a one-dimensional array is a single row. Try modifying the original CREATE to :
>CREATE CURSOR cTest(Field1 C(1), Field2 C(1), Field3 C(1))
>
>I think you'll populate all 3 fields if you append from a one-dimensional array.

Jim,

Make sure you change the DIMENSION statement to (ALEN() + 1 ,1)
Matt McDonnell
...building a better mousetrap with moldy cheese...
Previous
Reply
Map
View

Click here to load this message in the networking platform