ComputerCraft Forums

ComputerCraft => Ask a Pro => Topic started by: TheTinyDeskEngineer on May 14, 2021, 02:35 PM

Title: Program ends prematurely
Post by: TheTinyDeskEngineer on May 14, 2021, 02:35 PM
I'm working on a program that allows a computer to host files uploaded by other players and to allow players to easily find uploaded files they want, but when I try to click on any of the buttons I put at the top of the homepage after entering the hostname, the program just closes to the shell immediately. No error, just closing to the shell.

Here's the pastebin code for the client: K0fafZpr
And the code for the server: 8N3KfubQ
Title: Program ends prematurely
Post by: Lupus590 on May 14, 2021, 04:47 PM
The function is probably returning. You don't loop anywhere in your program, instead, you are recursively calling the same function each time you do something with the event you pull.

I would restructure the program to use a while true loop and then call break when you want to exit the program.