Range() functions

About Monkey 2 Forums Monkey 2 Code Library Range() functions

This topic contains 2 replies, has 1 voice, and was last updated by  nerobot 7 months, 3 weeks ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #13754

    nerobot
    Participant

    Set of functions to generate ranges of numbers and chars.

    Easy to extending for other numeric types (make it generic for example).

    Also there is a helper function Join() that join array values into single string with delimeters.

    Functions and demo app (2 in 1):

    It prints

    Maybe it can be part of std module.

    #13757

    nerobot
    Participant

    A few new kinds of Range is here. 🙂

    They generate by expression, where single values or ranges are separated by commas,

    and ranges min-max diapasons separated by minus-sign.

    RangeExprInt – generates sequence of integers , for example: expr=”1,14,20-27″

    RangeExprChars – generates sequence of chars, for example: expr=”a-z,A-Z,0-9″

    Also there is a Stack extension with method Merge that allow you to merge values into stack to have unique values only.

    #14095

    nerobot
    Participant

    Additional arrays helpers:

    ArrayPad() – Returns a copy of the array padded to size specified by size with value ‘value’.

    ArrayFill() – Fills an array with ‘count’ entries of the ‘value’.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.