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

[string "resistor"]:29: '<name>' expected near '['

Started by RadiationAlert, 25 April 2016 - 07:14 PM
RadiationAlert #1
Posted 25 April 2016 - 09:14 PM
So I get the following error as noted in the title: [string "resistor"]:29: '<name>' expected near '['
Here is the program: http://pastebin.com/W2m7tJB9

It is on pastebin because as far as I know formatting code into the forums can sometimes destroy indents and always destroys the syntax highlighting making it impossible to read for some people as well as I.

I get this error 1 / 3 programs I create and it is driving me crazy. Whoever decides to enlighten me will probably view it as a basic syntax error of sorts. I've had my share in looking into the issue and no progress has been made.
Luca_S #2
Posted 25 April 2016 - 09:38 PM

Multiplier = Chart.[string.lower (Bands[3])].Multiplier;
I think you might wanna do this instead:

Multiplier = Chart[string.lower (Bands[3])].Multiplier;
Same for all other lines. You can't use .[]
RadiationAlert #3
Posted 25 April 2016 - 09:44 PM
I could have swore back in the day that worked…