Problem printing strings
DarkEyeDragon 28 Jun 2016
Hello! I'm not sure if this should be posted in the bug section, since there's nothing wrong with my code.
I got this weird issue where my computer won't let me print a string. at all.
NOTE: I put everything in comments to make sure that is the issue.
and get this: magreader:2: attempt to call string.
Well obviously its trying to call a string...
and when i tried to put this code on pastebin to show you guys, i got this error:
I made a new program and tried the same. Same error.
this is computercraft 1.74 in the Tekkit Legends modpack.
It worked fine before. Just now started acting up.
Edit: Its only that one computer. I'm very confused on this xD
Edit 2: Anything related to strings in that computer is messed up.
Yet another edit: I was just reading trough the forums and saw this: "string.format is broken in LuaJ, which CC uses. Instead, use string.match, or string.sub." -KingofGamesYami
original post: http://www.computerc...27024-decimals/
And i did try to use the string.format as i couldn't get my other part of code to work since it said it wasn't a string. Might that be the issue here?
Seems like the code i'm using to figure out how to use string.len is causing it to break here.
Edited by DarkEyeDragon, 28 June 2016 - 01:43 PM.
I got this weird issue where my computer won't let me print a string. at all.
NOTE: I put everything in comments to make sure that is the issue.
and get this: magreader:2: attempt to call string.
Well obviously its trying to call a string...
and when i tried to put this code on pastebin to show you guys, i got this error:
I made a new program and tried the same. Same error.
this is computercraft 1.74 in the Tekkit Legends modpack.
It worked fine before. Just now started acting up.
Edit: Its only that one computer. I'm very confused on this xD
Edit 2: Anything related to strings in that computer is messed up.
Yet another edit: I was just reading trough the forums and saw this: "string.format is broken in LuaJ, which CC uses. Instead, use string.match, or string.sub." -KingofGamesYami
original post: http://www.computerc...27024-decimals/
And i did try to use the string.format as i couldn't get my other part of code to work since it said it wasn't a string. Might that be the issue here?
Seems like the code i'm using to figure out how to use string.len is causing it to break here.
Edited by DarkEyeDragon, 28 June 2016 - 01:43 PM.
Lupus590 28 Jun 2016
Edit: Good spot Selim (see below)
Edited by Lupus590, 28 June 2016 - 02:38 PM.
Selim 28 Jun 2016
I see the problem already. In the first screenshot, you are setting the value of print to "String length ok!". Due to this, whenever a script attempts to call print, it is calling a string, hence the "attempt to call string" error. Changing the value once changed the global variable and then requires a reboot to fix. If the script was run once, it will not fix until said reboot.
Edited by Selim, 28 June 2016 - 02:22 PM.
Edited by Selim, 28 June 2016 - 02:22 PM.
DarkEyeDragon 28 Jun 2016
Selim, on 28 June 2016 - 02:20 PM, said:
I see the problem already. In the first screenshot, you are setting the value of print to "String length ok!". Due to this, whenever a script attempts to call print, it is calling a string, hence the "attempt to call string" error. Changing the value once changed the global variable and then requires a reboot to fix. If the script was run once, it will not fix until said reboot.