IT SOLUTIONS
Your full service technology partner! 
-Collapse +Expand
VB Classic
Search VB Classic Group:

Advanced
-Collapse +Expand VB Classic Store

Prestwood eMagazine

September Edition
Subscribe now! It's Free!
Enter your email:

   ► KBProgrammingVB ClassicTool Basics   Print This     
  From the January 2016 Issue of Prestwood eMag
 
VB Classic Tool Basics:
VB Classic Comments (' or REM)
 
Posted 12 years ago on 11/14/2008 and updated 1/29/2009
VB Classic Code Snippet:
 A flashcard from our VB Classic Flashcards Library
 A code snippet from our VB Classic Code Snippets Page

KB101507

Languages Focus: Comments

Commenting code generally has three purposes: to document your code, for psuedo coding prior to coding, and to embed compiler directives. Most languages support both a single line comment and a multiple line comment. Some languages also use comments to give instructions to the compiler or interpreter.

VB Classic Comments

Commenting Code
VB Classic, like all the VB-based languages, uses a single quote (') or the original class-style basic "REM" (most developers just use a quote). VB Classic does NOT have a multiple line comment.

Directives - #

Directives are sometimes called compiler or preprocessor directives. A # is used for directives within VB Classic code. VB Classic offers only an #If..then/#ElseIf/#Else directive.

Syntax Example:
'Single line comment.

REM Old school single line comment.

#If MyDirective Then
'...some code.
#End If

 

Multi-Line Comment Code Trick

You can simulate a multi-line comment with code which is useful especially if you wish to comment out a block of code.

For example:

If False Then
 '...code here skipped.
End If

Using Directives

Here is a simple example of using VB Classic's directive (change True to False to switch it).

#Const MyDirective = True

#If MyDirective Then
   MsgBox ("Yes")
#Else
   MsgBox ("No")
#End If

More Info


Comments

1 Comments.
Share a thought or comment...
Comment 1 of 2

The more programming and following the site for visual basics, I have found here a lot of techniques as well. Generating here zety reviews wonderful reviews and more writing essays as well,thanks for sharing more info.

Posted 36 days ago

Comment 2 of 2

It seems to be some comparison of some system here so if you are all up for https://customessaysreviews.com/essay-on-time-com-review then i would like you to have it adn use it for different reasons that can be expllained to me for all the stuff that was shared there.

Posted 35 days ago
 
Write a Comment...
...
Sign in...

If you are a member, Sign In. Or, you can Create a Free account now.


Anonymous Post (text-only, no HTML):

Enter your name and security key.

Your Name:
Security key = P1293A1
Enter key:
Code Contributed By Mike Prestwood:

Mike Prestwood is a drummer, an author, and creator of the PrestwoodBoards online community. He is the President & CEO of Prestwood IT Solutions. Prestwood IT provides Coding, Website, and Computer Tech services. Mike has authored 6 computer books and over 1,200 articles. As a drummer, he maintains play-drums.com and has authored 3 drum books. If you have a project you wish to discuss with Mike, you can send him a private message through his PrestwoodBoards home page or call him 9AM to 4PM PST at 916-726-5675 x205.

Visit Profile

 KB Article #101507 Counter
13478
Since 11/14/2008
Sales Website: www.prestwood.com Or visit our legacy sales site: 
legacy.prestwood.com


©1995-2020 Prestwood IT Solutions.   [Security & Privacy]