GOLF(2gg)

πŸ“¦ version 601.4.41, in ubuntu questing

πŸ’– GOLF(2gg) β€” the set-number era πŸ’–

okay bestie so this is a page from the GOLF(2gg) manual, section 2gg, filed under Development, and it's literally all about set-number. grab a boba, we're doing numbers. πŸ§‹βœ¨


✨ NAME ✨

set-number β€” (numbers) πŸŽ€

🌸 PURPOSE 🌸

Set value of a number variable. that's it. that's the whole job. slay. πŸ’…

πŸ¦‹ SYNTAX πŸ¦‹

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

πŸ‘‘ DESCRIPTION πŸ‘‘

okay so, the number variable <var> β€” here's the tea πŸ“:

  • if you use the "=" clause, <var> gets assigned the value <number>.
  • if you omit the "=" clause, it just gets assigned 0. no drama, just zero.

if you throw in the "process-scope" clause, then the number is of process scope, meaning its value will persist from one request to another for the life of the process. it's giving immortality, but make it numbers. πŸ”₯

ngl, plot twist: <number> can also be a string character, produced by using [ and ] to specify the index within a string (with 0 being the first character). like this, bestie:
set-string my_str = "Some string"
set-number my_num = my_str[2]

in the example above, "my_num" will be 109, which is the integer representation of character 'm'. no cap, that's just how it is. πŸ˜­πŸ’–

🌈 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

like, the range?? iconic. ⭐

🫢 SEE ALSO 🫢

  • Numbers
  • abs-number
  • number-expressions
  • number-string
  • set-number
  • string-number
  • See all documentation

and that's the whole page, bestie!! πŸ’œ this gorgeous little GOLF(2gg) number from Development is dated $DATE and lives at version $VERSION. go forth and set some numbers, you main character. πŸŽ€πŸ¦‹βœ¨

πŸ“¦ where this page comes from