I’ve searched through the menus and preferences in the Xojo IDE but cannot seem to find a way to wordwrap anywhere.
Some of my code lines (especially SQL statements) are quite long.
I’ve searched through the menus and preferences in the Xojo IDE but cannot seem to find a way to wordwrap anywhere.
Some of my code lines (especially SQL statements) are quite long.
Theres no automatic code wrap, but you can use the line continuation feature.
Var s as String = hello + _
World
for sql I use something like
dim sqlCode as String = "select *"
sqlCode = sqlCode + " from mytable"
sqlCode = sqlCode + " where rowid=10"
it fits in the width of the window, and it’s easier to maintain if you need to change some fields in the query.
I also made some simple editor to manipulate sql queries, and then generate the corresponding xojo code
Or add a constant.
Its worth noting that the line continuation method works for more than just strings.
Shame there’s no proper word-wrap though, no idea why they’ve omitted that from the editor, would make for much easier code reading.
Sorry Kem, you’ve lost me…
You can add a String constant to a window, class, or module, and you can type your sql in there with a simple editor.
Oh, ok. Still not an elegant solution, I just figured I was missing a tick box in the preferences somewhere to turn on word-wrap, can’t quite believe it’s missing.
[quote=471113:@Rod Pascoe]I’ve searched through the menus and preferences in the Xojo IDE but cannot seem to find a way to wordwrap anywhere.
Some of my code lines (especially SQL statements) are quite long.[/quote]
So are some of mine. I split them with the continuation character - underscore (_)
this is the way I prefer to handle it… much more readable in my opinion
SQL= _
"SELECT id_list "+_
" FROM myTable "+_
" WHERE listname='xyz'"
[quote=471132:@Dave S]this is the way I prefer to handle it… much more readable in my opinion
SQL= _
"SELECT id_list "+_
" FROM myTable "+_
" WHERE listname='xyz'"
[/quote]
i usually replace the ‘xyz’ with a placeholder instead and then use replace the placeholder with the value.
So do I , but I was just illustrating the format the I use, not the code logic itself…
as a matter of fact… none of my SQL usually even has hard code table names… Those are all constants, on the off chance I need/want to change them before the app is complete. Change once, affect many.