Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why this code is crashing?
Message
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01001374
Message ID:
01001469
Views:
24
>The error I'm getting is "Subscript is outside defined range". I don't understand, why. I think, it's a bug in ASCAN function.
>
>Why
>
>? ascan(laRelations, m.lcTable, 2, ;
>			m.lnRelations, 4, 8)
>
>would return this error? lnRelations = 222. E.g. I can search from the first element, but I can not search starting from the second. Doesn't make any sense to me.
>
I found that I have to subsctract the number from the nElementsSearched, e.g.
? ascan(laRelations, m.lcTable, m.lnI, ;
			m.lnRelations - m.lnI, 4, 8)
works.
I would never have guessed that I need to substract this number and the Help is not explicit about it. Besides, I believe, I used that syntax without substracting before...
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform