Skip to main content
guest
Join | Help | Sign In
Liberty BASIC Programmer's Encyc Home
guest| Join | Help | Sign In
Liberty BASIC Programmer's Encyc
  • Wiki Home
  • Recent Changes
  • Pages and Files
  • Members

Home

General Tutorials
Advanced Tutorials
GUI Programming
Graphics and Games
Strings and Text
Numbers and Math
Using Files
Windows API
Communications
Programmer's Tools

Articles by Date
FAQs
Rosetta Code
General Articles
Newsletters Contents

Table of Contents
Demos

Submit Articles
TOS and License

0306

Edit 1 …
  • 1 Tags
    • tutorials
  • Notify
  • RSS
  • Backlinks
  • Source
  • Print
  • Export (PDF)
Older Version Newer Version

Alyce Alyce Nov 4, 2006

Lesson Map | Next > Mainwin Summary

Add Comments


So far, every word you've typed into your programs has been an instruction for Liberty BASIC. You can also add notes for yourself that Liberty BASIC ignores. You might want to give yourself a note to remind you what the code does. You might want to note any errors or additions you hope to make to the code in the future. These notes to yourself are called comments .

You can include comments in the code in two ways. The keyword REM at the very beginning of a line tells Liberty BASIC that the text on the line is a comment. Liberty BASIC then ignores everything on that line of code.

 REM This is a comment. Liberty BASIC ignores this text! 

You can also begin a line of code with an apostrophe, which looks like this. ' It works just the same as REM .
 'This is a comment. Liberty BASIC ignores this text! 

The apostrophe gives you an additional ability. Liberty BASIC will ignore the text following an apostrophe within a line of code, as long as the apostrophe is not contained inside of quoted text. In the following code, Liberty BASIC reads the instruction to print "Hello, World!" but it ignores the comment after the apostrophe.

 Print "Hello, World!" 'My first program! 

Lesson Map | Next > Mainwin Summary
Help · About · Pricing · Privacy · Terms · Support · Upgrade
Contributions to https://lbpe.wikispaces.com/ are licensed under a Custom License.
Portions not contributed by visitors are Copyright 2018 Tangient LLC
TES: The largest network of teachers in the world
Turn off "Getting Started"
  1. Home
  2. ...
Loading...