BBC BASIC for Windows
« Another way to comment code »

Welcome Guest. Please Login or Register.
Apr 5th, 2018, 10:59pm



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

If you require a dump of the post on your message board, please come to the support board and request it.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Another way to comment code  (Read 748 times)
Michael Hutton
Developer

member is offline

Avatar




PM

Gender: Male
Posts: 248
xx Another way to comment code
« Thread started on: Apr 28th, 2009, 06:47am »

Another way to comment sections of code which people might like, rather than using REM or *| (also *| is not removed when compiled) is this:


:\
\\ you must start the commented area with :\
\\
\\ You can add multiple lines of comment
\\ like this
\\
\\ and this
\\
\\
\\
\\
\\ (you can't leave blank lines)
\\
\\ and you must end with a single backslash
\

I don't know if this commentry is removed by the compiler though.

Michael
User IP Logged

Michael Hutton
Developer

member is offline

Avatar




PM

Gender: Male
Posts: 248
xx Re: Another way to comment code
« Reply #1 on: Oct 13th, 2009, 02:44am »

You can also comment your ASM code by inserting

Code:
;\ A comment
 


or a block of comments with:

Code:
;\ Commentry
;\ More comments
;\ And more....
 


I haven't yet checked that the 'compile' option ignores these comments but I it does 'compile' with no errors.

Michael
« Last Edit: Oct 13th, 2009, 02:45am by Michael Hutton » User IP Logged

admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
xx Re: Another way to comment code
« Reply #2 on: Oct 14th, 2009, 1:25pm »

Quote:
You can also comment your ASM code by inserting ;\ A comment

Do remember, though, that an assembler comment ends at the next colon (for some strange reason known only to Acorn) so what you suggest is potentially misleading because there could be more assembler statements on the same line (which will be rendered in green by the editor).

Richard.
User IP Logged

Michael Hutton
Developer

member is offline

Avatar




PM

Gender: Male
Posts: 248
xx Re: Another way to comment code
« Reply #3 on: Oct 14th, 2009, 2:56pm »

Ah.

Indeed:
Code:
        ;\ a comment : inc dword [^A%]
 

compiles correctly but is misleading. So this form should be avoided.

Michael
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls