Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DbGetProp(field,'FIELD','Caption')
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00040655
Message ID:
00043037
Vues:
77
>>>>I have =AFIELDS(myarray) and then myvariable = myfunction(@myarray,parameter2). In the function, I loop from I = 1 to ALEN(myarray,1) and
>>>>
>>>>cTemp = dbGetProp(myarray(I,1),'FIELD','Caption').
>>>>
>>>>If there is a caption, it works. But if there isn't one, I get a "Function argument value, type, or count is invalid." What's wrong? Thank you.
>>>
>>>Bret, I haven't tested this, but if there's no caption, your dbgetprop() may be trying to process a .NULL. value. Could you run a test or two on the fields without captions and see what value is returned for an empty caption? The answer may be to go to each field and enter a couple of spaces in the empty captions.
>>>
>>>Barbara
>>Sorry it took me so long to reply, but I'm having trouble getting in here from work, and have to dial in from home.
>>
>>I eventually noticed that the documentation says that dbGetProp wants alias.field as the first argument, not just field. However, if the caption is not empty, it will return the caption without error. AFIELDS(), of course, just puts the field name in the array. Using ALIAS()+myarray(i,1) solved the problem. Weird, huh?
>
>Bret, that IS a weird one. Thanks for letting us all know. This kind of thing pops up and bites you when you least need to waste time.
>
>Barbara
I guess we should always remember not to count on FoxPro to work in ways it specifically says it doesn't.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform