BlitzMax

BlitzMax

  • Downloads
  • Docs
  • API
  • Resources
  • About

›Language

Setup

  • Getting Started
  • Win32
  • Linux
  • macOS
  • Android
  • iOS
  • Raspberry Pi
  • NX (Switch Homebrew)
  • Custom Settings

Tutorials

  • Beginners Guide
  • OOP Tutorial
  • Network Programming
  • TCP Socket Programming

Language

  • Arrays
  • Basic Compatibility
  • Collections
  • Comments
  • Conditional Compiling
  • Constants
  • Data Types
  • Debugging
  • Enums
  • Exceptions
  • Expressions
  • Functions
  • Identifiers
  • Literals
  • Modules
  • Objects
  • Program Flow
  • Slices
  • Strings
  • User Defined Types
  • Variables
  • Advanced Topics

    • Interfacing With C
    • Memory Management
    • Pointers
    • Custom Pre/Post Compilation Scripts
    • Creating DLLs

Tools

  • MaxIDE
  • BlitzMax Make (bmk)
  • BlitzMax Compiler (bcc)
Edit

Debugging

BlitzMax provides several commands to help with debugging your programs:

CommandDescription
DebugStopIn debug mode, causes the program to stop executing and activates the debugger. In release mode, no effect.
DebugLog StringExpressionIn debug mode, causes StringExpression to be printed to the debugger output window. In release mode, no effect.
RuntimeError StringExpressionCauses a runtime error exception (see: Exceptions ) to be thrown with the specified string.
Assert Expression Else StringExpressionIn debug mode, causes a RuntimeError if Expression evaluates to false. No effect in release mode.

Assert is particularly useful for validating function arguments. For example:

Function SetAlpha( alpha# )
    Assert alpha>=0 And alpha<=1 Else "Alpha value out of range"
    ' rest of function here...
End Function

However, since asserts are taken out in release mode, be careful that your asserts don't have any side effects - code that may affect the execution of the program.

← Data TypesEnums →
BlitzMax
Docs
Getting StartedDownloadsAbout
Community
ResourcesSyntaxBomb Forums
More
GitHubStarChat on Discord
Copyright © 2022 Bruce A Henderson