Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DbGetProp(field,'FIELD','Caption')
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00040655
Message ID:
00042048
Views:
50
>>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?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform