logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

set-number - (numbers)

Description

Number variable <var> is either assigned value <number> with "=" clause, or it is assigned 0 if equal clause ("=") is omitted. If "process-scope" clause is used, then number is of process scope, meaning its value will persist from one request to another for the life of the process. Note that <number> can also be a string character produced by using "[" and "]" to specify the index within a string (with 0 being the first character), as in: set-string my_str = "Some string" set-number my_num = my_str[2] In the above example, "my_num" will be 109, which is the integer representation of character 'm'.

Examples

Initialize number "my_num" to 0 and the value of this variable, however it changes, will persist through any number of requests in the same process: set-number my_num process-scope Initialize number "my_num" to 10: set-number my_num = 10 Subtract 5: set-number my_num = my_num-5 Assign an expression: set-number my_num = (some_num*3+1)%5

Name

set-number - (numbers)

Purpose

Set value of a number variable.

See Also

Numbers abs-numbernumber-expressionsnumber-stringset-numberstring-number See all documentation $DATE $VERSION GOLF(2gg)

Syntax

set-number <var> [ = <number> ] [ process-scope ]

See Also