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

[Lua] [Error] For limit must be a number?

Started by MCuniverse, 22 April 2013 - 12:25 AM
MCuniverse #1
Posted 22 April 2013 - 02:25 AM
Title: [Lua] [Error] For limit must be a number?
I've been having problems with my Prime Number program. The code is in http://pastebin.com/75kYHgMQ
Whenever it finishes the inputs, an error pops up: "prime:23: "for" limit must be a number." What will I do?
mibac138 #2
Posted 22 April 2013 - 08:59 AM
http://pastebin.com/ME4j1ix0

H
ere you are :)/>
Edited on 05 February 2014 - 06:39 AM
SadKingBilly #3
Posted 22 April 2013 - 09:54 AM
Line 23 calls for the value of variable "Num", which does not exist. Lua is case-sensitive: "Num" and "num" are two different things.
MCuniverse #4
Posted 22 April 2013 - 05:52 PM
Line 23 calls for the value of variable "Num", which does not exist. Lua is case-sensitive: "Num" and "num" are two different things.
Somehow with my own version even changing it to num, it still does not work… although combined with mibac138's version, it works now. Thanks!
mibac138 #5
Posted 23 April 2013 - 02:24 AM
:)/>