Issue 61418 - BASIC: Do not use continuation line (_) within comments
Summary: BASIC: Do not use continuation line (_) within comments
Status: CLOSED FIXED
Alias: None
Product: documentation
Classification: Unclassified
Component: Manuals (show other issues)
Version: OOo 2.0.1
Hardware: All All
: P3 Trivial (vote)
Target Milestone: OOo 2.1
Assignee: joerg.skottke
QA Contact: issues@documentation
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-31 11:27 UTC by joerg.skottke
Modified: 2006-11-10 10:23 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description joerg.skottke 2006-01-31 11:27:26 UTC
There exists some confusion about the usage of the continuation marker _
(underscore) when used within comments (either ' or with REM) in BASIC.

Please add a comment in the appropriate place.
See issue #59790 for details, short explanation follows (talken from the issue):

[...]
> - this should be properly documented in the on-line help (and in StarOffice 8 
> Programmer's Guide)

But it is documented. In the current (m150) online help I found under
"The Basic Editor" - ok, maybe this is not the most adaquate place:

    Long lines can be split into several parts by inserting an 
    underline character _ as the last character of a line. This 
    connects the line with the following line to one logical line.

 - the syntax coloring in the IDE should "know" this new feature : today it still 
colors reserved words in the subsequent comment line.

Right, this indeed is a bug. But as it is surpisingly difficult to
fix and I don't consider the whole "REM _" scenario as particularly
important, I doubt that it has a chance to be fixed very soon. There
are simply too many more important tasks.


> About the consequences of the current design, a macro with an ending _ in a
comment may 
> work incorrectly, or not at all, because the next line will not be executed. You 
> cannot say "there is no crash, no data loss", anything can happen, with any 
> consequence.

The only problem I see is that the behaviour changed. But the old be-
haviour just was wrong taking VB as reference. This problem will be
solved with my fix. It's correct, that the next line will not be exe-
cuted with the new behaviour, but this should be no problem as nobody
needs to use " _" at the end of a comment line and if he does, al-
though the next line should be executed, it's just a bug in the macro.

[...]
Comment 1 Uwe Fischer 2006-01-31 12:36:04 UTC
changed text\sbasic\shared\01030200.xhp
New text: Long lines can be split into several parts by inserting an underline
character _ as the last character of a line. This connects the line with the
following line to one logical line. (But for comment lines that end with an _
character, the comment extends to the next line only if you did not set "Option
Compatible". With "Option Compatible" set, the comment ends at the last
character of the first line, and the following line will be executed.)
to find: Index "Long lines;in Basic editor"
Comment 2 bmarcelly 2006-01-31 13:16:21 UTC
This doc change is incorrect:
for comment lines that end with an _
character, the comment extends to the next line only if you did not set "Option
Compatible"

In fact it is the opposite!! I would just add to the current text:
If Option Compatible is used in the same Basic module, the line continuation feature is 
also valid for comment lines.

While you are at updating Help, the help page Rem Statement [Runtime] should also 
indicate this feature.
Comment 3 Uwe Fischer 2006-01-31 14:28:38 UTC
Oops, you're right. Changed text\sbasic\shared\01030200.xhp
New text: Long lines can be split into several parts by inserting an underline
character _ as the last character of a line. This connects the line with the
following line to one logical line. (If "Option Compatible" is used in the same
Basic module, the line continuation feature is also valid for comment lines.)
to find: Index "Long lines;in Basic editor"
Also added this text note:
You can use the underline character _ as the last character of a line to
continue the logical line on the next line. To continue comment lines, you must
enter "Option Compatible" in the same Basic module.
to file text\sbasic\shared\03090407.xhp
to find: search Basic help for "REM statement"
Comment 4 Uwe Fischer 2006-04-28 14:26:09 UTC
changed target
Comment 5 Uwe Fischer 2006-06-20 06:56:26 UTC
please verify in hcshared01. Open Basic help, index "REM statement". Find text
as proposed.

re-open issue and reassign to jsk@openoffice.org
Comment 6 Uwe Fischer 2006-06-20 06:56:30 UTC
reassign to jsk@openoffice.org
Comment 7 Uwe Fischer 2006-06-20 06:56:33 UTC
reset resolution to FIXED
Comment 8 joerg.skottke 2006-07-25 10:20:45 UTC
verified.
Comment 9 joerg.skottke 2006-08-09 12:55:51 UTC
target
Comment 10 joerg.skottke 2006-11-10 10:23:35 UTC
close