Unable to assign Picture Format to RecordSet Field PictureValue

Hi

When I try the example code from the Language Reference:

// rs is a RecordSet with a picture column called "ProductImage" Dim productImage As Picture productImage = rs.Field("ProductImage").PictureValue(Picture.FormatJPEG)
I get a compilation error: “This is not an array but you're using it as one

It works fine if I remove the code[/code]

Any one any thoughts?

[b]Thanks

Chris[/b]

I have:

productImage = rs.Field("ProductImage").PictureValue

and that works.

On the other hand, why do you want to assigh a file type (Picture.FormatJPEG) to a Picture ?

Thanks Emile. Yes, loosing the parameter works for me too. I’m trying to load an image and it’s returning nil in some cases, so I’m trying to build an if/elseif setup to try to cater for multiple formats. - Maybe PictureValue already does this and it’s a bug in the example…

At Record creation, Picture works fine. At Update time, the things are a bit different. I think the Picture have to be alone in the code (I do not recall how I’ve done that).

Can you tell me where in the documentation you find that code ?
(I do not found it in the LR)

Right in the Language Reference from the Contextual Help of the RecordSet’s PictureValue:

I will check, thank you.

I found it (but not from the above screen: I do not had it with Xojo 2018r3).

Strange.