Thats what were 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.
Its completely silly, I use text.join on other places in this project. What do I oversee?
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.
[quote=249927:@Dave S]actually shouldn’t it be
erg=result.join(easyqlite.comma)
[/quote]
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.
[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 Id prepare a feedback case.
EDIT:
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),EasyQLite.space))
end if
SelectionRecord = sel.SQLSelect
End Sub
Thats 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: <https://xojo.com/issue/42765>
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.