Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Subscript
Message
From
12/11/2021 16:44:54
 
 
To
12/11/2021 15:46:33
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
01682701
Message ID:
01682718
Views:
37
>Just stepped through. i think the value is greater than the size of the array. When i step through it at the catch error, it shows adv as numeric 48, and the afield amount is 49. There are only 48 fields/columns in the spreadsheet I am trying to import.
>
>
>
>>
>>IF ALEN(aDV, 1) = 0
>>    FOR nIdx = 1 TO nCFldCnt
>>        nField = cCFlds[nIdx]
>>        IF aDV[nField]==["]  && wgcs
>>            * Remove surrounding quotes
>>
>>            aDV[nField] = SUBSTR( aDV[nField], 2, LEN(aDV[nField])-2 )  && wgcs
>>        ENDIF
>>    ENDFOR
>>ENDIF
>>
>>
>>You're retrieving value nField from array cCFlds (the value I presume is numeric) -- are you absolutely sure that the value you're obtaining isn't less than 1 or is greater than the size of the array aDV ?

That's what I suspected all the time. Maybe you need to check the csv file?

If you want me to take a closer look, zip an empty table with the correct structure, a sample csv and your code, and send it to my email address which you find in my profile. Instead of the empty table, you can send code to create a cursor.
Previous
Reply
Map
View

Click here to load this message in the networking platform