The Comment Delimiter is used to add explanatory notes to ProtoLang code that are ignored during execution. Comments help document what the code does, explain complex logic, or temporarily disable code. Everything from the comment delimiter to the end of the line is a treated comment and has no effect on program execution.
The short syntax structure uses the // symbol:
// This is a commentThe long syntax structure uses the word COMMENT:
COMMENT This is a commentComments provide a way to include non-executable text in your code:
// This is a comment that explains the next line
NEW INT x = 5
PRINTLN x // This comment is at the end of a line
// Displays: 5// Initialize the counter variable
NEW INT counter = 0
// Print the counter value
PRINTLN counter
// Displays: 0// This program demonstrates counting
// It counts from 1 to 5
// Each number is displayed on a new line
NEW INT i = 1
WHILE i <= 5
PRINTLN i
SET i = i + 1
END WHILENEW INT age = 25
// Check if user is an adult
IF age >= 18
PRINTLN "Adult"
ELSE
PRINTLN "Minor"
END IFNEW INT x = 10 // Initialize x to 10
NEW INT y = 20 // Initialize y to 20
NEW INT sum = x + y // Calculate the sum
PRINTLN sum // Display the result
// Displays: 30NEW INT playerHealth = 100 // Maximum health
NEW INT playerScore = 0 // Starting score
NEW STR playerName = "Hero" // Default player name
NEW BOOL isAlive = TRUE // Player statusNEW FLOAT price = 100.0 // Base price
NEW FLOAT taxRate = 0.08 // 8% tax rate
NEW FLOAT tax = price * taxRate // Calculate tax
NEW FLOAT total = price + tax // Add tax to price
PRINTLN total // Displays: 108.0NEW INT score = 85
// Determine letter grade based on score
IF score >= 90
PRINTLN "A" // Excellent
ELIF score >= 80
PRINTLN "B" // Good
ELIF score >= 70
PRINTLN "C" // Average
ELSE
PRINTLN "F" // Failing
END IFNEW INT i = 1
NEW INT sum = 0
// Calculate sum of numbers from 1 to 10
WHILE i <= 10
SET sum = sum + i // Add current number to sum
SET i = i + 1 // Move to next number
END WHILE
PRINTLN "Sum: " .. sum// Temperature conversion program
NEW FLOAT celsius = 25.0 // Temperature in Celsius
// Formula: F = (C × 9/5) + 32
NEW FLOAT fahrenheit = ( celsius * 9.0 / 5.0 ) + 32.0
PRINTLN celsius .. "C = " .. fahrenheit .. "F"
// Displays: 25.0C = 77.0FComments can temporarily disable code without deleting it.
NEW INT x = 10
PRINTLN x
// PRINTLN "This line is disabled"
PRINTLN "This line executes"
// Only the uncommented lines runNEW INT value = 5
// SET value = 10 // Try this value
// SET value = 15 // Or this value
SET value = 20 // Currently using this value
PRINTLN value // Displays: 20NEW INT x = 1
WHILE x <= 3
PRINTLN "x = " .. x
// PRINTLN "Debug: before increment" // Debug line disabled
SET x = x + 1
// PRINTLN "Debug: after increment" // Debug line disabled
END WHILENEW INT count = 5
// Old implementation:
// WHILE count > 0
// PRINTLN count
// SET count = count - 1
// END WHILE
// New implementation:
NEW INT i = 1
WHILE i <= count
PRINTLN i
SET i = i + 1
END WHILE// ========================================
// INITIALIZATION
// ========================================
NEW INT playerScore = 0
NEW INT playerLives = 3
// ========================================
// GAME LOOP
// ========================================
WHILE playerLives > 0
SET playerScore = playerScore + 10
SET playerLives = playerLives - 1
END WHILE
// ========================================
// DISPLAY RESULTS
// ========================================
PRINTLN "Final Score: " .. playerScore// --- Variable Declarations ---
NEW FLOAT width = 10.5
NEW FLOAT height = 7.5
// --- Calculations ---
NEW FLOAT area = width * height
NEW FLOAT perimeter = ( width + height ) * 2.0
// --- Output ---
PRINTLN "Area: " .. area
PRINTLN "Perimeter: " .. perimeter// ==================================================
// Calculate factorial of a number
// Input: n (positive integer)
// Output: factorial value
// ==================================================
NEW INT n = 5
NEW INT factorial = 1
NEW INT i = 1
WHILE i <= n
SET factorial = factorial * i
SET i = i + 1
END WHILE
PRINTLN "Factorial of " .. n .. " is " .. factorial// Fibonacci sequence generator
// Each number is the sum of the previous two numbers
NEW INT current = 1
NEW INT previous = 0
NEW INT temp = 0
NEW INT count = 1
WHILE count <= 10
PRINTLN current
SET temp = current // Save current value
SET current = current + previous // Calculate next number
SET previous = temp // Update previous for next iteration
SET count = count + 1
END WHILENEW INT num = 1
// Check each number from 1 to 20
WHILE num <= 20
// Check if divisible by both 3 and 5
IF num % 3 == 0
IF num % 5 == 0
PRINTLN num .. " - FizzBuzz" // Divisible by both
ELSE
PRINTLN num .. " - Fizz" // Divisible by 3 only
END IF
ELIF num % 5 == 0
PRINTLN num .. " - Buzz" // Divisible by 5 only
ELSE
PRINTLN num // Not divisible by 3 or 5
END IF
SET num = num + 1
END WHILE// Password validation
// Assumes: password is between 8-20 characters
// Requires: at least one number
NEW STR password = "SecurePass123"
NEW INT minLength = 8
NEW INT maxLength = 20
// Note: Actual character counting not implemented in this example
PRINTLN "Password: " .. passwordNEW INT score = 0
// TODO: Add input validation
// TODO: Implement high score tracking
// TODO: Add difficulty levels
PRINTLN "Score: " .. scoreNEW INT value = 10
SET value = value * 2
// FIXME: This calculation is incorrect for negative values
PRINTLN valueNEW FLOAT temperature = 25.0
// NOTE: Temperature is in Celsius
// NOTE: Conversion formula may need adjustment for extreme values
NEW FLOAT fahrenheit = ( temperature * 9.0 / 5.0 ) + 32.0
PRINTLN fahrenheit .. "F"NEW INT age = 20
NEW BOOL hasLicense = TRUE
// Check driving eligibility
IF age >= 18 // Must be 18 or older
IF hasLicense // Must have valid license
PRINTLN "Can drive"
ELSE
PRINTLN "Need license" // Age ok, but no license
END IF
ELSE
PRINTLN "Too young" // Under 18
END IFNEW INT i = 1
// Print odd numbers from 1 to 10
WHILE i <= 10
IF i % 2 != 0 // Check if odd
PRINTLN i
END IF
SET i = i + 1 // Increment counter
END WHILE
// Loop complete// Multiplication table generator
NEW INT row = 1
NEW INT col = 1
WHILE row <= 3 // Outer loop: rows
WHILE col <= 3 // Inner loop: columns
PRINT row * col .. " "
SET col = col + 1
END WHILE
PRINTLN "" // New line after each row
SET row = row + 1
END WHILE// ==================================================
// Program: Temperature Converter
// Purpose: Convert Celsius to Fahrenheit
// Date: January 28, 2026
// ==================================================
NEW FLOAT celsius = 100.0
NEW FLOAT fahrenheit = ( celsius * 9.0 / 5.0 ) + 32.0
PRINTLN celsius .. "C = " .. fahrenheit .. "F"// Configuration variables
NEW INT maxAttempts = 3 // Maximum login attempts allowed
NEW INT timeout = 30 // Timeout in seconds
NEW BOOL debugMode = FALSE // Enable debug output
// User data
NEW STR username = "admin" // Current username
NEW INT loginCount = 0 // Number of login attempts// Calculate employee bonus
// Bonus = 10% of sales if sales > 10000
// Bonus = 5% of sales if sales > 5000
// No bonus otherwise
NEW FLOAT sales = 12000.0
NEW FLOAT bonus = 0.0
IF sales > 10000.0
SET bonus = sales * 0.10 // 10% bonus
ELIF sales > 5000.0
SET bonus = sales * 0.05 // 5% bonus
END IF
PRINTLN "Bonus: $" .. bonus// Step 1: Initialize data
NEW INT total = 0
NEW INT count = 0
// Step 2: Process items
NEW INT i = 1
WHILE i <= 5
SET total = total + ( i * 10 )
SET count = count + 1
SET i = i + 1
END WHILE
// Step 3: Calculate average
NEW INT average = total / count
// Step 4: Display results
PRINTLN "Total: " .. total
PRINTLN "Count: " .. count
PRINTLN "Average: " .. average// Calculate circle area
NEW FLOAT radius = 5.0
NEW FLOAT area = 3.14159 * radius * radius
PRINTLN "Area: " .. areaNEW INT x = 10 // Starting value
NEW INT y = 20 // Ending value
NEW INT diff = y - x // Calculate difference
PRINTLN diff // Displays: 10// Initialize shopping cart
NEW INT itemCount = 0 // Number of items
NEW FLOAT cartTotal = 0.0 // Total price
// Add items to cart
SET itemCount = itemCount + 1 // Add first item
SET cartTotal = cartTotal + 29.99
SET itemCount = itemCount + 1 // Add second item
SET cartTotal = cartTotal + 49.99
// Display cart summary
PRINTLN "Items: " .. itemCount
PRINTLN "Total: $" .. cartTotalNEW INT x = 5
// SET x = 10 // This line doesn't execute
PRINTLN x // Displays: 5 (not 10)NEW INT value = 100
// NEW INT value = 200
// NEW INT value = 300
// NEW INT value = 400
PRINTLN value // Displays: 100PRINTLN "This prints"
// PRINTLN "This does not print"
PRINTLN "This also prints"
// Displays: This prints, This also prints# This is not a valid comment // Syntax error! ProtoLang uses //
NEW INT x = 5
/* This is not valid */ // Syntax error! ProtoLang doesn't support /* */
NEW INT y = 10
// Correct: Use // for comments
// This is a valid comment
NEW INT z = 15/* This comment
spans multiple lines
but ProtoLang doesn't support this */ // Syntax error!
// Correct: Use separate // for each line
// This comment
// spans multiple lines
// using single-line comment syntax// This comment doesn't need a semicolon // The semicolon is part of the comment text
NEW INT x = 5 // This semicolon terminates the NEW statement
PRINTLN xNEW INT x = 5
// SET x = 10 // This line is commented out
PRINTLN x // Displays: 5 (not 10)
// The SET command inside the comment didn't executeNEW INT x = 5
This is supposed to be a comment // Syntax error! Missing //
PRINTLN x
// Correct: Start comment with //
NEW INT y = 10
// This is a proper comment
PRINTLN yNEW INT x = // comment here 5 // Syntax error! Comment breaks the statement
PRINTLN x
// Correct: Comment at end of line or separate line
NEW INT y = 5 // comment here
PRINTLN y// This is a comment // with another comment // inside
// The above works fine because everything after first // is ignored
NEW INT x = 5
PRINTLN xNEW STR message = // "Hello" // Syntax error! Comment can't be part of value
PRINTLN message
// Correct: Don't use comment in the middle of statement
NEW STR message = "Hello" // Comment goes here
PRINTLN messageNEW INT x = 5
SET x = // 10 // Syntax error! Rest of line is comment, statement incomplete
PRINTLN x
// Correct: Comment entire statement or none of it
// SET x = 10 // Entire line commented
SET x = 15 // Or don't comment it
PRINTLN x// This comment does not
continue on this line // Wrong expectation!
NEW INT x = 5 // This line tries to execute
// Correct: Start each comment line with //
// This comment is on one line
// This is a separate comment line
NEW INT y = 10NEW STR message = "Hello // World"
PRINTLN message // Displays: Hello // World
// The // inside the string is just text, not a commentNEW INT x = 5 //; // The semicolon is part of the comment!
PRINTLN x // Syntax error on previous line
// Correct: Semicolon before comment
NEW INT y = 10 // Comment after semicolon
PRINTLN y// NEW INT x = 5 // This variable is NOT created
PRINTLN x // Runtime error! x doesn't exist
// Correct: Uncomment the declaration
NEW INT x = 5 // Now x is created
PRINTLN xNEW // Initialize variable
INT x = 5 // Syntax error! Comment breaks statement
// Correct: Comment before or after, not in middle
// Initialize variable
NEW INT x = 5
// Or: NEW INT x = 5 // Initialize variableNEW INT result = 5 + // add this 3 // Syntax error! Comment breaks expression
PRINTLN result
// Correct: Comment after complete expression
NEW INT result = 5 + 3 // add these numbers
PRINTLN result