SQLdeLite and compiler error about more than one item with name

I just started a new web app and though I would try out SQLdeLite for the first time.

I pretty quickly ran into that oldie but goodie compiler complaint about “more than one item with this name and it’s not clear to which this refers.”

This was on a line pretty much straight from the examples like so:
rec.name = tfName.text
rec.title = tfTitle.text

Looking at the class code it seemed like it should be working. When I replaced the tfName.text with a literal like, “Joe Bob”, there was no error.

So I thought to try the ToText and that seemed to work.

rec.name = tfName.text.ToText works fine.

Is this simply due to new vs old framework oddities with string vs text type? It sure seems weird to write text.ToText to get something as text.

From Release note :
Version 2.1609.130 - September 13th, 2016

  • Added String support to support old framework Xojo classes. To enable string support for TextLiteral’s navigate to the SQLDeLite.Record class and
    rename the ‘Operator_Lookup_STRINGSUPPORT’ method to just ‘Operator_Lookup’. It will join the other overloaded methods and now String support is enabled.

Thanks for that. I was looking on github at the readme file and totally missed the release notes in the module itself.

When I write code that uses SQLdeLite, I use what I call a Textify function:

// Function Textify(s As String) As Text
Return DefineEncoding(s, Encodings.UTF8).ToText

This lets me wrap strings to work with SQLdeLite. Alternatively, you could do what is offered above, renaming the ‘Operator_Lookup_STRINGSUPPORT’ method to just ‘Operator_Lookup’, but you’ll have to remember to do that each time SQLdeLite is updated with new code.