Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Extended BASIC+ Syntax

...


For Each Loops

For each loops offer a convenient way to walk through a dynamic array from beginning to end. If you have an @FM delimited array, you can do this:

...

Code Block
For Each Value in MyValues using @STM setting Pos
    NewValues<Pos> = Value
Next Value

...

...

Conditional Return Statement

...

Note that this syntax should only be used for the stored procedure's final Return statement, not for returning from a gosub. Anchorserviceservice


Service Modules

SRP has been a big advocate for organizing code into Service Modules: stored procedures in which the first parameter identifies a service to execute. Normally, this involves branching to gosubs, mapping the input variables, and making sure the stored procedure has enough parameters to cover all the services' needs. Here is a traditional example:

...

This statement is key to making unit tests work. When the evaluation fails, the SRP Editor will display the two values side by side for easy comparison. Anchorunpackingunpacking


Unpacking

IMPORTANT: Unpacking was added in 2.1.1 and is not supported in prior versions.

...