Navigation

    Fuze Arena Logo
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Help
    • Discord

    How to end a program arbitrarily?

    Help
    3
    4
    206
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • T
      Tranceaholic F last edited by

      Stupid question time...How do you end a program early based on a user's choice? There doesn't appear to be an "end" keyword in FUZE.

      1 Reply Last reply Reply Quote 0
      • pianofire
        pianofire Fuze Team last edited by

        Not a stupid question. No there is no end keyword. You can set a flag and exit your main loop

        finished = false
        while !finished loop
          if userinput == "quit" then
           finished = true
          endif
        repeat
        
        Retrocade_media T 2 Replies Last reply Reply Quote 1
        • Retrocade_media
          Retrocade_media F @pianofire last edited by

          @pianofire This is super useful, can you add it to the tips section?

          1 Reply Last reply Reply Quote 2
          • T
            Tranceaholic F @pianofire last edited by

            @pianofire Ah, of course...How did I forget that? Flags make it easy to turn on and off whatever bits of your code you need running depending on the situation. Once again, thank you!

            1 Reply Last reply Reply Quote 1
            • First post
              Last post