Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Error in form
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00691324
Message ID:
00691385
Vues:
18
Hi,

>Declaring the array worked. I'm curious.. since it does not HAVE to be declared, and works fine at runtime, why would the compiler complain at build time?

I think it's the same thing like having an array passed to a function/proc/method as a parameter. If you're doing tat you have to put a line like EXTERNAL ARRAY aArray in your code, so the compiler doesn't complain.

>By the way, yes, the line you mentioned does work (there are 2 columns in the array).

Very interesting. I never used ALEN() with the array name between quotation marks. Just tested it. It really works. Help says: ALEN(ArrayName [, nArrayAttribute]), so I wouldn't expect that that to work ... BTW: You don't have to make the calculation yourself. Setting 1 as nArrayAttribute returns the rows.

>Thanks for your help, I've had that error nag me for a month!

You're welcome!

Armin


>
>Thanks for your help, I've had that error nag me for a month!
>
>
>>Hi,
>>
>>here are some comments:
>>
>>
>>   *-- Is the array declared? You don't have to, but it's always a good idea.
>>   LOCAL ARRAY aEmployees[1]
>>   *--
>>
>>   select SEMPCODE,SNAME from EMPINFO where &cFilter into array aEmployees
>>   with ThisForm.lstEmployees
>>        .Clear
>>
>>        if type('aEmployees')='U'
>>           wait 'No Employees found matching the selection criteria';
>>                window timeout 5
>>           return
>>        endif
>>
>>        *-- Did this line really work?
>>        *-- nTotalItems=(alen('aEmployees')/2)
>>        nTotalItems = alen(aEmployees,1)
>>
>>        for x = 1 to nTotalItems
>>            .AddItem((aEmployees(x,1)),x,1)   && Either of these
>>            .ListItem(x,2)=(aEmployees(x,2))  && two lines cause the error
>>        next
>>        .Value=.List(1)
>>        .Refresh
>>   endwith
>>
>>
>>HTH,
>>Armin

Armin Neudert
Regional Director (Stuttgart) of German FoxPro User Group dFPUG

MCP for Visual FoxPro

Expert/Editor of the VFP section in the German Codezone community portal
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform