Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Subscript
Message
De
12/11/2021 13:28:19
 
 
À
12/11/2021 12:28:22
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
01682701
Message ID:
01682713
Vues:
39
It's not so easy to help you without more info. Anyway, the error you get indicates that you try to reference a cell in the array that doesn't exist. This kind of error is usually very easy using the debugger. Check the obvious things, like does the array really contain the number of element that you think it has?

If you are not familiar with the debugger. Tamar Granor released an informative white paper many years ago: http://tomorrowssolutionsllc.com/ConferenceSessions/Using%20the%20Visual%20FoxPro%20Debugger%20Effectively.pdf

>apologies to all.
>1. Yes adv does exist. It's created with this code:
>
DIMENSION aDV[nFieldCount]
>1a. nFieldCount is equal to the number of fields to be imported as Numberic, in this case, there are 48 fields to import
>
>2. dimensions of adv is the field count number on that particular line that is being imported.
>
>3. nfield value is 48(numeric)
>
>
>>1. It would be very helpful if you answer the questions...
>>2. Please format your code by using < pre > before the code and < /pre > after. Html don't show space and Tab characters without these html tags,
>>
>>Press the Adding Code to your Message button for details.
>>
>>Note that I had to add space characters here, without them the html tags won't show.
>>
>>>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
>>>
>>>>>Correct and full code:
>>>>>I**F aDV[nField]==["] && wgcs
>>>>> * Remove surrounding quotes
>>>>> ** aDV[nField] = SUBSTR( aDV[nField], 2, LEN(aDV[nField])-2 ) && wgcs
>>>>> **ENDIF
>>>>>>Keep getting the error subscript outside defined range on the following code:
>>>>>>
>>>>>>if adv(nfield0==["]
>>>>
>>>>Does array adv exist?
>>>>What are the dimensions of array adv?
>>>>what is the value of nField?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform