• Keep getting 'unfinished' errors and I don't understand why
    4 replies, posted
I keeping getting unfinished (some variable type) near <eof> errors in my code. I'm not entierly sure why this is happening, I've been developing addons for quite some time and I don't know whats going on. it's on a new server. Sometime they just fix themselves which I thought was strange, but I hate having errors so I always have to fix them. This time it's not going away and its breaking one of my DarkRP jobs: [ERROR] addons/darkrpmodification/lua/darkrp_customthings/jobs.lua:1001: unfinished string near '<eof>'   1. unknown - addons/darkrpmodification/lua/darkrp_customthings/jobs.lua:0 TEAM_104THWOLFFE = DarkRP.createJob("104th Wolf Pack Commander Wolffe", {     color = Color(48, 53, 54, 255),     model = {"models/104thcgiwolffe/104thcgiwolffe.mdl"},     description = [[You're the Commander of the 104th Wolf Pack, Lead your troops into victory!]],     weapons = {"tfa_swch_dc15sa", "tfa_kotor_br_2", "tfa_f11_specops", "tfa_kotor_repeaten_1"},     command = "104thwolffe", -- This is line 1001     max = 25,     salary = 500,     admin = 0,     vote = false,     hasLicense = true,     candemote = false,     category = "104th Wolf Pack",     PlayerSpawn = function(ply)         ply:SetMaxHealth(1000)         ply:SetHealth(1000)         ply:SetArmor(150)     end It also happens here: [ERROR] addons/darkrpmodification/lua/darkrp_customthings/jobs.lua:495: unfinished long string near '<eof>'   1. unknown - addons/darkrpmodification/lua/darkrp_customthings/jobs.lua:0 TEAM_501STTRP = DarkRP.createJob("501st Trooper", {     color = Color(80, 95, 245, 255),     model = {"models/clones/clone327.mdl"},     description = [[The 501st is a Elite Military Division of the Grand Army of the Republic. You're part of a Front line division. You're close to being bait]], -- This is line 495     weapons = {"tfa_752_dlt19", "tfa_swch_dc17"},     command = "501sttrp",     max = 25,     salary = 150,     admin = 0,     vote = false,     hasLicense = true,     candemote = false,     category = "501st Legion",     PlayerSpawn = function(ply)         ply:SetMaxHealth(500)         ply:SetHealth(500)         ply:SetArmor(100)     end }) I've never been stuch like this as I've never had this issue and I can't see the problem. Can anyone help??
So other than missing the closing brace (which I'm guessing is just a copy mistake), I can't see anything syntactically wrong with those snippets. Could it be an illegal character or unicode combination that hasn't been copied across to your post? The other possibility is that there's an issue/mistake elsewhere in the code (such as a missing string delimiter), so you'd need to post the whole file somewhere and link it here in order for me to have a look.
Thank you for replying so quickly. I had a browser over and couldn't really find anything. Here's the file: jobs.lua
Okay, in the context I'm testing, I don't get either of those errors. However, I have noticed the following: --]] At the start of every job definition. I don't know how DarkRP parses these files, but I'd clean out those, and perhaps change your long string delimiters from [[ ... ]] to [===[ ... ]===] This is just in case DarkRP is using those delimiters when it reads the file. Also, if you open the file in an advanced text editor such as notepad++, do you see any unusual characters on the lines where the errors occur?
The problem seems to have figured itself out again. Thanks for all the help and I'll do what you said Freeman
Sorry, you need to Log In to post a reply to this thread.