>>>>Hi All,
>>>>
>>>>I am having a problem converting a program from 2.6 to VisualFP. The code 'Create Cursor xxx from Array yyy' works just fine in 2.6, but it gave me the 'Syntax error' when I ran that program in 5.0
>>>>
>>>>Please help!!! Thanks a lot.
>>>
>>>It works Ok in VFP5. You may try it:
>>>Select MyTable
>>>=Afields(MyArray)
>>>Create Cursor tmp From Array MyArray
>>
>>
>>Edward,
>>
>>Here is my code:
>>
>> SELE du
>> =AFIELDS(ladhdstru)
>> lclen=ALEN(ladhdstru,1)+1
>> DIME ladhdstru(lclen,4)
>> ladhdstru(lclen,1)='hccode'
>> ladhdstru(lclen,2)='C'
>> ladhdstru(lclen,3)=4
>> ladhdstru(lclen,4)=0
>>
>> CREATE CURSOR chkit FROM ARRAY ladhdstru
>>
>>I got the syntax error at the last line. What is the problem??
>
>In VFP, the array has about 15 elements per row, not 4 as was the case under FP 2.6. Take a look at the array created by AFIELDS() to get an idea of how to create and populate the array properly to do your CREATE CURSOR...FROM ARRAY under VFP.
Thanks a lot, guys. It works now.
Happy Thanksgiving to all of you.
Previous
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