Unable to assign Picture Format to RecordSet Field PictureValue

  1. last week

    Chris O

    Dec 3 Pre-Release Testers, Xojo Pro

    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 (Picture.FormatJPEG)

    Any one any thoughts?

    Thanks

    Chris

  2. 7 days ago

    Emile S

    Dec 3 Europe (France, Strasbourg)

    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 ?

  3. Chris O

    Dec 3 Pre-Release Testers, Xojo Pro

    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...

  4. Emile S

    Dec 3 Europe (France, Strasbourg)

    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)

  5. Chris O

    Dec 3 Pre-Release Testers, Xojo Pro

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

    -image-

  6. Emile S

    Dec 3 Europe (France, Strasbourg)
    Edited 7 days ago

    I will check, thank you.

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

    Strange.

or Sign Up to reply!