print 1 to 100

Hi Friends,

My Requirement is to print no.s 1 to 100 without using enumerate function.If you could help me logic that would be a great help 

Thanks in Advance.

Divya 

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Senior Developer

    Hi Divya, 

    Here is my answer where you can have random starting and random ending number. You can use my code as a individual function in Appian.

    a!localVariables(
    local!count:ri!endingNum-ri!startingNum+1,
    local!data:repeat(local!count,ri!startingNum),
    local!result:a!forEach(
    items: local!data,
    expression: tointeger(
    ri!startingNum+fv!index-1
    )
    ),
    {
    local!result
    }
    )

    ----

    where ri!startingNum = 1,

    ri!endingNum =100,

    output -> list of integer numbers as you expected. 

Reply
  • 0
    Certified Senior Developer

    Hi Divya, 

    Here is my answer where you can have random starting and random ending number. You can use my code as a individual function in Appian.

    a!localVariables(
    local!count:ri!endingNum-ri!startingNum+1,
    local!data:repeat(local!count,ri!startingNum),
    local!result:a!forEach(
    items: local!data,
    expression: tointeger(
    ri!startingNum+fv!index-1
    )
    ),
    {
    local!result
    }
    )

    ----

    where ri!startingNum = 1,

    ri!endingNum =100,

    output -> list of integer numbers as you expected. 

Children
No Data