Posted 11 June 2014 - 10:47 PM
I am looking for a solution to test if a variable contains a number or a string, in order to return a boolean value of whether or not a variable is a number.
I am writing a program that will attempt to send a message (Variable 'a'), to recipient(Variable e), and to attempt it a specified number of times (Variable f), and need to know if the variable is numerical so that rednet.send() doesn't just throw an error and continue the program with out stopping. The program is currently in progress, and is called as a function.
completion = boolean
a, b, c, d = string
e, f, g, h = int
TrySend = function(e, a, f) – e - target, a - message, f - number of attempts
g = 0
if c <= 1 then
print("The number of send attempts must be greater than 0.")
end
while g <= f do
–in progress - to be added
g = g +1
end
return completion
end
I am writing a program that will attempt to send a message (Variable 'a'), to recipient(Variable e), and to attempt it a specified number of times (Variable f), and need to know if the variable is numerical so that rednet.send() doesn't just throw an error and continue the program with out stopping. The program is currently in progress, and is called as a function.
completion = boolean
a, b, c, d = string
e, f, g, h = int
TrySend = function(e, a, f) – e - target, a - message, f - number of attempts
g = 0
if c <= 1 then
print("The number of send attempts must be greater than 0.")
end
while g <= f do
–in progress - to be added
g = g +1
end
return completion
end
Edited on 11 June 2014 - 09:48 PM