In other languages we could put 2 statements on the same line.
A=1 : B =2 : C = 3
How do we do this in Xojo ?
In other languages we could put 2 statements on the same line.
A=1 : B =2 : C = 3
How do we do this in Xojo ?
You dont
Why do you feel you want to/need to anyway ?
I am going to be using code from one of my VB.net programs and i used this alot to organize my code better.
In my opinion its easier to group similiar code on a single line.
Split them into many single lines
It wont work otherwise
I did use a lot that syntax when I was using VB, but I have grown to appreciate the clarity of one command per line.
With all on a single line, it is too easy to overlook a part of it.
You can reformat your code in a regular expression-aware text editor using the tip I posted here. (It doesn’t look like you can do this directly in the IDE unfortunately.)
In this case, use the pattern:
"[^"\\r\
]*(?:"|$)(*SKIP)(*FAIL)|(?:'|//|\\bREM\\b).*$(*SKIP)(*FAIL)|[\\x20\\t]*;[\\x20\\t]*
On Windows, replace it with
\\r\
This will remove the spaces and tabs around the “;” too.
I believe the only multiple statement per line syntax that you need to be most worried about converting is something like
if condition then do_this:do_that:do_something_else
which would convert to
if condition then
do_this
do_that
do_something_else
end if
Actually, a simple global replacement in Word of “:” by “^p” would automatically cut all those verbose lines.
but it would NOT add the sometimes required “END IF”…which was my point
[quote=331914:@Kem Tekinay]You can reformat your code in a regular expression-aware text editor using the tip I posted here. (It doesn’t look like you can do this directly in the IDE unfortunately.)
[/quote]
That pattern doesn’t seem to work in RegExRX either ?
and the also breaks code lines containing quoted strings that have a “:” in them
s="Hello:World"
We live in an imperfect world
I tested it before posting…
DItto
Only think I can think of is that you copied and pasted the pattern into RegExRX, but didn’t notice the trailing EOL. Try this:
(?x)"[^"\\r\
]*(?:"|$)(*SKIP)(*FAIL)|(?:'|//|\\bREM\\b).*$(*SKIP)(*FAIL)|[\\x20\\t]*;[\\x20\\t]*