Posted 17 July 2013 - 12:51 PM
so i've been trying to use table lately and i don't understand why this is not working i swear it work sometime ago but now it doesn't
and this doesn't work and i know i could do ex.a and it would work but need it so it can take a user inputted letter so like
and if it would work the way i think it should it should print out 10 if the use inputted A, but this doesn't it doesn't return anything but a blank line another thing is when i try to get how many values are in the table/array like print(#ex) would return 0
Thank you for reading this and thanks for you comments
ex = {
a = 1,
A = 10,
}
print(ex[a])
and this doesn't work and i know i could do ex.a and it would work but need it so it can take a user inputted letter so like
ex = {
a = 1,
A = 10,
b = 2,
B = 20,
c = 3,
C = 30,
}
input = read()
print(ex[input])
and if it would work the way i think it should it should print out 10 if the use inputted A, but this doesn't it doesn't return anything but a blank line another thing is when i try to get how many values are in the table/array like print(#ex) would return 0
Thank you for reading this and thanks for you comments