Tomatoes on my eyes?

That’s what we’re saying here if you must have made some stupid mistake but cannot see it, no matter what you try.
Today is such a day: Could you tell me why

Function RowValues(rs as recordset) As text dim count as integer = me.ColumnCount -1 dim result() as text for q as integer = 0 to count dim fieldname as text = mTable.FieldWithName(Heading(q).ToText).Name dim val as string = rs.field(fieldname).StringValue result.Append val.totext next dim erg as text erg = text.Join(result, EasyQLite.Comma) return erg End Function

gives me an error “String has no member named “join””?

FieldWithName(Name as text).Name returns a Text, and EasyQlite.Comma is a private Text constant “,” of a module.
It’s completely silly, I use text.join on other places in this project. What do I oversee?

Shouldn’t this:

erg = text.Join(result, EasyQLite.Comma)

Be written

erg = result.Join(result, EasyQLite.Comma)


No, that gives a “Type “Text()” has no member named join” error.
And join is a shared method. You could use an array of text instead. But somehow the compiler believes result() is a string array.

actually shouldn’t it be




[quote=249927:@Dave S]actually shouldn’t it be
No, that gives a “Type “Text()” has no member named join” error too.
And Join without Text is realbasic.join which expects strings according to the Code Editor.

Maybe this ??

dim erg as text =Join(result, EasyQLite.Comma)

[quote=249930:@Loannis Kolliageorgas]Maybe this ??

dim erg as text =Join(result, EasyQLite.Comma)[/quote]
No, that would again try to use RealBasic.Join with String Values.
Of course val could have been a bad name theoretically. I changed it just in case, but to no avail.

Do you all agree that at least one of the proposals should work? In that case I’d prepare a feedback case.

in another method, this works:

Sub SelectAll() static sel as PreparedSQLStatement if sel = nil then sel= Database.Prepare (text.join(array(EasyQLite.selectall, EasyQLite.from, mName), end if SelectionRecord = sel.SQLSelect End Sub

what if you changed

dim val as string = rs.field(fieldname).StringValue result.Append val.totext


result.Append rs.field(fieldname).StringValue.totext

That’s how the code initially looked, before I started to get verbose to find out where the error is.
Thanks to all of you! Still have the feeling I must be blind but I filed a FB entry now: <>

At the risk of asking the obvious, what is EasyQLite.Comma ?

What happens with

erg = text.Join(result, ",")

You might have a property called “Text” somewhere.

Or a constant:

Const text As String = "abc"

This will give you the String has no member named “join” error.

That’s my guess - been there; done that.

From what I can tell, this is because your code is on a subclass of ListBox and ListBox has a Text property that is a String.

Instead, it looks like you’ll need to use the Global prefix:

erg = Global.text.Join(result, EasyQLite.Comma)

Waa! Thanks a lot, Paul! Yes, I told you I was certain the error would be on my side - but after pondering a few hours over this easy code … Tomatoes, as I said.