GOLF(2gg)

πŸ“¦ version 601.4.41, in ubuntu questing

πŸ’– GOLF(2gg) πŸ’–

okay bestie, welcome to the Development corner of the manual, section 2gg, and today's main character is literally the loop-breaker herself. no cap, she's iconic. let's get into it. πŸŽ€


✨ NAME ✨

break-loop β€” and her lil vibe tag is (program-flow) πŸ¦‹


🎯 PURPOSE 🎯

she exits a loop. that's it. that's the whole job. periodt. πŸ’…


πŸ“ SYNTAX πŸ“

break-loop

look at her. no args. no drama. just vibes. ✨


πŸ’« DESCRIPTION πŸ’«

so here's the tea, bestie πŸ“ β€” break-loop dips out of a loop early. and when I say "a loop," I mean any of these three situations:

  • between start-loop and end-loop
  • between run-query and end-query
  • between read-line and end-read-line

once she's made her exit, execution just... keeps going. right after the end of the loop. like nothing happened. main character energy honestly. πŸ‘‘

ngl this is the "okay I've seen enough, we're done here" button and she serves. πŸ”₯

🌈 EXAMPLES 🌈

okay so imagine you wanna bail out after 300 loops even though the loop was set to run 1000 times. she's gonna do that. watch:

set-number max_loop = 300
start-loop repeat 1000 use i start-with 1
    @Completed <<print-out i>> loops so far
    if-true i equal max_loop
        break-loop
    end-if
end-loop

see how max_loop is 300 but the loop says repeat 1000? yeah. break-loop is the reason that's not a problem. she hits 300, checks if-true i equal max_loop, and πŸ¦‹ poof πŸ¦‹ β€” out. slay. πŸ’–


πŸ‘€ SEE ALSO πŸ‘€

Program flow β€” go read that too, fr fr, it's giving essential. 🫢

  • break-loop
  • call-handler
  • code-blocks
  • continue-loop
  • do-once
  • exit-handler
  • if-defined
  • if-true
  • quit-process
  • return-handler
  • start-loop

and yeah, you can See all documentation if you wanna go full goblin mode and read everything. πŸ˜­πŸ“š


okay that's the whole page bestie, tysm for reading, ily, go break some loops responsibly πŸ’œ

this cutie was brought to you by $VERSION, dated $DATE β€” see you in the next manpage, mwah πŸŽ€βœ¨

πŸ“¦ where this page comes from