Do you know of a way on a REST response to return a property of Array type without defining a value?
DIMENSION Counties(1)
ADDPROPERTY(loResults,'Counties[' + TRANSFORM(1) + ']')
The default value seems to be "false" rather than "undefined" even though no value was specified. And assigning .null. returns just that... null.
Or do I need to trap for this in the Javascript on the client side?
Thanks
PS Happy Turkey Day!
Arrays can't be returned in FoxPro - it's an illegal operation.
If you're serializing to JSON return a Collection
or wwCollection
or a cursor, all of which will be serialized into a JSON array. If necessary you can use ArrayToCollection().
+++ Rick ---
Thanks for the answer, I am returning a collection so I've added the array to it but since it can be empty, I still need a value that will never come up as real data. I think I will assign .null. as a value and then trap for it on the client where I will convert null to unassigned.
Thank again for your thoughts.