Tips and Tricks

(See also work arounds, keybindings and getting started)

  • Using another language on a day-to-day basis ? This one is a bit naughty and a timesaver :)
    #define int integer

  • If you editing files from Second Life on a regular basis with ridiculous filenames - try adding a scriptname to smooth things out a little. This will change the name on the title bar and work tab.
    #scriptname <name>

  • Callbacks and simulated "function pointers"
    Using the new global defines mode, a lot of new things are possible...
    (as long as it is done at compile time) Example coming later.

  • New Projects
    Tick "Global #defines" under options (disabled by default for compatibility)
    Also Tick Optimiser
    Use #define for any variables or magic numbers that do not change (constants)
    Put any variables/constants that are shared between scripts in separate files in your include folder
    Use one line defines for inline functions.

  • Migrating from Phoenix
    As standard, the preprocessor does not REQUIRE the use of include guards in #include files. They will be processed as normal, but each #include file will only be processed once.
    Either: Ensure global defines is not ticked if you are using include guards in your included files. Maximum compatibility, minimum effort.
    Or: Remove include guards from your included files :) This will break compatibility with Phoenix and allow the use of more language features.
    // You do not need to use include guards
    // #ifndef includeThisFile // Comment this out
    // #define includeThisFile // Comment this out if you are not using it elsewhere.
    // lots of code
    // #endif // Comment this out

..please send in any tips or tricks you would like including..