Breaking Long Code Lines
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2004-04-27 02:47 AM
2004-04-27
02:47 AM
7 REPLIES 7
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2004-04-27 03:12 AM
2004-04-27
03:12 AM
It depends on what is making your line long. You can always put a return (line feed) after a comma. I don't think you can break up a formula (i.e. return after a `+` or such). You might be able to return after `&` and `OR` conditions. I don't recall if I've tried this or not but I think the comma is the only line continuation character.
The short answer is to add a return/line feed and see if an error results.
The short answer is to add a return/line feed and see if an error results.
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2004-04-27 03:40 AM
2004-04-27
03:40 AM
Also (I guess you allready know this, but...) the colon ":" symbol is meant to combine 2 lines into 1, so replace it with a return.
I doubt that's the problem, but you never know.
I doubt that's the problem, but you never know.
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2004-04-27 03:57 AM
2004-04-27
03:57 AM
It's a mathematical equation. Neither the comma nor the colon work. Oh well.
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2004-04-27 04:18 AM
2004-04-27
04:18 AM
Try splitting the statement like so:
x = 5 + 20 x = x + 25And so x becomes 50. It's an option


Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2004-04-27 12:48 PM
2004-04-27
12:48 PM
Jay wrote:Jay
How do you break a single long line of code into several shorter lines? ....
From the GDL manual, Chapter 2, section on character strings:
\new line continue string in next line without a new line
I don't know if this works - have never tried it.
cheers
Daniel
-------------------------------------
Daniel Lindahl Architecture
AC24 | Dell Inspiron 16+ | Windows 11
Daniel
-------------------------------------
Daniel Lindahl Architecture
AC24 | Dell Inspiron 16+ | Windows 11
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2004-04-28 04:57 AM
2004-04-28
04:57 AM
Daniel ,
I have some code with some very long "if....then" statements
with lots of "and"s and "or"s that had to be on one line or I
would get error messages if I tried to use commas but
I just tried your suggestion of using the backward slash character
"\" new line to break up the statement into several lines
and I get no error messags.
Thanks for the tip.
Peter Devlin
I have some code with some very long "if....then" statements
with lots of "and"s and "or"s that had to be on one line or I
would get error messages if I tried to use commas but
I just tried your suggestion of using the backward slash character
"\" new line to break up the statement into several lines
and I get no error messags.
Thanks for the tip.
Peter Devlin
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2004-04-28 04:50 PM
2004-04-28
04:50 PM
I tried the backslash in the middle of a very long mathematical statement and it worked just fine.
