This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Hayden_Almeida's profile picture

Program Closes with no error

Started by Hayden_Almeida, 01 May 2016 - 01:22 AM
Hayden_Almeida #1
Posted 01 May 2016 - 03:22 AM
My program is closing with no error and no print messages i put:


if fs.exists("disk/usuario") then
print("Debug 1")
    local ab = fs.open("disk/usuario", "r")
    Gerente = ab.readLine()
    ab.close()
    local passou = false
    local passou2 = false
    Disco_ID = disk.getID(diskDriveSide)
    print("Debug 2")
    sleep(1)
print("Debug 3")
else
    print("debug 4")
end

The program only opens and closes. Only the DEBUGs: 1 and 2 are printed in the screen, the DEBUG 3 not. So the problem is in the function "sleep(1)" ??
Dog #2
Posted 01 May 2016 - 03:36 AM
I'm a bit surprised it doesn't error before Debug 2. Where is diskDriveSide defined?
Hayden_Almeida #3
Posted 01 May 2016 - 03:38 AM
I'm a bit surprised it doesn't error before Debug 2. Where is diskDriveSide defined?


local file = fs.open("configs/start", "r")
local ler1 = file.readLine()
local ler2 = file.readLine()
file.close()
diskDriveSide = tostring(ler1)
Edited on 01 May 2016 - 01:39 AM
Dog #4
Posted 01 May 2016 - 03:40 AM
Please post your entire code, or if it is large post it to pastebin and put a link here.