Navigation

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

    Unexpected End of File and i dunno wh

    Help
    3
    10
    711
    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.
    • K
      kurbusmax last edited by

      Hey. i just bought Fuze4, and started to make a text based game. But, when i run it, there’s always an “Unexpected End of File” error somewhere. Code is pictured below. image.jpg

      P 2 Replies Last reply Reply Quote 1
      • pianofire
        pianofire Fuze Team last edited by pianofire

        Hi there. I would recommend working through the tutorials before diving right in: https://fuzearena.com/help/view/Loops

        There are a few problems with your program as it stands. Fuze is not a traditional Basic programming language. For instance goto is not supported because it encourages bad programming practice and difficult to follow code. The line numbers are there for reference only. Also if requires an endif and it is controls() not control()

        I think that the following will do what you are trying to do:

        // This structure is known as a game loop - it runs at 60 frames per second
        
        loop                  // start loop
          clear()             // clear the frame buffer
          c = controls(0)     // read the state of the controls
          if c.a then         // check for A button press
            print("hi.")      // print to frame buffer
          endif            
          update()            // display framebuffer
        repeat                // repeat
        1 Reply Last reply Reply Quote 7
        • P
          petermeisenstein F @kurbusmax last edited by

          @kurbusmax So as pianofire said there is no goto in fuze.You dont even need goto cause you could make a function and instead of jumping to a line where the stuff is who you want to execute you can call the function.

          1 Reply Last reply Reply Quote 1
          • P
            petermeisenstein F @kurbusmax last edited by

            @kurbusmax If you need help by programming
            (Only if its not stuff with math or much graphical stuff) then you can send me a msg.
            You can also send me an msg if you need help with making games but the other guys can help you better with this topic. But for all about text or analyzing strings you can feel free to contact me.

            1 Reply Last reply Reply Quote 0
            • K
              kurbusmax last edited by

              oh i figured it out i was missing an endif

              P 1 Reply Last reply Reply Quote 0
              • P
                petermeisenstein F @kurbusmax last edited by

                @kurbusmax I come from python so it happens me also very often that i forget to make and ifs and stuff like this i sometimes make an : after "if"
                And i often forget "then" es well

                1 Reply Last reply Reply Quote 0
                • K
                  kurbusmax last edited by

                  I come from Py and VBS so this is all confusing to me

                  P 1 Reply Last reply Reply Quote 0
                  • P
                    petermeisenstein F @kurbusmax last edited by

                    @kurbusmax VBS has endif and stuff like this or hasnt it ?

                    K 1 Reply Last reply Reply Quote 0
                    • K
                      kurbusmax @petermeisenstein last edited by

                      @petermeisenstein said in Unexpected End of File and i dunno wh:

                      @kurbusmax VBS has endif and stuff like this or hasnt it ?

                      it doesn't it just ends after the line

                      P 1 Reply Last reply Reply Quote 0
                      • P
                        petermeisenstein F @kurbusmax last edited by

                        @kurbusmax if you are still looking for a goto like feature make sure to to check this out https://fuzearena.com/forum/topic/1099/a-goto-workaround

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