views:

26

answers:

2

Dear all,

In a Visual Foxpro application one of the users get an error (the rest doesn't). And i believe its because arrays are used in the form of arr(number) instead of arr[number] . Does anyone know what causes this strange behavior at a single user?

Thanks!

A: 

Either use of array references is valid as long as its properly balanced as () or []. The problem is probably upstream where the array is getting declared or prepared. I've had to debug historically strange instances like this where one user was going about a process in a totally different way than others, and the business work flow... Anyhow, because of some "bypassed" process, the array wasn't getting created and thus forced a failure.

Does it always crash at the same location in the process?

I would strongly encourage some error trapping in the process for this "one" user. Worse comes to worse, I would put something in the area of the code something like...

if atc( "PersonsLoginName", sys(0)) > 0 TurnOnMyCustomDebugging() && for this special scenario trapping endif

Additionally, I don't know what you have for error trapping routines, but I'd get a dump of memory at the time of the error and the full call stack that got the user to that point. If you need help on that, let me know too.

DRapp
A: 

Foxpro does not differentiate between the two. This is actually documented in both the DIMENSION and DECLARE commands' remarks.

In fact, the documentation doesn't strictly follow one way or another. The DIMENSION and DECLARE commands define the syntax with parenthesis ().

DIMENSION ArrayName1(nRows1 [, nColumns1]) [AS cType]
   [, ArrayName2(nRows2 [, nColumns2])] ...

But the example provided in the Arrays section of the documentation uses brackets [].

DIMENSION ArrayName[5,2]
ArrayName[1,2] = 966789
John L Veazey