Guest Access
Administrator
Administrator

Administrator
profile
"Comments" are lines or blocks in the script that are bypassed
and are not processed as part of the programming.
Good use of comments reflects great programming. Starting with the script title, version information, credits, instructions, to lines that separate class and methods down to the key notes.
In this lesson you will learn the two ways to make comments:
1.) line comments
To make a line comment in Ruby, simply use the pound sign
(a.k.a. the octothorpe, the hash, the number sign, or the square)
All syntax from the "#" to the end of the line is ignored when the program runs.
for example:
2.) block comments
to comment multiple lines or to create a comment block start with
place your commentary, then end the block with
for example:
The color Green will indicate code that is being commented.
that's it! easy right? ^,^
G@MeF@Ce
![]() | ![]() | |
![]() | ||
![]() | ![]() |

profile

and are not processed as part of the programming.
Good use of comments reflects great programming. Starting with the script title, version information, credits, instructions, to lines that separate class and methods down to the key notes.
In this lesson you will learn the two ways to make comments:
1.) line comments
To make a line comment in Ruby, simply use the pound sign
- Code:
#
(a.k.a. the octothorpe, the hash, the number sign, or the square)
All syntax from the "#" to the end of the line is ignored when the program runs.
for example:
- Code:
# everything after the number sign on this line will be bypassed
2.) block comments
to comment multiple lines or to create a comment block start with
- Code:
= begin
place your commentary, then end the block with
- Code:
= end
for example:
- Code:
=begin
everything in between will become a commentary
=end
The color Green will indicate code that is being commented.
that's it! easy right? ^,^
Administrator
Show Signature
EVENTALIST
EVENTALIST

EVENTALIST
profile
When Debugging scripts becomes difficult, remember the first function most tutorials teach. 'Hello World', By showing a string or data like a varaible '#{var}' in a #{ code block } you can visually see what the code is doing by forcing it to tell you. How ever a STATIC ( ' ) string will not proccess any tags, things like \t \n #{}, and will display the string as IS.
A string ( " ) however will proccess built in tags like the ones listed above and a few others. Here is an exsample bellow on some simple print() debug function styles you can use to show real time values or even book marks when sections of code are reached.
Print will pop up a dialog window threw windows and pause the game prject. Doing the
above code will out put this dialog in the boxes that pop up each time 'print("string")' is called.
First Box:
Variriable value = A simple string.
Second Box:
Instence value = 18463.3483.
Third Box:
Global value = Item1, 2, 3.
It's a Array class.
When you learn many of the features print() has to offer, debugging becomes less troublesom.
mr_wiggles
![]() | ![]() | |
![]() | ||
![]() | ![]() |

profile

A string ( " ) however will proccess built in tags like the ones listed above and a few others. Here is an exsample bellow on some simple print() debug function styles you can use to show real time values or even book marks when sections of code are reached.
- Code:
print("Hello World")
variable = 'A simple string'
@instence = 18463.3483
$global = Array.new('Item1', '2', '3')
print("Variriable value = #{variable}.")
print("Instence value = #{@instence}.")
temp = $global.join(', ')
print("Global value = #{temp}. \nIt's a #{$global.type} class.")
Print will pop up a dialog window threw windows and pause the game prject. Doing the
above code will out put this dialog in the boxes that pop up each time 'print("string")' is called.
First Box:
Variriable value = A simple string.
Second Box:
Instence value = 18463.3483.
Third Box:
Global value = Item1, 2, 3.
It's a Array class.
When you learn many of the features print() has to offer, debugging becomes less troublesom.

EVENTALIST
Show Signature
EVENTALIST