General information
Category:
Coding, syntax & commands
>>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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only