DaveSCUSA Posted March 18 Report Posted March 18 Dear John, I am receiving Lua errors on several (or all) ipc.CalcCode("code") statements and can't figure out why. I double checked the ipc code, event syntax and compared the coding to similar code in the events.txt file. Please help. Following is the log error and Lua code for a couple of examples: 132562 *** LUA Error: C:\FSUIPC7\MSFSLua\DA62_12Keys.lua:68: attempt to call field 'CalcCode' (a nil value) 68 ipc.CalcCode("1 (>K:SET_STARTER1_HELD)") 128500 *** LUA Error: C:\FSUIPC7\MSFSLua\DA62_12Keys.lua:120: attempt to call field 'CalcCode' (a nil value) 120 ipc.CalcCode("1 (>K:ENGINE_MASTER_1_TOGGLE)") 130234 *** LUA Error: C:\FSUIPC7\MSFSLua\DA62_12Keys.lua:149: attempt to call field 'CalcCode' (a nil value) 149 ipc.CalcCode("1 (>K:ENGINE_MASTER_2_TOGGLE)") Sample events I looked are: PA24_250_Magneto_Both#3 (>K:MAGNETO1_SET) PA24_250_Magneto_Left#2 (>K:MAGNETO1_SET) PA24_250_Magneto_Off#0 (>K:MAGNETO1_SET) PA24_250_Magneto_Right#1 (>K:MAGNETO1_SET) For the life of me I can't figure out why. Thanks DA62_12Keys.log DA62_12Keys.lua FSUIPC7.ini FSUIPC7.log
DaveSCUSA Posted March 19 Author Report Posted March 19 Duh, thank you. That's why in progtramming one has walksthru. Or better error descriptions in compilers.
kaha Posted March 19 Report Posted March 19 1 hour ago, DaveSCUSA said: Duh, thank you. That's why in progtramming one has walksthru. Or better error descriptions in compilers. Well, the error description is spot on. ipc is a table and "execCalcCode" is a field in this table.. Look at this, both syntaxes are valid: ipc.execCalcCode("1 (>K:SET_STARTER1_HELD)") ipc["execCalcCode"]("1 (>K:SET_STARTER1_HELD)") The error message tells you that there is no table entry with key "CalcCode" (there is no field named "CalcCode") in table ipc. Karl
John Dowson Posted March 19 Report Posted March 19 4 hours ago, DaveSCUSA said: That's why in progtramming one has walksthru. Or better error descriptions in compilers. Or maybe try looking at the provided documentation.... 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now