Page 1 of 1

line continuation for DS routine

Posted: Tue Sep 09, 2003 9:32 am
by msigal
Can anyone tell me if there is a line continuation charactar when writing DS Routines? I want to split up long lines across multiple lines. Or does the statement have to be all on the same line?

Thanks,
Myles

Example from Visual Basic, one can do the following with the underscore:

If this = true And that = true And _
theOtherThing = true Then
Do something
Else
Do nothing
End If

Posted: Tue Sep 09, 2003 11:43 am
by jseclen
Hi Myles...

All statements must be in one line, if you break the statement will have a compilation error..

Miguel Seclen
Lima - Peru

Posted: Tue Sep 09, 2003 5:40 pm
by ray.wurlod
Miguel's answer is correct, except for the exceptions! :)

Statements with multiple clauses (such as IF, READ, and so on) can have their clauses spread over multiple lines; though still one statement per line. If the clause-introducing keyword (ON ERROR, LOCKED, THEN or ELSE) is the final word on its line, there must be a corresponding END statement; this is known as multi-line format. If the clause-introducing keyword is not the last token on its line, then there must not be a corresponding END statement; this is known as single-line format.

Some statements that include comma-delimited lists, such as DIMENSION, COMMON, ON .. GOSUB, etc., can break to a new line at each comma.

But there is no line-continuation character per se.

Ray Wurlod
Education and Consulting Services
ABN 57 092 448 518